Skip to content

[FIX] Reuse shared initialization in AI recruiter integration test - #2954

Merged
Nina Chikanov (nina-msft) merged 6 commits into
microsoft:mainfrom
nina-msft:nina-msft-azure-sql-integration-fix
Oct 3, 2026
Merged

Nina Chikanov (nina-msft) merged 6 commits into
microsoft:mainfrom
nina-msft:nina-msft-azure-sql-integration-fix

Conversation

@nina-msft

@nina-msft Nina Chikanov (nina-msft) commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Description

AI recruiter integration tests fail during collection because their module requests persistent SQLite after the shared integration conftest.py has initialized in-memory SQLite. Remove the redundant module-level initialization and its unused imports so the test uses the shared setup.

Why this started failing

The change that exposed this failure merged on September 30, 2026, at 6:57 PM Pacific, in #2832 ("Moving Memory Functions to Async").

The conflicting initialization calls were already present. Previously, SQLite's singleton silently reused the existing in-memory database despite the recruiter test requesting persistent SQLite. The new validation explicitly rejects that mismatch.

This is an older test-setup inconsistency exposed by that change, not a new environment-file conflict. The first pipeline run that encountered it has not been confirmed. No pipeline, environment-file, secret, or production initialization changes are needed.

Database setup after this fix

The test continues to use in-memory SQLite, initialized by tests/integration/conftest.py before pytest imports the recruiter test:

await initialize_pyrit_async(memory_db_type=IN_MEMORY)

That creates and initializes SQLiteMemory(db_path=":memory:"), then registers it with CentralMemory. The recruiter test's PyRIT targets, scorers, and workflow use that shared instance.

This removes only the second, conflicting initialization, not database setup altogether. PyRIT's database contents are temporary for that pytest process, not saved to persistent SQLite or Azure SQL. The recruiter application's own Docker-side storage is unaffected.

No breaking changes.

Tests and Documentation

  • .venv\Scripts\python.exe -m pytest tests\integration\ai_recruiter --collect-only --doctest-modules -q --tb=short: reproduced the exact SQLite-switch error before the fix; passed with 1 test collected after the fix. The existing unregistered integration marker warning remains.
  • .venv\Scripts\python.exe -m ruff check --fix tests\integration\ai_recruiter\test_ai_recruiter.py: passed, correcting one blank line after the removal.
  • .venv\Scripts\python.exe -m ruff format --check tests\integration\ai_recruiter\test_ai_recruiter.py: passed.
  • git diff --check: passed.
  • Full Docker-backed recruiter execution was not run. Collection validation does not clone or launch the recruiter service.

N/A: no documentation or notebook changes.

Filter incompatible seed groups before sampling while preserving the default technique set and selected objective text. Keep notebook sources synchronized and cover control characters, Unicode, and mixed groups.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7d65728c-a1fd-4ace-8f7e-a337353ff787
Rely on the existing notebook integration test, as requested in review.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7d65728c-a1fd-4ace-8f7e-a337353ff787
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7d65728c-a1fd-4ace-8f7e-a337353ff787
Remove the import-time persistent SQLite initialization that conflicts with the in-memory database established by integration conftest.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7d65728c-a1fd-4ace-8f7e-a337353ff787
@nina-msft
Nina Chikanov (nina-msft) marked this pull request as ready for review October 2, 2026 20:16
@nina-msft Nina Chikanov (nina-msft) changed the title [DRAFT] FIX: Reuse shared initialization in AI recruiter integration test [FIX] Reuse shared initialization in AI recruiter integration test Oct 2, 2026
@nina-msft
Nina Chikanov (nina-msft) added this pull request to the merge queue Oct 2, 2026
Merged via the queue into microsoft:main with commit 0888352 Oct 3, 2026
62 of 71 checks passed
@nina-msft
Nina Chikanov (nina-msft) deleted the nina-msft-azure-sql-integration-fix branch October 3, 2026 00:13
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.

2 participants