test: dedup smoke fixtures + register shared config plugin (#2066)#2080
Open
yastman wants to merge 1 commit into
Open
test: dedup smoke fixtures + register shared config plugin (#2066)#2080yastman wants to merge 1 commit into
yastman wants to merge 1 commit into
Conversation
Parent: #1515 (test audit), categories D3 + D4. #2066 calls out three issues with smoke test fixtures: D3: tests/smoke/conftest.py declared its own redis_url, duplicating tests/fixtures/config.py::redis_url with a different scope. D4: tests/smoke/conftest.py read QDRANT_URL/QDRANT_COLLECTION env vars directly, with QDRANT_COLLECTION default 'gdrive_documents_bge' diverging from tests/fixtures/config.py default 'test_documents'. Root cause: tests/fixtures/config.py existed as a 'shared fixtures' file but was never registered with pytest, so its session-scoped fixtures were not actually visible to any test tier. Each tier rolled its own. Fix: 1. tests/conftest.py — declare pytest_plugins = ['tests.fixtures.config'] so the shared fixtures resolve repo-wide. 2. tests/fixtures/config.py — change qdrant_collection default from 'test_documents' to 'gdrive_documents_bge' to match telegram_bot/config.py and compose.yml. Smoke tests against the default config now hit the same collection name the bot uses end-to-end. 3. tests/smoke/conftest.py — drop the local redis_url fixture; the shared session-scoped one now resolves automatically. The require_live_services / qdrant_service / cache_service / voyage_service fixtures continue to work; they consumed redis_url via request.getfixturevalue(), which keeps working. Adds tests/contract/test_smoke_fixtures_dedup_contract.py with three invariants: - shared plugin is registered from root conftest; - qdrant_collection default == production contract value; - tests/smoke/conftest.py does not redefine any shared fixture. Verification: uv run pytest tests/contract/test_smoke_fixtures_dedup_contract.py -v 3 passed uv run pytest tests/smoke/ --collect-only -q 70 tests collected (no fixture-resolution errors) Closes #2066
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request was created by @kiro-agent on behalf of @yastman 👻
Comment with /kiro fix to address specific feedback or /kiro all to address everything.
Learn about Kiro autonomous agent
Parent: #1515 (test audit), categories D3 + D4.
#2066 calls out three issues with smoke test fixtures:
tests/smoke/conftest.pydeclared its ownredis_url, duplicatingtests/fixtures/config.py::redis_urlwith a different scope.tests/smoke/conftest.pyreadQDRANT_URL/QDRANT_COLLECTIONenv vars directly, withQDRANT_COLLECTIONdefaultgdrive_documents_bgediverging fromtests/fixtures/config.pydefaulttest_documents.Root cause:
tests/fixtures/config.pyexisted as a "shared fixtures" file but was never registered with pytest, so its session-scoped fixtures were not actually visible to any test tier. Each tier rolled its own.Fix
tests/conftest.py— declareso the shared fixtures resolve repo-wide.
tests/fixtures/config.py— changeqdrant_collectiondefault from"test_documents"to"gdrive_documents_bge"to matchtelegram_bot/config.pyandcompose.yml. Smoke tests against the default config now hit the same collection name the bot uses end-to-end.tests/smoke/conftest.py— drop the localredis_urlfixture; the shared session-scoped one now resolves automatically. Therequire_live_services/qdrant_service/cache_service/voyage_servicefixtures continue to work; they consumedredis_urlviarequest.getfixturevalue(), which keeps working.Contract test
tests/contract/test_smoke_fixtures_dedup_contract.pywith three invariants:qdrant_collectiondefault == production contract value;tests/smoke/conftest.pydoes not redefine any shared fixture.Verification
Closes #2066.