Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
5d42b7f
feat(cli-test)!: require apify-test-tools 1.0.0 and drop the old-lib …
claude Nov 12, 2026
7d938fb
feat(lib)!: export the lib through an exports map from index.ts
claude Nov 12, 2026
a134ff6
fix(cli): name the CLI apify-test-tools in its help instead of public…
claude Nov 12, 2026
ec9a1cd
ci!: move the workflows to the workflows-v1 tag
claude Nov 12, 2026
1d99d13
feat(config)!: remove the legacy config mode and require mode
claude Nov 12, 2026
b84b9f3
feat!: tests name their Actor by full name only
claude Nov 12, 2026
49cb865
feat(lib)!: require vitest 5
claude Nov 12, 2026
f472dcd
docs: describe only the v1 behaviour
claude Nov 12, 2026
2a1210d
Merge master into the v1 transition
claude Nov 16, 2026
8d1f1e4
feat!: run each Actor's tests only with its own test token
claude Nov 16, 2026
3d6c6be
Merge master into the v1 transition
claude Nov 16, 2026
15800c4
feat(lib)!: rework the toFinishWith defaults and checks
claude Nov 16, 2026
ba1211c
docs: add a guide for migrating a repository to v1
claude Nov 17, 2026
6d22a95
docs(migration): show the migration with secrets: inherit
claude Nov 17, 2026
230fabb
docs(migration): explain which account runs the tests
claude Nov 17, 2026
7a32dae
Merge master into the v1 transition
claude Nov 26, 2026
421c4c4
Merge master into the v1 transition
claude Nov 26, 2026
671390c
refactor(cli): drop the 7-day limit for devel builds in delete-old-bu…
claude Nov 26, 2026
c3e4b49
feat(config)!: rename tokenEnvVar to buildTokenEnvVar
claude Nov 26, 2026
a58dde9
feat(config)!: require testTokenEnvVar on every group
claude Nov 26, 2026
93e93e8
feat(workflows)!: read the Apify tokens only from CONFIG_SECRETS
claude Nov 26, 2026
31e6ad7
docs: state that server interface tests need a full-permission test t…
claude Nov 26, 2026
ec39f57
feat(lib): read every crawler's statistics by default in toFinishWith
claude Nov 26, 2026
ca19cd8
Merge branch 'master' into ccr-86660633-vf05vg
metalwarrior665 Nov 26, 2026
b45ca06
feat(cli)!: reject unknown flags and arguments
claude Nov 26, 2026
aefb976
feat(cli)!: name the Actor of a test run actorFullName in the test re…
claude Nov 26, 2026
e78c667
feat(lib)!: read every crawler's statistics in getStatistics, as toFi…
claude Nov 26, 2026
78ca372
feat(lib)!: rename callServerInterface to sendRequestToServer and tak…
claude Nov 26, 2026
ef80f30
Merge remote-tracking branch 'origin/ccr-86660633-vf05vg' into ccr-86…
claude Nov 26, 2026
d48a7b2
feat(lib)!: replace sendRequestToServer with fetchServer, a fetch for…
claude Nov 26, 2026
0b5a70f
feat(lib): let fetchServer's init override X-Actor-Build, like Author…
claude Nov 26, 2026
b5484f5
docs: make the README and docs accurate for v1 and simpler (#264)
metalwarrior665 Nov 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
232 changes: 116 additions & 116 deletions .github/cli/apify-test-tools.mjs

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions .github/scripts/run-with-apify-tokens.mjs

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions .github/workflows/_move_major_tag.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Move major version tag

# Consumer repos track a floating major tag (`...@workflows-v0`), not `master`. This workflow is what
# Consumer repos track a floating major tag (`...@workflows-v1`), not `master`. This workflow is what
# ships: it moves that tag forward. The workflows and the CLI they call (bundled in .github/cli/)
# live in the same commit, so whatever the tag points at is consistent on its own.

Expand All @@ -27,24 +27,24 @@ jobs:
contents: write
env:
# The major version consumers pin, e.g.
# `uses: apify/apify-test-tools/.github/workflows/public_pr-build-test.yaml@workflows-v0`.
# `uses: apify/apify-test-tools/.github/workflows/public_pr-build-test.yaml@workflows-v1`.
# Bump this only for a breaking change to a workflow's inputs, secrets or behaviour.
# The previous tag then stops moving and keeps working, so repos migrate when they get
# to it instead of all at once.
#
# This tracks the workflows' own contract, not the npm package version — the two move
# independently by design, so this is expected to outlive the package reaching 1.0.
# independently by design.
#
# Deliberately not a bare `v0`. The package releases as `v0.9.0`, `v0.8.6` and so on, and
# Deliberately not a bare `v1`. The package releases as `v1.0.0`, `v1.2.3` and so on, and
# a bare major tag sits in that same namespace: git-cliff hard-errors on it
# ("unexpected character 'v' while parsing major version number") and only skips it
# because apify/actions ships `tag_pattern = "v[0-9]+\\."`, whose trailing dot excludes
# it. Depending on a regex in another repo to keep releases working is not a dependency
# worth having, and `v1` beside a package `v1.0.0` would be worse still.
# worth having, and a `v1` tag beside a package release `v1.0.0` would be confusing too.
#
# The workflows load this repo with `$/`, so they never name the tag. Only the usage
# examples in the workflows, README and docs do: update them by hand when bumping it.
MAJOR_TAG: workflows-v0
MAJOR_TAG: workflows-v1
steps:
- name: Checkout repository
uses: actions/checkout@v6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ name: 'Platform tests: Claude failure investigation and fix'
#
# jobs:
# platformTestsCore:
# uses: apify/apify-test-tools/.github/workflows/public_platform-tests.yaml@workflows-v0
# uses: apify/apify-test-tools/.github/workflows/public_platform-tests.yaml@workflows-v1
# with:
# test-files-glob: 'test/platform/hourly/**'
# report-slack-channel: '#notif-my-repo'
Expand All @@ -37,7 +37,7 @@ name: 'Platform tests: Claude failure investigation and fix'
# handle-failure:
# needs: platformTestsCore
# if: ${{ failure() }}
# uses: apify/apify-test-tools/.github/workflows/public_platform-tests-claude-investigate-and-fix.yaml@workflows-v0
# uses: apify/apify-test-tools/.github/workflows/public_platform-tests-claude-investigate-and-fix.yaml@workflows-v1
# secrets:
# ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
# # The token the tests ran the Actors with, so Claude can read the failing run
Expand Down Expand Up @@ -119,7 +119,7 @@ on:
Apify token for investigating the failing run — reading it, its log and its storages — and
re-running it to measure how often the failure happens. Runs are private to the account that
started them, so pass the token the tests ran the Actor with: its `testTokenEnvVar` from
apify-test-tools.config.json, which is its `tokenEnvVar` unless the config names another.
apify-test-tools.config.json.
NPM_TOKEN:
required: false
description: Read-only token for installing private npm packages before Claude runs.
Expand Down
19 changes: 5 additions & 14 deletions .github/workflows/public_platform-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ on:
default: ''
required: false
# Every secret is optional. The tests run each Actor with its `testTokenEnvVar` from
# apify-test-tools.config.json, which is its `tokenEnvVar` unless the config names another. Those names
# differ per repo, so the tokens come packed in CONFIG_SECRETS. Actors whose token isn't passed fall back to
# TESTER_APIFY_TOKEN. See the Secrets section of docs/workflows.md.
# apify-test-tools.config.json. Those names differ per repo, so the tokens come packed in CONFIG_SECRETS. See
# the Secrets section of docs/workflows.md.
secrets:
NPM_TOKEN:
required: false
Expand All @@ -25,14 +24,8 @@ on:
required: false
description: >-
JSON object of the secrets apify-test-tools.config.json names, secret name -> value. Here
that is each Actor's `testTokenEnvVar`, its `tokenEnvVar` by default. Passing
that is each Actor's `testTokenEnvVar`. Passing
`toJSON(secrets)` works too, only the names the config declares are used.
TESTER_APIFY_TOKEN:
required: false
description: >-
Fallback token for the platform tests: used for Actors whose own test token
(`testTokenEnvVar`, by default `tokenEnvVar`) isn't passed, and for every Actor by a repo
on an apify-test-tools lib older than per-Actor tokens.
SLACK_BOT_TOKEN:
required: false
description: Slack token for reporting test results.
Expand All @@ -53,18 +46,16 @@ jobs:
config-secrets: ${{ secrets.CONFIG_SECRETS }}

# Runs the repo's test code and its whole import graph, so it gets only the tokens the tests run the
# Actors with, see run-with-apify-tokens.mjs, and TESTER_APIFY_TOKEN, which the tests fall back to when an
# Actor's own token isn't passed.
# Actors with, see run-with-apify-tokens.mjs.
# Fails on failing tests, but writes the report anyway for the notification below.
# Every Actor in the config, on its default build: the one users run
- name: Test
id: test
# bash rather than the default shell, for pipefail
shell: bash
env:
WORKFLOW_SECRETS: ${{ toJSON(secrets) }}
CONFIG_SECRETS: ${{ secrets.CONFIG_SECRETS }}
SCRIPTS_PATH: ${{ steps.setup.outputs.scripts-path }}
TESTER_APIFY_TOKEN: ${{ secrets.TESTER_APIFY_TOKEN }}
# Passed through the environment and quoted, so the shell doesn't expand the glob itself
# An empty input, e.g. from an expression that picks the glob, runs everything, like the default
TEST_FILES_GLOB: ${{ inputs.test-files-glob || 'test/platform/**' }}
Expand Down
21 changes: 6 additions & 15 deletions .github/workflows/public_pr-build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,17 @@ on:
default: true
required: false
# Every secret is optional. The ones this workflow reads are declared by name. The secrets that
# apify-test-tools.config.json names (each Actor's `tokenEnvVar` and `testTokenEnvVar`) differ per repo,
# apify-test-tools.config.json names (each Actor's `buildTokenEnvVar` and `testTokenEnvVar`) differ per repo,
# so they come packed in CONFIG_SECRETS. See the Secrets section of docs/workflows.md.
secrets:
NPM_TOKEN:
required: false
description: Read-only token for installing private npm packages.
TESTER_APIFY_TOKEN:
required: false
description: >-
Fallback token for the platform tests: used for Actors whose own test token
(`testTokenEnvVar`, by default `tokenEnvVar`) isn't passed, and for every Actor by a repo
on an apify-test-tools lib older than per-Actor tokens.
CONFIG_SECRETS:
required: false
description: >-
JSON object of the secrets apify-test-tools.config.json names, secret name -> value.
That is each Actor's `tokenEnvVar` and `testTokenEnvVar`. Passing `toJSON(secrets)` works
That is each Actor's `buildTokenEnvVar` and `testTokenEnvVar`. Passing `toJSON(secrets)` works
too, only the names the config declares are used.

concurrency:
Expand Down Expand Up @@ -97,7 +91,7 @@ jobs:
# bash rather than the default shell, for pipefail
shell: bash
env:
WORKFLOW_SECRETS: ${{ toJSON(secrets) }}
CONFIG_SECRETS: ${{ secrets.CONFIG_SECRETS }}
SCRIPTS_PATH: ${{ steps.setup.outputs.scripts-path }}
REQUIRE_ENV_VARS_IN_SYNC: ${{ inputs.require-env-vars-in-sync }}
run: |
Expand All @@ -107,14 +101,11 @@ jobs:
--require-env-vars-in-sync="$REQUIRE_ENV_VARS_IN_SYNC" \
| tee builds.json

# Runs the repo's test code and its whole import graph, so it gets only the tokens the tests run the
# Actors with: each Actor's `testTokenEnvVar`, which is its `tokenEnvVar` unless the config names another,
# and TESTER_APIFY_TOKEN, which the tests fall back to when an Actor's own token isn't passed. A repo on
# a lib older than per-Actor tokens runs every test with TESTER_APIFY_TOKEN.
# Runs the repo's test code and its whole import graph, so it gets only the tokens the tests run the Actors
# with: each Actor's `testTokenEnvVar`.
- name: Test
env:
WORKFLOW_SECRETS: ${{ toJSON(secrets) }}
TESTER_APIFY_TOKEN: ${{ secrets.TESTER_APIFY_TOKEN }}
CONFIG_SECRETS: ${{ secrets.CONFIG_SECRETS }}
SCRIPTS_PATH: ${{ steps.setup.outputs.scripts-path }}
# Passed through the environment and quoted, so the shell doesn't expand the glob itself
# An empty input, e.g. from an expression that picks the glob, runs everything, like the default
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/public_push-build-latest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
default: ''
required: false
# Every secret is optional. The ones this workflow reads are declared by name. The secrets that
# apify-test-tools.config.json names (each Actor's `tokenEnvVar`) differ per repo, so they
# apify-test-tools.config.json names (each Actor's `buildTokenEnvVar`) differ per repo, so they
# come packed in CONFIG_SECRETS. See the Secrets section of docs/workflows.md.
secrets:
NPM_TOKEN:
Expand All @@ -22,7 +22,7 @@ on:
required: false
description: >-
JSON object of the secrets apify-test-tools.config.json names, secret name -> value.
Today that is each Actor's `tokenEnvVar`. Passing `toJSON(secrets)` works too, only
Today that is each Actor's `buildTokenEnvVar`. Passing `toJSON(secrets)` works too, only
the names the config declares are used.

jobs:
Expand Down Expand Up @@ -60,7 +60,7 @@ jobs:
# bash rather than the default shell, for pipefail
shell: bash
env:
WORKFLOW_SECRETS: ${{ toJSON(secrets) }}
CONFIG_SECRETS: ${{ secrets.CONFIG_SECRETS }}
run: |
jq '{ actors: (.functionallyChangedActors + .cosmeticallyChangedActors) }' affected.json \
| node "${{ steps.setup.outputs.scripts-path }}/run-with-apify-tokens.mjs" --tokens build \
Expand All @@ -78,7 +78,7 @@ jobs:

- name: Delete old builds
env:
WORKFLOW_SECRETS: ${{ toJSON(secrets) }}
CONFIG_SECRETS: ${{ secrets.CONFIG_SECRETS }}
run: |
node "${{ steps.setup.outputs.scripts-path }}/run-with-apify-tokens.mjs" --tokens build \
apify-test-tools delete-old-builds
Loading
Loading