AI-2841: print integtest project info before tests start#441
Open
vita-stejskal wants to merge 1 commit intomainfrom
Open
AI-2841: print integtest project info before tests start#441vita-stejskal wants to merge 1 commit intomainfrom
vita-stejskal wants to merge 1 commit intomainfrom
Conversation
Acquires the project lock eagerly in pytest_collection_finish (fires after collection, before any test runs) so the project/token summary line appears before test progress output, avoiding ANSI overwrite in compact mode. - Extract _setup_pool() helper shared by hook and fixture fallback - Add pytest_collection_finish hook that acquires, prints, and sets state - Simplify project_lock fixture to reuse already-acquired lock when available - Keep pytest_terminal_summary as fallback for cases where hook is skipped - Add ProjectEndpoint.describe() so the summary string is defined once - Add token_id and token_description fields to ProjectEndpoint Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Description
Linear: AI-2841
Change Type
Summary
When running integration tests, the project/token summary (which project is
locked, which token is used) was invisible in compact pytest output because
it was written during session fixture setup — at which point pytest's ANSI
compact-mode progress display overwrites the line.
Fix: acquire the project lock eagerly in the
pytest_collection_finishhook,which fires after collection but before any test runs. At that point the
terminal is stable and
write_sep/write_lineproduce permanently visibleoutput. The
project_lockfixture falls back to lazy acquisition if the hookdidn't run (e.g. missing env vars), and
pytest_terminal_summarycovers thatfallback path so the info always appears somewhere.
Also extracted
ProjectEndpoint.describe()so the human-readable summarystring is defined in one place, and pulled pool setup into
_setup_pool()so it can be shared between the hook and the fixture fallback.
Testing
Streamable-HTTPtransports)Checklist