Skip to content

test: dedup smoke fixtures + register shared config plugin (#2066)#2080

Open
yastman wants to merge 1 commit into
devfrom
refactor/2066-smoke-fixtures
Open

test: dedup smoke fixtures + register shared config plugin (#2066)#2080
yastman wants to merge 1 commit into
devfrom
refactor/2066-smoke-fixtures

Conversation

@yastman
Copy link
Copy Markdown
Owner

@yastman yastman commented May 22, 2026

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:

  • 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.

Contract test

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
  73 tests collected (no fixture-resolution errors)

Closes #2066.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: FIXTURE-DEDUP unify Redis and Qdrant smoke fixtures (#1515)

2 participants