Conversation
Replace cucumber's subprocess approach with a simpler runCli() helper that spawns the real built CLI binary. Auto-detects environment via is-ci: uses dist mode locally, npx mode in CI. - Add runCli() helper (test/e2e/__helpers__/run-cli.ts) - Add 6 help command e2e tests (test/e2e/help.test.ts) - Add test:e2e and test:e2e:local scripts - Exclude test/e2e from test:local
Migrate invalid-config and actor-run-input cucumber features to Vitest. Refactor runCli() to accept array args instead of string command parsing. - Add test-actor helper (create, cleanup, corrupt, read results) - Add basic-actor.js fixture - Add invalid-config.test.ts (1 test) - Add actor-run-input.test.ts (7 tests) - Refactor runCli(binary, args) array API — no shell quoting issues
When an exit code assertion fails, the error message now includes stderr output for easier debugging. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Migrate builds-namespace cucumber feature to Vitest. Tests auth via CLI subprocess, push to platform, and exercise builds create/info/ls. - Add builds.test.ts (8 tests, requires TEST_USER_TOKEN) - Use getApifyClientOptions for correct client config - Share build ID via beforeAll in builds info describe block
New workflow runs e2e tests after every beta publish (workflow_run), daily at 06:00 UTC (schedule), and on manual dispatch with optional version override. Temporary pull_request trigger for validation. - Auto-detects CI → npx apify-cli@beta mode - Manual dispatch supports global mode with specific versions - Repo guard prevents fork execution - Command injection protection via env var indirection - 30min timeout, concurrency control - Fix || vs ?? for empty APIFY_CLI_E2E_MODE handling Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
All 22 cucumber scenarios have been migrated to Vitest e2e tests. - Delete /features/ directory (4 feature files, 6 implementation files) - Delete cucumber.json - Delete .github/workflows/cucumber.yaml - Remove @cucumber/cucumber from devDependencies - Remove test:cucumber script - Remove features from lint paths - Update stale cucumber reference in call.test.ts
On a fresh clone, test/tmp is gitignored and doesn't exist, causing e2e tests to fail with ENOENT when execa tries to use it as cwd. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
| "test:local": "vitest run --testNamePattern '^((?!\\[api]).)*$' --exclude ./test/api", | ||
| "test:local": "vitest run --testNamePattern '^((?!\\[api]).)*$' --exclude ./test/api --exclude ./test/e2e", | ||
| "test:e2e": "vitest run ./test/e2e", | ||
| "test:e2e:local": "vitest run ./test/e2e --exclude '**/builds*'", |
There was a problem hiding this comment.
Lets use the same prefix matcher as current tests please
There was a problem hiding this comment.
you mean use [e2e] in --testNamePattern yop ?
| - name: Install dependencies | ||
| run: yarn | ||
|
|
||
| - name: Install specific CLI version |
There was a problem hiding this comment.
So we are not testing bundles too? Only npm publishes?
You can technically install bundles with your version then rename the binaries so you can test them alongside npm
There was a problem hiding this comment.
good point, lets do separate issue to address bundles to not overcomplicate this PR
B4nan
left a comment
There was a problem hiding this comment.
As we briefly discussed this yesterday, I'd like to run this by default on a fresh build of the CLI instead of using the published beta version, so we can actually test the code from GH. Otherwise no strong opinions, we gotta start somewhere.
|
@B4nan @vladfrangu addressed, should I remove e2e step from PR pipeline before merge or we will wait until it gets too heavy to have it here? |
|
If it can run in a few minutes (or should I say, if its not the slowest job), I'd vote to keep it there. |
…r-apify-cli' into 1065-add-end-to-end-e2e-tests-for-apify-cli
Commands tested:
closes #1065