From 643ad0e483826d6a024ef61e082278e8d4d4d693 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 27 Oct 2025 14:39:23 +0000 Subject: [PATCH 01/14] Initial plan From 76d98882f7ba0e8f497d003f540def3a92f25130 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 27 Oct 2025 14:47:57 +0000 Subject: [PATCH 02/14] Initial analysis - test harness and marking issues identified Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.com> --- coverage.xml | 1966 +++++++++++++++++++----------------- src/codeweaver/_version.py | 2 +- 2 files changed, 1051 insertions(+), 917 deletions(-) diff --git a/coverage.xml b/coverage.xml index 8602f1e2..13ebd463 100644 --- a/coverage.xml +++ b/coverage.xml @@ -1,5 +1,5 @@ - + @@ -2119,46 +2119,46 @@ + + + - - - - - + + + + + - - - + + + - - - + + + - - + - - - + + + + - - - - - - + + + @@ -3230,7 +3230,7 @@ - + @@ -3411,7 +3411,7 @@ - + @@ -3433,82 +3433,104 @@ - - - - + + + - - - - - - + + + + + + + + + - - - - - - - - + + + + + - + + + - - + + + - + - + - - - - - + + + - - - - - - - + - - - - - - - + + + + + + + + + - - - + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -3566,38 +3588,37 @@ - + - + - - + + - - + + - + - + - - - + + + - - - - - - + + + + + @@ -3610,29 +3631,29 @@ + - - - + + - - - - - - - - - - + + + + + + + + + + - - - - - - + + + + + + @@ -3652,9 +3673,9 @@ - - - + + + @@ -3677,385 +3698,435 @@ - - + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - + + - - - - - - + + + + + + + - + - - - + + - - - - - - - - - + + + + + + + + + + - - - - - - + + + + + - - - - + + + + + - - + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + - + - + - + - - + + - - + + - - - - - - - + + + + + + + + + + + + - + + - - - + - - - - + - - - + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - + - - + + + - - - - - - - - - - + + + + + + + + - - - - - - + + + + + + - - - - - + + - - + + + - - - - - - + + + + + + - - + - - - - + + - - - - - + + + - - - - + + + - + + + + + + + - - - - - + + + + - - + + + + + - + + - - - - - - - - - + + + + + + - + - - - - + + + + + + - - - - + + + + + + + + + + - - - - - + + + - - - - - + + - - - + + + + - - - - - - - - - - - + + + + + + + + + + + + - - - - - - + + + + + + + + - - + + + + + + + - - + + + + + + + + + + + + + + + + + + + @@ -5979,7 +6050,7 @@ - + @@ -6053,7 +6124,7 @@ - + @@ -6070,403 +6141,443 @@ - - - - - + + + - - - - - - - + + + + + + - - + + + + + - + + + + - - - - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + - - - - - - - + - + + + + - - - - - + + + + + + + + + - + - + - - - - - - + + + + + + - - - - - + + + + - - - - - + - - - - - - - + + - - - - - - - + + + + - - - - - - - - + - - + + + - - - - + + - - - + + + + + - - + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - + - + - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - + - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + - - - - + + + + + + - - - - - - + + + - - - + + + + + + - - - + + + + - - - - - - + + + - - + + - - - - + + + + + + + + + + + + + - - + + + - + - - + - - - + + - - - - - - - - - - - + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + - - + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - - + + + - - - - - - + + + + + + - - - - - - - - + + + + + + + + + + + + - + - - - - - + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -6821,7 +6932,7 @@ - + @@ -6832,51 +6943,53 @@ - - - - - - + + + + + + - + - - + + + - - - - - + + + + + + + - + - - - - + + + + - - + + - - - + + - + @@ -6911,183 +7024,200 @@ - + - - + + + - + - - - + - + + - - - - - + + + - + - - - + + + - + - - - - - - - - - - - - - - + + + + + + + - + - + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - + - + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - + - - - - - - + + + + - - - - - - - - - + + + + + + + + + - - - - - - - + - - - + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -10625,7 +10755,7 @@ - + @@ -10651,74 +10781,78 @@ - + - + - + - - - - + + + + - - + + - - - - - - + + + + + - + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/src/codeweaver/_version.py b/src/codeweaver/_version.py index 95ee65f2..64ab78c9 100644 --- a/src/codeweaver/_version.py +++ b/src/codeweaver/_version.py @@ -4,6 +4,6 @@ from typing import Final -__version__: Final[str] = "0.0.1rc295+gfc4f90a" +__version__: Final[str] = "0.0.1rc2+g643ad0e" __all__ = ("__version__",) From e9afad76a18123fc77dc1200d3ebe0c118fb942d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 27 Oct 2025 15:01:02 +0000 Subject: [PATCH 03/14] Fix test collection and apply consistent test marks - Added --import-mode=importlib to pytest config to fix namespace collision - Applied pytestmark to all test files consistently - Fixed test_selector.py and test_semantic_basic.py missing pytest import - All 182 tests now collect successfully with proper marks Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.com> --- coverage.xml | 932 +++++++++--------- pyproject.toml | 1 + src/codeweaver/_version.py | 2 +- tests/benchmark/chunker/test_performance.py | 6 + tests/contract/test_memory_provider.py | 5 +- tests/contract/test_qdrant_provider.py | 8 +- tests/contract/test_vector_store_provider.py | 6 + tests/integration/chunker/test_e2e.py | 6 + tests/integration/test_custom_config.py | 5 +- tests/integration/test_hybrid_ranking.py | 5 +- tests/integration/test_hybrid_storage.py | 5 +- tests/integration/test_incremental_updates.py | 5 +- tests/integration/test_memory_persistence.py | 5 +- tests/integration/test_partial_embeddings.py | 5 +- tests/integration/test_persistence.py | 5 +- tests/integration/test_provider_switch.py | 5 +- .../test_vector_store_performance.py | 6 + tests/test_delimiters.py | 2 + tests/test_lazy_importer.py | 2 + .../engine/chunker/test_delimiter_basic.py | 5 + .../chunker/test_delimiter_edge_cases.py | 6 + tests/unit/engine/chunker/test_governance.py | 6 + tests/unit/engine/chunker/test_selector.py | 8 + .../engine/chunker/test_semantic_basic.py | 8 +- .../engine/chunker/test_semantic_dedup.py | 6 + .../chunker/test_semantic_edge_cases.py | 6 + .../engine/chunker/test_semantic_errors.py | 6 + .../engine/chunker/test_semantic_oversized.py | 6 + 28 files changed, 594 insertions(+), 479 deletions(-) diff --git a/coverage.xml b/coverage.xml index 13ebd463..0ae3aaae 100644 --- a/coverage.xml +++ b/coverage.xml @@ -1,5 +1,5 @@ - + @@ -1985,7 +1985,7 @@ - + @@ -2052,7 +2052,7 @@ - + @@ -2093,31 +2093,31 @@ - + - - + + - - - - - + + + + + - - + + - - - + + + - - - - + + + + - + @@ -2142,13 +2142,13 @@ - - - - - + + + + + - + @@ -2228,7 +2228,7 @@ - + @@ -2261,8 +2261,8 @@ - - + + @@ -3230,7 +3230,7 @@ - + @@ -3254,7 +3254,7 @@ - + @@ -3377,17 +3377,17 @@ - + - + - + - + @@ -3411,7 +3411,7 @@ - + @@ -3452,12 +3452,12 @@ - - - - + + + + - + @@ -3588,7 +3588,7 @@ - + @@ -3719,43 +3719,43 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3789,17 +3789,17 @@ - - - + + + - - - + + + @@ -3830,11 +3830,11 @@ - + - - + + @@ -3866,7 +3866,7 @@ - + @@ -4114,15 +4114,15 @@ - - + + - - - + + + - - + + @@ -4395,7 +4395,7 @@ - + @@ -4518,9 +4518,9 @@ - + - + @@ -4609,7 +4609,7 @@ - + @@ -4634,7 +4634,7 @@ - + @@ -6050,7 +6050,7 @@ - + @@ -6069,7 +6069,7 @@ - + @@ -6101,12 +6101,12 @@ - + - + @@ -6118,13 +6118,13 @@ - - - + + + - + @@ -6147,302 +6147,302 @@ - - - + + + - - - + + + - - - - - - - - - - + + + + + + + + + + - + - + - - + + - + - - + + - - - + + + - + - - - + + + - - - - - - + + + + + + - + - - - - - - + + + + + + - - + + - - - - - + + + + + - - - - - - - - - - + + + + + + + + + + - - + + - - - - - - - - - - + + + + + + + + + + - - - - - + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + - - - - - - + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - + + + + - + - - - - + + + + - + - - + + - + - + - - - - - + + + + + - - - - - + + + + + - + - - - + + + - - - - - - - - - - + + + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - + + + + + + - + - - + + - + - + - - - - - - - + + + + + + + - - + + - - - - - + + + + + - - - - - + + + + + - - - - - - - - - - + + + + + + + + + + - - - + + + - - - - + + + + @@ -6458,129 +6458,129 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + - - - - - + + + + + - + - + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - + - - - - - - - - - - - + + + + + + + + + + + - - - - + + + + - - - + + + - - + + - + - - - + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - + @@ -6601,12 +6601,12 @@ - + - - - + + + @@ -6615,7 +6615,7 @@ - + @@ -6623,7 +6623,7 @@ - + @@ -6725,7 +6725,7 @@ - + @@ -6734,29 +6734,29 @@ - - - + + + - - - + + + - - + + - + - - + + - + - - - + + + @@ -7222,7 +7222,7 @@ - + @@ -7323,7 +7323,7 @@ - + @@ -7348,25 +7348,25 @@ - - - + + + - - + + - + - - + + - - - + + + @@ -7403,7 +7403,7 @@ - + @@ -7449,38 +7449,38 @@ - + - + - + - + - + - + - + - + - - - - - + + + + + - + - + @@ -7515,10 +7515,10 @@ - - - - + + + + diff --git a/pyproject.toml b/pyproject.toml index 3ab974db..c99a7e5b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -566,6 +566,7 @@ addopts = [ "--cov-report=html", "--cov-report=xml", "--cov-fail-under=80", + "--import-mode=importlib", ] testpaths = ["tests"] python_files = ["test_*.py", "*_test.py"] diff --git a/src/codeweaver/_version.py b/src/codeweaver/_version.py index 64ab78c9..049b3823 100644 --- a/src/codeweaver/_version.py +++ b/src/codeweaver/_version.py @@ -4,6 +4,6 @@ from typing import Final -__version__: Final[str] = "0.0.1rc2+g643ad0e" +__version__: Final[str] = "0.0.1rc3+g76d9888" __all__ = ("__version__",) diff --git a/tests/benchmark/chunker/test_performance.py b/tests/benchmark/chunker/test_performance.py index 103a33bb..821ca45d 100644 --- a/tests/benchmark/chunker/test_performance.py +++ b/tests/benchmark/chunker/test_performance.py @@ -23,6 +23,9 @@ from codeweaver.engine.chunker.selector import ChunkerSelector from codeweaver.providers.embedding.capabilities.base import EmbeddingModelCapabilities +pytestmark = [pytest.mark.benchmark, pytest.mark.performance, pytest.mark.slow] + + # Test data generators def generate_python_file(num_lines: int) -> str: @@ -367,6 +370,9 @@ def test_concurrent_chunking_safety(self, selector): """Verify concurrent chunking operations are safe.""" import concurrent.futures + + + def chunk_file(file_id: int): content = generate_python_file(300) file_path = Path(f"concurrent_{file_id}.py") diff --git a/tests/contract/test_memory_provider.py b/tests/contract/test_memory_provider.py index 0afeb199..110a6d7d 100644 --- a/tests/contract/test_memory_provider.py +++ b/tests/contract/test_memory_provider.py @@ -20,10 +20,10 @@ from codeweaver.core.spans import Span from codeweaver.providers.vector_stores.inmemory import MemoryVectorStore - pytestmark = pytest.mark.unit + @pytest.fixture def temp_persist_path(): """Provide temporary persistence path for testing.""" @@ -158,6 +158,9 @@ async def test_persistence_file_format(self, memory_provider, memory_config, sam """Test persistence file has correct JSON structure.""" import json + + + await memory_provider.upsert([sample_chunk]) await memory_provider._persist_to_disk() diff --git a/tests/contract/test_qdrant_provider.py b/tests/contract/test_qdrant_provider.py index f3b8980a..e032254a 100644 --- a/tests/contract/test_qdrant_provider.py +++ b/tests/contract/test_qdrant_provider.py @@ -21,11 +21,12 @@ from codeweaver.core.spans import Span from codeweaver.providers.vector_stores.qdrant import QdrantVectorStore - -# Mark all tests in this module as requiring Qdrant pytestmark = [pytest.mark.integration, pytest.mark.external_api] + +# Mark all tests in this module as requiring Qdrant + @pytest.fixture async def qdrant_config(): """Provide test Qdrant configuration.""" @@ -83,6 +84,9 @@ async def test_implements_vector_store_provider(self): """Verify QdrantVectorStore implements VectorStoreProvider interface.""" from codeweaver.providers.vector_stores.base import VectorStoreProvider + + + assert issubclass(QdrantVectorStore, VectorStoreProvider) async def test_list_collections(self, qdrant_provider): diff --git a/tests/contract/test_vector_store_provider.py b/tests/contract/test_vector_store_provider.py index b5d71963..de16ecf4 100644 --- a/tests/contract/test_vector_store_provider.py +++ b/tests/contract/test_vector_store_provider.py @@ -16,6 +16,12 @@ from codeweaver.providers.vector_stores.base import VectorStoreProvider +pytestmark = [pytest.mark.unit, pytest.mark.validation] + + + + + class TestVectorStoreProviderContract: """Test VectorStoreProvider abstract interface contract compliance.""" diff --git a/tests/integration/chunker/test_e2e.py b/tests/integration/chunker/test_e2e.py index 37ab638b..286f3680 100644 --- a/tests/integration/chunker/test_e2e.py +++ b/tests/integration/chunker/test_e2e.py @@ -14,6 +14,9 @@ from codeweaver.engine.chunker.selector import ChunkerSelector +pytestmark = [pytest.mark.integration] + + @pytest.fixture def mock_governor(): @@ -263,6 +266,9 @@ def test_e2e_parallel_dict_convenience(): from codeweaver.engine.chunker.parallel import chunk_files_parallel_dict from codeweaver.providers.embedding.capabilities.base import EmbeddingModelCapabilities + + + # Get sample files fixture_dir = Path("tests/fixtures") files = [] diff --git a/tests/integration/test_custom_config.py b/tests/integration/test_custom_config.py index c2460bcc..d1e75016 100644 --- a/tests/integration/test_custom_config.py +++ b/tests/integration/test_custom_config.py @@ -13,10 +13,13 @@ from codeweaver.providers.vector_stores.qdrant import QdrantVectorStore - pytestmark = [pytest.mark.integration, pytest.mark.external_api] + + + + async def test_custom_configuration(): """ User Story: Customize provider settings like collection names. diff --git a/tests/integration/test_hybrid_ranking.py b/tests/integration/test_hybrid_ranking.py index f9600ffc..3bb16cdc 100644 --- a/tests/integration/test_hybrid_ranking.py +++ b/tests/integration/test_hybrid_ranking.py @@ -17,10 +17,13 @@ from codeweaver.core.language import SemanticSearchLanguage as Language from codeweaver.providers.vector_stores.qdrant import QdrantVectorStore - pytestmark = [pytest.mark.integration, pytest.mark.external_api] + + + + async def test_hybrid_search_ranking(): """ User Story: Hybrid search combines sparse and dense for better relevance. diff --git a/tests/integration/test_hybrid_storage.py b/tests/integration/test_hybrid_storage.py index 42185c6a..f58a2aff 100644 --- a/tests/integration/test_hybrid_storage.py +++ b/tests/integration/test_hybrid_storage.py @@ -17,10 +17,13 @@ from codeweaver.core.language import SemanticSearchLanguage as Language from codeweaver.providers.vector_stores.qdrant import QdrantVectorStore - pytestmark = [pytest.mark.integration, pytest.mark.external_api] + + + + @pytest.fixture async def qdrant_provider(): """Create Qdrant provider for testing.""" diff --git a/tests/integration/test_incremental_updates.py b/tests/integration/test_incremental_updates.py index 16d278fd..5831933c 100644 --- a/tests/integration/test_incremental_updates.py +++ b/tests/integration/test_incremental_updates.py @@ -17,10 +17,13 @@ from codeweaver.core.language import SemanticSearchLanguage as Language from codeweaver.providers.vector_stores.qdrant import QdrantVectorStore - pytestmark = [pytest.mark.integration, pytest.mark.external_api] + + + + async def test_incremental_updates(): """ User Story: File updates only re-index changed chunks. diff --git a/tests/integration/test_memory_persistence.py b/tests/integration/test_memory_persistence.py index ea8a0827..074d8524 100644 --- a/tests/integration/test_memory_persistence.py +++ b/tests/integration/test_memory_persistence.py @@ -19,10 +19,13 @@ from codeweaver.core.language import SemanticSearchLanguage as Language from codeweaver.providers.vector_stores.inmemory import MemoryVectorStore - pytestmark = pytest.mark.integration + + + + async def test_inmemory_persistence(): """ User Story: Use in-memory storage with automatic persistence. diff --git a/tests/integration/test_partial_embeddings.py b/tests/integration/test_partial_embeddings.py index 30076f5f..698622c6 100644 --- a/tests/integration/test_partial_embeddings.py +++ b/tests/integration/test_partial_embeddings.py @@ -17,10 +17,13 @@ from codeweaver.core.language import SemanticSearchLanguage as Language from codeweaver.providers.vector_stores.qdrant import QdrantVectorStore - pytestmark = [pytest.mark.integration, pytest.mark.external_api] + + + + async def test_partial_embeddings(): """ User Story: Handle cases where dense embedding generation fails. diff --git a/tests/integration/test_persistence.py b/tests/integration/test_persistence.py index 76c16216..4774155a 100644 --- a/tests/integration/test_persistence.py +++ b/tests/integration/test_persistence.py @@ -17,10 +17,13 @@ from codeweaver.core.language import SemanticSearchLanguage as Language from codeweaver.providers.vector_stores.qdrant import QdrantVectorStore - pytestmark = [pytest.mark.integration, pytest.mark.external_api] + + + + async def test_persistence_across_restarts(): """ User Story: Previously indexed data persists across restarts. diff --git a/tests/integration/test_provider_switch.py b/tests/integration/test_provider_switch.py index afa333ee..7dbe5b7b 100644 --- a/tests/integration/test_provider_switch.py +++ b/tests/integration/test_provider_switch.py @@ -19,10 +19,13 @@ from codeweaver.providers.vector_stores.inmemory import MemoryVectorStore from codeweaver.providers.vector_stores.qdrant import QdrantVectorStore - pytestmark = [pytest.mark.integration, pytest.mark.external_api] + + + + async def test_provider_switch_detection(): """ User Story: Warn when switching providers to prevent data loss. diff --git a/tests/performance/test_vector_store_performance.py b/tests/performance/test_vector_store_performance.py index b4c2fe58..c009967a 100644 --- a/tests/performance/test_vector_store_performance.py +++ b/tests/performance/test_vector_store_performance.py @@ -34,6 +34,12 @@ from codeweaver.providers.vector_stores.inmemory import MemoryVectorStore from codeweaver.providers.vector_stores.qdrant import QdrantVectorStore +pytestmark = [pytest.mark.async_test, pytest.mark.performance, pytest.mark.slow] + + + + + # Test data generation helpers def create_test_chunk( diff --git a/tests/test_delimiters.py b/tests/test_delimiters.py index f98659d2..1d77b132 100644 --- a/tests/test_delimiters.py +++ b/tests/test_delimiters.py @@ -23,6 +23,8 @@ detect_language_family, ) from codeweaver.engine.chunker.delimiters.kind import DelimiterKind + +pytestmark = [pytest.mark.unit] from codeweaver.engine.chunker.delimiters.patterns import ( ALL_PATTERNS, CONDITIONAL_PATTERN, diff --git a/tests/test_lazy_importer.py b/tests/test_lazy_importer.py index 42f1b005..4928302d 100644 --- a/tests/test_lazy_importer.py +++ b/tests/test_lazy_importer.py @@ -13,6 +13,8 @@ from codeweaver.common.utils.lazy_importer import LazyImport, lazy_import +pytestmark = [pytest.mark.unit] + class TestLazyImportBasics: """Test basic LazyImport functionality.""" diff --git a/tests/unit/engine/chunker/test_delimiter_basic.py b/tests/unit/engine/chunker/test_delimiter_basic.py index 13942351..aad62e71 100644 --- a/tests/unit/engine/chunker/test_delimiter_basic.py +++ b/tests/unit/engine/chunker/test_delimiter_basic.py @@ -25,6 +25,9 @@ from codeweaver.engine.chunker.delimiter import DelimiterChunker from codeweaver.engine.chunker.delimiters.kind import DelimiterKind +pytestmark = [pytest.mark.unit] + + @pytest.fixture def governor() -> ChunkGovernor: @@ -395,6 +398,8 @@ def another_function(): # Create DiscoveredFile and chunk the code from codeweaver.core.discovery import DiscoveredFile + + discovered_file = DiscoveredFile.from_path(test_file) chunks = delimiter_chunker.chunk(code, file=discovered_file) diff --git a/tests/unit/engine/chunker/test_delimiter_edge_cases.py b/tests/unit/engine/chunker/test_delimiter_edge_cases.py index 3f661a7c..683b77c8 100644 --- a/tests/unit/engine/chunker/test_delimiter_edge_cases.py +++ b/tests/unit/engine/chunker/test_delimiter_edge_cases.py @@ -19,6 +19,9 @@ from codeweaver.engine.chunker.base import ChunkGovernor from codeweaver.engine.chunker.delimiter import DelimiterChunker +pytestmark = [pytest.mark.unit] + + @pytest.fixture def delimiter_chunker(chunk_governor: ChunkGovernor) -> DelimiterChunker: @@ -338,6 +341,9 @@ def test_unmatched_delimiters( # Create DiscoveredFile - should not crash, should produce some chunks from codeweaver.core.discovery import DiscoveredFile + + + discovered_file = DiscoveredFile.from_path(file_path) chunks = delimiter_chunker.chunk(content, file=discovered_file) diff --git a/tests/unit/engine/chunker/test_governance.py b/tests/unit/engine/chunker/test_governance.py index 4bafafec..3ec52c94 100644 --- a/tests/unit/engine/chunker/test_governance.py +++ b/tests/unit/engine/chunker/test_governance.py @@ -16,6 +16,12 @@ from codeweaver.engine.chunker.exceptions import ChunkingTimeoutError, ChunkLimitExceededError from codeweaver.engine.chunker.governance import ResourceGovernor +pytestmark = [pytest.mark.unit] + + + + + class PerformanceSettings(Protocol): """Minimal protocol for testing.""" diff --git a/tests/unit/engine/chunker/test_selector.py b/tests/unit/engine/chunker/test_selector.py index 92e0a7fa..a91a09e2 100644 --- a/tests/unit/engine/chunker/test_selector.py +++ b/tests/unit/engine/chunker/test_selector.py @@ -7,11 +7,19 @@ from pathlib import Path from unittest.mock import Mock +import pytest + from codeweaver.engine.chunker.base import ChunkGovernor from codeweaver.engine.chunker.delimiter import DelimiterChunker from codeweaver.engine.chunker.selector import ChunkerSelector from codeweaver.engine.chunker.semantic import SemanticChunker +pytestmark = [pytest.mark.unit] + + + + + def test_selector_chooses_semantic_for_python(chunk_governor: ChunkGovernor) -> None: """Verify selector picks semantic for supported language.""" diff --git a/tests/unit/engine/chunker/test_semantic_basic.py b/tests/unit/engine/chunker/test_semantic_basic.py index f6b49d11..ca40913c 100644 --- a/tests/unit/engine/chunker/test_semantic_basic.py +++ b/tests/unit/engine/chunker/test_semantic_basic.py @@ -11,12 +11,18 @@ Python, JavaScript, and Rust. """ - +import pytest from codeweaver.core.language import SemanticSearchLanguage from codeweaver.engine.chunker import SemanticChunker from codeweaver.engine.chunker.base import ChunkGovernor +pytestmark = [pytest.mark.unit] + + + + + def test_semantic_chunks_python_file( chunk_governor: ChunkGovernor, discovered_sample_python_file diff --git a/tests/unit/engine/chunker/test_semantic_dedup.py b/tests/unit/engine/chunker/test_semantic_dedup.py index 6bccfce3..dc83f5f7 100644 --- a/tests/unit/engine/chunker/test_semantic_dedup.py +++ b/tests/unit/engine/chunker/test_semantic_dedup.py @@ -20,6 +20,9 @@ from codeweaver.engine.chunker.base import ChunkGovernor from codeweaver.engine.chunker.semantic import SemanticChunker +pytestmark = [pytest.mark.unit] + + @pytest.fixture def chunk_governor() -> ChunkGovernor: @@ -257,6 +260,9 @@ def test_batch_id_tracking( # Create DiscoveredFile and chunk the file from codeweaver.core.discovery import DiscoveredFile + + + discovered_file = DiscoveredFile.from_path(python_file_with_unique_functions) chunks = semantic_chunker.chunk(content, file=discovered_file) diff --git a/tests/unit/engine/chunker/test_semantic_edge_cases.py b/tests/unit/engine/chunker/test_semantic_edge_cases.py index 7610a3c7..4e9552a8 100644 --- a/tests/unit/engine/chunker/test_semantic_edge_cases.py +++ b/tests/unit/engine/chunker/test_semantic_edge_cases.py @@ -12,6 +12,12 @@ from codeweaver.engine.chunker.base import ChunkGovernor from codeweaver.engine.chunker.exceptions import BinaryFileError +pytestmark = [pytest.mark.unit] + + + + + def test_empty_file(chunk_governor: ChunkGovernor, discovered_empty_file) -> None: """Verify empty file returns empty list.""" diff --git a/tests/unit/engine/chunker/test_semantic_errors.py b/tests/unit/engine/chunker/test_semantic_errors.py index 168ee358..8a4d2b4b 100644 --- a/tests/unit/engine/chunker/test_semantic_errors.py +++ b/tests/unit/engine/chunker/test_semantic_errors.py @@ -33,6 +33,9 @@ if TYPE_CHECKING: from pytest import MonkeyPatch +pytestmark = [pytest.mark.unit] + + # Path to test fixtures directory FIXTURES_DIR = Path(__file__).parent.parent.parent.parent / "fixtures" @@ -258,6 +261,9 @@ def test_chunk_limit_exceeded( from codeweaver.core.language import SemanticSearchLanguage from codeweaver.engine.chunker.semantic import SemanticChunker + + + # Arrange: Create chunker with very low chunk limit mock_governor.settings.performance.max_chunks_per_file = 10 # Very low limit for testing diff --git a/tests/unit/engine/chunker/test_semantic_oversized.py b/tests/unit/engine/chunker/test_semantic_oversized.py index da446899..2edd1b99 100644 --- a/tests/unit/engine/chunker/test_semantic_oversized.py +++ b/tests/unit/engine/chunker/test_semantic_oversized.py @@ -22,6 +22,12 @@ from codeweaver.engine.chunker.base import ChunkGovernor from codeweaver.engine.chunker.semantic import SemanticChunker +pytestmark = [pytest.mark.unit] + + + + + @pytest.fixture def python_chunker(chunk_governor: ChunkGovernor) -> SemanticChunker: From 6524bbbf36bb1cda3ec36544568d48e4417fefbe Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 27 Oct 2025 15:07:23 +0000 Subject: [PATCH 04/14] Fix code review feedback - pytestmark placement and spacing - Moved pytestmark in test_delimiters.py to after all imports - Reduced excessive blank lines after pytestmark to single blank line - All tests still collect and run correctly Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.com> --- coverage.xml | 2 +- tests/test_delimiters.py | 4 ++-- tests/unit/engine/chunker/test_governance.py | 4 ---- tests/unit/engine/chunker/test_selector.py | 4 ---- tests/unit/engine/chunker/test_semantic_basic.py | 4 ---- tests/unit/engine/chunker/test_semantic_edge_cases.py | 4 ---- tests/unit/engine/chunker/test_semantic_oversized.py | 4 ---- 7 files changed, 3 insertions(+), 23 deletions(-) diff --git a/coverage.xml b/coverage.xml index 0ae3aaae..c8a82082 100644 --- a/coverage.xml +++ b/coverage.xml @@ -1,5 +1,5 @@ - + diff --git a/tests/test_delimiters.py b/tests/test_delimiters.py index 1d77b132..6bb23f2f 100644 --- a/tests/test_delimiters.py +++ b/tests/test_delimiters.py @@ -23,8 +23,6 @@ detect_language_family, ) from codeweaver.engine.chunker.delimiters.kind import DelimiterKind - -pytestmark = [pytest.mark.unit] from codeweaver.engine.chunker.delimiters.patterns import ( ALL_PATTERNS, CONDITIONAL_PATTERN, @@ -38,6 +36,8 @@ matches_pattern, ) +pytestmark = [pytest.mark.unit] + class TestDelimiterPattern: """Test DelimiterPattern DSL and expansion.""" diff --git a/tests/unit/engine/chunker/test_governance.py b/tests/unit/engine/chunker/test_governance.py index 3ec52c94..ef3c469c 100644 --- a/tests/unit/engine/chunker/test_governance.py +++ b/tests/unit/engine/chunker/test_governance.py @@ -19,10 +19,6 @@ pytestmark = [pytest.mark.unit] - - - - class PerformanceSettings(Protocol): """Minimal protocol for testing.""" diff --git a/tests/unit/engine/chunker/test_selector.py b/tests/unit/engine/chunker/test_selector.py index a91a09e2..076571f6 100644 --- a/tests/unit/engine/chunker/test_selector.py +++ b/tests/unit/engine/chunker/test_selector.py @@ -17,10 +17,6 @@ pytestmark = [pytest.mark.unit] - - - - def test_selector_chooses_semantic_for_python(chunk_governor: ChunkGovernor) -> None: """Verify selector picks semantic for supported language.""" selector = ChunkerSelector(chunk_governor) diff --git a/tests/unit/engine/chunker/test_semantic_basic.py b/tests/unit/engine/chunker/test_semantic_basic.py index ca40913c..8b4e4e34 100644 --- a/tests/unit/engine/chunker/test_semantic_basic.py +++ b/tests/unit/engine/chunker/test_semantic_basic.py @@ -20,10 +20,6 @@ pytestmark = [pytest.mark.unit] - - - - def test_semantic_chunks_python_file( chunk_governor: ChunkGovernor, discovered_sample_python_file ) -> None: diff --git a/tests/unit/engine/chunker/test_semantic_edge_cases.py b/tests/unit/engine/chunker/test_semantic_edge_cases.py index 4e9552a8..c22194a8 100644 --- a/tests/unit/engine/chunker/test_semantic_edge_cases.py +++ b/tests/unit/engine/chunker/test_semantic_edge_cases.py @@ -15,10 +15,6 @@ pytestmark = [pytest.mark.unit] - - - - def test_empty_file(chunk_governor: ChunkGovernor, discovered_empty_file) -> None: """Verify empty file returns empty list.""" content = discovered_empty_file.contents diff --git a/tests/unit/engine/chunker/test_semantic_oversized.py b/tests/unit/engine/chunker/test_semantic_oversized.py index 2edd1b99..3b87c78d 100644 --- a/tests/unit/engine/chunker/test_semantic_oversized.py +++ b/tests/unit/engine/chunker/test_semantic_oversized.py @@ -25,10 +25,6 @@ pytestmark = [pytest.mark.unit] - - - - @pytest.fixture def python_chunker(chunk_governor: ChunkGovernor) -> SemanticChunker: """Create semantic chunker for Python.""" From c87ef5a151590e99f9283a5b21a1197a905e6ac9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 27 Oct 2025 15:10:32 +0000 Subject: [PATCH 05/14] Fix test collection namespace collision and apply consistent pytest marks Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.com> --- coverage.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coverage.xml b/coverage.xml index c8a82082..7e9bb22b 100644 --- a/coverage.xml +++ b/coverage.xml @@ -1,5 +1,5 @@ - + From 0bf37bad533f5f47112e9b7de684dc8256ac5408 Mon Sep 17 00:00:00 2001 From: Adam Poulemanos <89049923+bashandbone@users.noreply.github.com> Date: Mon, 27 Oct 2025 12:30:08 -0400 Subject: [PATCH 06/14] Update tests/unit/engine/chunker/test_semantic_errors.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Adam Poulemanos <89049923+bashandbone@users.noreply.github.com> --- tests/unit/engine/chunker/test_semantic_errors.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/unit/engine/chunker/test_semantic_errors.py b/tests/unit/engine/chunker/test_semantic_errors.py index 8a4d2b4b..206b50d1 100644 --- a/tests/unit/engine/chunker/test_semantic_errors.py +++ b/tests/unit/engine/chunker/test_semantic_errors.py @@ -261,9 +261,6 @@ def test_chunk_limit_exceeded( from codeweaver.core.language import SemanticSearchLanguage from codeweaver.engine.chunker.semantic import SemanticChunker - - - # Arrange: Create chunker with very low chunk limit mock_governor.settings.performance.max_chunks_per_file = 10 # Very low limit for testing From 212ef8fb5ebe731de79717ae0d45ac228f3d4d0c Mon Sep 17 00:00:00 2001 From: Adam Poulemanos <89049923+bashandbone@users.noreply.github.com> Date: Mon, 27 Oct 2025 12:30:18 -0400 Subject: [PATCH 07/14] Update tests/unit/engine/chunker/test_delimiter_edge_cases.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Adam Poulemanos <89049923+bashandbone@users.noreply.github.com> --- tests/unit/engine/chunker/test_delimiter_edge_cases.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/unit/engine/chunker/test_delimiter_edge_cases.py b/tests/unit/engine/chunker/test_delimiter_edge_cases.py index 683b77c8..4f426e35 100644 --- a/tests/unit/engine/chunker/test_delimiter_edge_cases.py +++ b/tests/unit/engine/chunker/test_delimiter_edge_cases.py @@ -340,10 +340,6 @@ def test_unmatched_delimiters( # Create DiscoveredFile - should not crash, should produce some chunks from codeweaver.core.discovery import DiscoveredFile - - - - discovered_file = DiscoveredFile.from_path(file_path) chunks = delimiter_chunker.chunk(content, file=discovered_file) From 20b02e57721051446fe2e44a9fcc2d43aea111b6 Mon Sep 17 00:00:00 2001 From: Adam Poulemanos <89049923+bashandbone@users.noreply.github.com> Date: Mon, 27 Oct 2025 12:30:28 -0400 Subject: [PATCH 08/14] Update tests/unit/engine/chunker/test_delimiter_basic.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Adam Poulemanos <89049923+bashandbone@users.noreply.github.com> --- tests/unit/engine/chunker/test_delimiter_basic.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/unit/engine/chunker/test_delimiter_basic.py b/tests/unit/engine/chunker/test_delimiter_basic.py index aad62e71..2271d057 100644 --- a/tests/unit/engine/chunker/test_delimiter_basic.py +++ b/tests/unit/engine/chunker/test_delimiter_basic.py @@ -398,8 +398,6 @@ def another_function(): # Create DiscoveredFile and chunk the code from codeweaver.core.discovery import DiscoveredFile - - discovered_file = DiscoveredFile.from_path(test_file) chunks = delimiter_chunker.chunk(code, file=discovered_file) From 8dffb12c148e7f32fba1ba8fdd1b2b98fb1ee3b7 Mon Sep 17 00:00:00 2001 From: Adam Poulemanos <89049923+bashandbone@users.noreply.github.com> Date: Mon, 27 Oct 2025 12:30:43 -0400 Subject: [PATCH 09/14] Update tests/benchmark/chunker/test_performance.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Adam Poulemanos <89049923+bashandbone@users.noreply.github.com> --- tests/benchmark/chunker/test_performance.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/benchmark/chunker/test_performance.py b/tests/benchmark/chunker/test_performance.py index 821ca45d..0b6dd0c8 100644 --- a/tests/benchmark/chunker/test_performance.py +++ b/tests/benchmark/chunker/test_performance.py @@ -370,9 +370,6 @@ def test_concurrent_chunking_safety(self, selector): """Verify concurrent chunking operations are safe.""" import concurrent.futures - - - def chunk_file(file_id: int): content = generate_python_file(300) file_path = Path(f"concurrent_{file_id}.py") From a8025cc7eb9d473058c3fe0f10af4d5916243bc7 Mon Sep 17 00:00:00 2001 From: Adam Poulemanos <89049923+bashandbone@users.noreply.github.com> Date: Mon, 27 Oct 2025 12:30:53 -0400 Subject: [PATCH 10/14] Update tests/unit/engine/chunker/test_semantic_dedup.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Adam Poulemanos <89049923+bashandbone@users.noreply.github.com> --- tests/unit/engine/chunker/test_semantic_dedup.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/unit/engine/chunker/test_semantic_dedup.py b/tests/unit/engine/chunker/test_semantic_dedup.py index dc83f5f7..51710b31 100644 --- a/tests/unit/engine/chunker/test_semantic_dedup.py +++ b/tests/unit/engine/chunker/test_semantic_dedup.py @@ -261,8 +261,6 @@ def test_batch_id_tracking( from codeweaver.core.discovery import DiscoveredFile - - discovered_file = DiscoveredFile.from_path(python_file_with_unique_functions) chunks = semantic_chunker.chunk(content, file=discovered_file) From cfa21da463b5ac4da0ed4f6c2836c6528978e38c Mon Sep 17 00:00:00 2001 From: Adam Poulemanos <89049923+bashandbone@users.noreply.github.com> Date: Mon, 27 Oct 2025 12:31:01 -0400 Subject: [PATCH 11/14] Update tests/integration/test_provider_switch.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Adam Poulemanos <89049923+bashandbone@users.noreply.github.com> --- tests/integration/test_provider_switch.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/integration/test_provider_switch.py b/tests/integration/test_provider_switch.py index 7dbe5b7b..62714b33 100644 --- a/tests/integration/test_provider_switch.py +++ b/tests/integration/test_provider_switch.py @@ -21,11 +21,6 @@ pytestmark = [pytest.mark.integration, pytest.mark.external_api] - - - - - async def test_provider_switch_detection(): """ User Story: Warn when switching providers to prevent data loss. From 97b0f4e13b13d233aac003fdb80aa57f30d2bb4f Mon Sep 17 00:00:00 2001 From: Adam Poulemanos <89049923+bashandbone@users.noreply.github.com> Date: Mon, 27 Oct 2025 12:31:11 -0400 Subject: [PATCH 12/14] Update tests/contract/test_qdrant_provider.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Adam Poulemanos <89049923+bashandbone@users.noreply.github.com> --- tests/contract/test_qdrant_provider.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/contract/test_qdrant_provider.py b/tests/contract/test_qdrant_provider.py index e032254a..3eb3ac26 100644 --- a/tests/contract/test_qdrant_provider.py +++ b/tests/contract/test_qdrant_provider.py @@ -84,9 +84,6 @@ async def test_implements_vector_store_provider(self): """Verify QdrantVectorStore implements VectorStoreProvider interface.""" from codeweaver.providers.vector_stores.base import VectorStoreProvider - - - assert issubclass(QdrantVectorStore, VectorStoreProvider) async def test_list_collections(self, qdrant_provider): From 6f089c45c75d99b947ca6cab8afac5324880183d Mon Sep 17 00:00:00 2001 From: Adam Poulemanos <89049923+bashandbone@users.noreply.github.com> Date: Mon, 27 Oct 2025 12:31:34 -0400 Subject: [PATCH 13/14] Update tests/contract/test_vector_store_provider.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Adam Poulemanos <89049923+bashandbone@users.noreply.github.com> --- tests/contract/test_vector_store_provider.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/contract/test_vector_store_provider.py b/tests/contract/test_vector_store_provider.py index de16ecf4..e9e889a1 100644 --- a/tests/contract/test_vector_store_provider.py +++ b/tests/contract/test_vector_store_provider.py @@ -18,11 +18,6 @@ pytestmark = [pytest.mark.unit, pytest.mark.validation] - - - - - class TestVectorStoreProviderContract: """Test VectorStoreProvider abstract interface contract compliance.""" From 86c8154d2584905cb7cb00ba5c2485545fa7042f Mon Sep 17 00:00:00 2001 From: Adam Poulemanos <89049923+bashandbone@users.noreply.github.com> Date: Mon, 27 Oct 2025 12:31:42 -0400 Subject: [PATCH 14/14] Update tests/contract/test_memory_provider.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Adam Poulemanos <89049923+bashandbone@users.noreply.github.com> --- tests/contract/test_memory_provider.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/contract/test_memory_provider.py b/tests/contract/test_memory_provider.py index 110a6d7d..3371ddd3 100644 --- a/tests/contract/test_memory_provider.py +++ b/tests/contract/test_memory_provider.py @@ -158,9 +158,6 @@ async def test_persistence_file_format(self, memory_provider, memory_config, sam """Test persistence file has correct JSON structure.""" import json - - - await memory_provider.upsert([sample_chunk]) await memory_provider._persist_to_disk()