fix(ci): prevent pytest-playwright import crash in unit tests#212
Merged
fix(ci): prevent pytest-playwright import crash in unit tests#212
Conversation
The pytest-playwright plugin auto-loads at startup and imports playwright.sync_api, which fails when the sync_api module isn't available. Add `-p no:playwright` to the non-playwright test run. Also rename the E2E workflow environment from "pypi" to "testing" to stop generating misleading "deploying to pypi" notifications on PRs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The Makefile contains the pytest commands, so changes to it should trigger both the unit test and E2E test workflows. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The E2E make target wasn't changed, so there's no need to trigger the E2E workflow on Makefile changes. This avoids unnecessary flaky E2E runs on CI-only PRs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The OPENAI_API_KEY secret is configured in the "pypi" environment. Changing it to "testing" broke all LLM-dependent E2E tests because the secret wasn't available in the new environment. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The E2E tests require OPENAI_API_KEY from the pypi environment, which GitHub does not provide to pull_request-triggered workflows. This caused every LLM-dependent test to silently fail (60s timeout per test × 3 attempts), making the job hit its 30-minute timeout. E2E tests still run on push to main/rc-* and via workflow_dispatch. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
OPENAI_API_KEY is now a repository-level secret (not just an environment secret), so it's available to pull_request-triggered workflows. Remove the pypi environment requirement and restore the pull_request trigger. Co-Authored-By: Claude Opus 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.
Summary
-p no:playwrightto thepy-check-testsMake target so pytest doesn't auto-load thepytest-playwrightplugin (which crashes importingplaywright.sync_api) when running unit testsMakefileto thepy-test.ymlworkflow path triggers so Makefile changes trigger CIpull_requesttrigger on E2E workflow — theOPENAI_API_KEYfrom thepypienvironment is not available to PR-triggered runs, causing every LLM-dependent test to silently timeout. E2E tests still run on push to main/rc-* and viaworkflow_dispatch.Test plan
Test - PythonCI workflow passes across all Python versions (3.10-3.14)ModuleNotFoundError: No module named 'playwright.sync_api'workflow_dispatch(verified manually)🤖 Generated with Claude Code