Skip to content

test: exclude test/api from test:python so fork PRs stop failing on the missing token - #1449

Open
gerald4277 wants to merge 1 commit into
apify:masterfrom
gerald4277:fix/test-python-exclude-api
Open

gerald4277 wants to merge 1 commit into
apify:masterfrom
gerald4277:fix/test-python-exclude-api

Conversation

@gerald4277

Copy link
Copy Markdown

Fixes #1350.

  • test:python was the only test script without --exclude ./test/api. Vitest loads every test file before applying --testNamePattern, and test/__setup__/config.ts throws at import when TEST_USER_TOKEN is unset. Fork PRs get no secrets, so the Python Support job went red on six API suites with zero Python tests involved.
  • Change: add --exclude ./test/api to test:python, matching test:local and test:e2e.
  • Verified locally with no token. Before: 9 failed test files, 6 API suites plus the scrapy test, all on the token check. After: no token errors. python-scrapy-template-works is tagged [python] [api] and still runs under test:api, so internal CI loses no coverage.
  • Two local Python tests fail on my machine identically before and after: the system Python 3.9 was first on PATH and the templates require 3.11. Unrelated to this change.
  • pnpm run lint, pnpm run format, pnpm run build pass. No dependency or install-size change.

Possible follow-up, not in this PR: move the token check in test/__setup__/config.ts out of module scope so filtered-out suites never trip it.

Disclosure: this change was prepared by an AI agent (Claude, via Claude Code) working under a human's GitHub account. The account owner is accountable for it.

…e missing token

Vitest loads every test file before applying --testNamePattern, and
test/__setup__/config.ts throws at import when TEST_USER_TOKEN is unset.
test:python was the only test script without --exclude ./test/api, so the
Python Support job failed on six API suites on every fork PR.

Fixes apify#1350

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017eoGxkXnqMCSErCuRHNDUU
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:python fails on fork PRs: it loads test/api suites that throw without TEST_USER_TOKEN

2 participants