apify-test-tools 0.10.2-beta.2 → 0.10.2-beta.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitattributes +1 -0
- package/.github/actionlint.yaml +11 -0
- package/.github/actions/checkout-restore-dependencies/action.yaml +58 -6
- package/.github/cli/apify-test-tools.mjs +135 -142
- package/.github/scripts/mask-config-secrets.sh +17 -0
- package/.github/scripts/run-with-apify-tokens.mjs +63 -103
- package/.github/workflows/_check_code.yaml +5 -21
- package/.github/workflows/_move_major_tag.yaml +2 -2
- package/.github/workflows/public_platform-tests-claude-investigate-and-fix.yaml +89 -8
- package/.github/workflows/public_platform-tests.yaml +68 -30
- package/.github/workflows/public_pr-build-test.yaml +77 -38
- package/.github/workflows/public_push-build-latest.yaml +49 -11
- package/.github/workflows/public_review.yaml +5 -4
- package/.github/workflows/public_stale-issues.yaml +51 -0
- package/.husky/pre-commit +4 -4
- package/.prettierignore +2 -1
- package/CHANGELOG.md +22 -0
- package/CONTRIBUTING.md +117 -17
- package/README.md +221 -595
- package/bin/actor-ids.ts +41 -0
- package/bin/affected-actors.ts +211 -0
- package/bin/build-from-local.ts +19 -1
- package/bin/build.ts +105 -39
- package/bin/diff-changes.ts +69 -36
- package/bin/diff-json-schema.ts +5 -6
- package/bin/git.ts +73 -175
- package/bin/main.ts +142 -189
- package/bin/notify.ts +198 -0
- package/bin/run-tests.ts +167 -0
- package/bin/slack.ts +16 -76
- package/bin/stdin-input.ts +156 -0
- package/bin/test-files-glob.ts +126 -0
- package/bin/test-report.ts +141 -140
- package/bin/types.ts +4 -7
- package/bin/utils/config/load-config.ts +20 -2
- package/bin/utils/config/parser.ts +40 -8
- package/bin/utils/config/structures/grouped.ts +2 -2
- package/bin/utils/config/structures/legacy.ts +1 -1
- package/dist/bin/actor-ids.d.ts +15 -0
- package/dist/bin/actor-ids.d.ts.map +1 -0
- package/dist/bin/actor-ids.js +30 -0
- package/dist/bin/actor-ids.js.map +1 -0
- package/dist/bin/affected-actors.d.ts +55 -0
- package/dist/bin/affected-actors.d.ts.map +1 -0
- package/dist/bin/affected-actors.js +142 -0
- package/dist/bin/affected-actors.js.map +1 -0
- package/dist/bin/build-from-local.d.ts +2 -1
- package/dist/bin/build-from-local.d.ts.map +1 -1
- package/dist/bin/build-from-local.js +6 -2
- package/dist/bin/build-from-local.js.map +1 -1
- package/dist/bin/build.d.ts +18 -5
- package/dist/bin/build.d.ts.map +1 -1
- package/dist/bin/build.js +74 -24
- package/dist/bin/build.js.map +1 -1
- package/dist/bin/diff-changes.d.ts +21 -5
- package/dist/bin/diff-changes.d.ts.map +1 -1
- package/dist/bin/diff-changes.js +41 -28
- package/dist/bin/diff-changes.js.map +1 -1
- package/dist/bin/diff-json-schema.d.ts +2 -2
- package/dist/bin/diff-json-schema.d.ts.map +1 -1
- package/dist/bin/diff-json-schema.js +1 -4
- package/dist/bin/diff-json-schema.js.map +1 -1
- package/dist/bin/git.d.ts +26 -34
- package/dist/bin/git.d.ts.map +1 -1
- package/dist/bin/git.js +60 -143
- package/dist/bin/git.js.map +1 -1
- package/dist/bin/main.js +126 -140
- package/dist/bin/main.js.map +1 -1
- package/dist/bin/notify.d.ts +35 -0
- package/dist/bin/notify.d.ts.map +1 -0
- package/dist/bin/notify.js +131 -0
- package/dist/bin/notify.js.map +1 -0
- package/dist/bin/run-tests.d.ts +21 -0
- package/dist/bin/run-tests.d.ts.map +1 -0
- package/dist/bin/run-tests.js +138 -0
- package/dist/bin/run-tests.js.map +1 -0
- package/dist/bin/slack.d.ts +2 -14
- package/dist/bin/slack.d.ts.map +1 -1
- package/dist/bin/slack.js +17 -46
- package/dist/bin/slack.js.map +1 -1
- package/dist/bin/stdin-input.d.ts +79 -0
- package/dist/bin/stdin-input.d.ts.map +1 -0
- package/dist/bin/stdin-input.js +124 -0
- package/dist/bin/stdin-input.js.map +1 -0
- package/dist/bin/test-files-glob.d.ts +18 -0
- package/dist/bin/test-files-glob.d.ts.map +1 -0
- package/dist/bin/test-files-glob.js +108 -0
- package/dist/bin/test-files-glob.js.map +1 -0
- package/dist/bin/test-report.d.ts +69 -8
- package/dist/bin/test-report.d.ts.map +1 -1
- package/dist/bin/test-report.js +76 -67
- package/dist/bin/test-report.js.map +1 -1
- package/dist/bin/types.d.ts +4 -7
- package/dist/bin/types.d.ts.map +1 -1
- package/dist/bin/utils/config/load-config.d.ts +8 -0
- package/dist/bin/utils/config/load-config.d.ts.map +1 -1
- package/dist/bin/utils/config/load-config.js +14 -1
- package/dist/bin/utils/config/load-config.js.map +1 -1
- package/dist/bin/utils/config/parser.d.ts +15 -2
- package/dist/bin/utils/config/parser.d.ts.map +1 -1
- package/dist/bin/utils/config/parser.js +29 -8
- package/dist/bin/utils/config/parser.js.map +1 -1
- package/dist/bin/utils/config/structures/grouped.js +2 -2
- package/dist/bin/utils/config/structures/grouped.js.map +1 -1
- package/dist/bin/utils/config/structures/legacy.js +1 -1
- package/dist/bin/utils/config/structures/legacy.js.map +1 -1
- package/dist/lib/extend-expect.d.ts.map +1 -1
- package/dist/lib/extend-expect.js +37 -218
- package/dist/lib/extend-expect.js.map +1 -1
- package/dist/lib/lib.d.ts +1 -5
- package/dist/lib/lib.d.ts.map +1 -1
- package/dist/lib/lib.js +19 -31
- package/dist/lib/lib.js.map +1 -1
- package/dist/lib/run-checks.d.ts +14 -0
- package/dist/lib/run-checks.d.ts.map +1 -0
- package/dist/lib/run-checks.js +82 -0
- package/dist/lib/run-checks.js.map +1 -0
- package/dist/lib/run-test-result.d.ts +3 -6
- package/dist/lib/run-test-result.d.ts.map +1 -1
- package/dist/lib/run-test-result.js +41 -54
- package/dist/lib/run-test-result.js.map +1 -1
- package/dist/test/bundle/cli-bundle.test.js +76 -56
- package/dist/test/bundle/cli-bundle.test.js.map +1 -1
- package/dist/test/bundle/token-wrapper.test.d.ts +2 -0
- package/dist/test/bundle/token-wrapper.test.d.ts.map +1 -0
- package/dist/test/bundle/token-wrapper.test.js +80 -0
- package/dist/test/bundle/token-wrapper.test.js.map +1 -0
- package/dist/test/e2e/cli-bundle.e2e.test.js +33 -68
- package/dist/test/e2e/cli-bundle.e2e.test.js.map +1 -1
- package/dist/test/e2e/git-build-release.e2e.test.d.ts +2 -0
- package/dist/test/e2e/git-build-release.e2e.test.d.ts.map +1 -0
- package/dist/test/e2e/git-build-release.e2e.test.js +87 -0
- package/dist/test/e2e/git-build-release.e2e.test.js.map +1 -0
- package/dist/test/e2e/helpers.d.ts +37 -0
- package/dist/test/e2e/helpers.d.ts.map +1 -0
- package/dist/test/e2e/helpers.js +57 -0
- package/dist/test/e2e/helpers.js.map +1 -0
- package/dist/test/unit/bin/actor-filtering.test.js +7 -0
- package/dist/test/unit/bin/actor-filtering.test.js.map +1 -1
- package/dist/test/unit/bin/actor-ids.test.d.ts +2 -0
- package/dist/test/unit/bin/actor-ids.test.d.ts.map +1 -0
- package/dist/test/unit/bin/actor-ids.test.js +40 -0
- package/dist/test/unit/bin/actor-ids.test.js.map +1 -0
- package/dist/test/unit/bin/affected-actors-cli.test.d.ts +2 -0
- package/dist/test/unit/bin/affected-actors-cli.test.d.ts.map +1 -0
- package/dist/test/unit/bin/affected-actors-cli.test.js +224 -0
- package/dist/test/unit/bin/affected-actors-cli.test.js.map +1 -0
- package/dist/test/unit/bin/affected-actors.test.d.ts +2 -0
- package/dist/test/unit/bin/affected-actors.test.d.ts.map +1 -0
- package/dist/test/unit/bin/affected-actors.test.js +153 -0
- package/dist/test/unit/bin/affected-actors.test.js.map +1 -0
- package/dist/test/unit/bin/build-cli.test.d.ts +2 -0
- package/dist/test/unit/bin/build-cli.test.d.ts.map +1 -0
- package/dist/test/unit/bin/build-cli.test.js +49 -0
- package/dist/test/unit/bin/build-cli.test.js.map +1 -0
- package/dist/test/unit/bin/build-from-local.test.js +12 -0
- package/dist/test/unit/bin/build-from-local.test.js.map +1 -1
- package/dist/test/unit/bin/build.test.js +116 -6
- package/dist/test/unit/bin/build.test.js.map +1 -1
- package/dist/test/unit/bin/compiled-cli.d.ts +6 -0
- package/dist/test/unit/bin/compiled-cli.d.ts.map +1 -0
- package/dist/test/unit/bin/compiled-cli.js +23 -0
- package/dist/test/unit/bin/compiled-cli.js.map +1 -0
- package/dist/test/unit/bin/diff-changes.test.js +168 -114
- package/dist/test/unit/bin/diff-changes.test.js.map +1 -1
- package/dist/test/unit/bin/diff.test.js +25 -28
- package/dist/test/unit/bin/diff.test.js.map +1 -1
- package/dist/test/unit/bin/git.test.js +67 -288
- package/dist/test/unit/bin/git.test.js.map +1 -1
- package/dist/test/unit/bin/notify.test.d.ts +2 -0
- package/dist/test/unit/bin/notify.test.d.ts.map +1 -0
- package/dist/test/unit/bin/notify.test.js +222 -0
- package/dist/test/unit/bin/notify.test.js.map +1 -0
- package/dist/test/unit/bin/stdin-input.test.d.ts +2 -0
- package/dist/test/unit/bin/stdin-input.test.d.ts.map +1 -0
- package/dist/test/unit/bin/stdin-input.test.js +92 -0
- package/dist/test/unit/bin/stdin-input.test.js.map +1 -0
- package/dist/test/unit/bin/test-cli.test.d.ts +2 -0
- package/dist/test/unit/bin/test-cli.test.d.ts.map +1 -0
- package/dist/test/unit/bin/test-cli.test.js +146 -0
- package/dist/test/unit/bin/test-cli.test.js.map +1 -0
- package/dist/test/unit/bin/test-files-glob.test.d.ts +2 -0
- package/dist/test/unit/bin/test-files-glob.test.d.ts.map +1 -0
- package/dist/test/unit/bin/test-files-glob.test.js +102 -0
- package/dist/test/unit/bin/test-files-glob.test.js.map +1 -0
- package/dist/test/unit/bin/test-report.test.d.ts +2 -0
- package/dist/test/unit/bin/test-report.test.d.ts.map +1 -0
- package/dist/test/unit/bin/test-report.test.js +100 -0
- package/dist/test/unit/bin/test-report.test.js.map +1 -0
- package/dist/test/unit/bin/utils/config/load-config.test.js +19 -1
- package/dist/test/unit/bin/utils/config/load-config.test.js.map +1 -1
- package/dist/test/unit/bin/utils/config/parser.test.js +36 -4
- package/dist/test/unit/bin/utils/config/parser.test.js.map +1 -1
- package/dist/test/unit/bin/utils/config/structures/grouped.test.js +6 -0
- package/dist/test/unit/bin/utils/config/structures/grouped.test.js.map +1 -1
- package/dist/test/unit/bin/utils/config/structures/legacy.test.js +1 -0
- package/dist/test/unit/bin/utils/config/structures/legacy.test.js.map +1 -1
- package/dist/test/unit/github-scripts/mask-config-secrets.test.d.ts +2 -0
- package/dist/test/unit/github-scripts/mask-config-secrets.test.d.ts.map +1 -0
- package/dist/test/unit/github-scripts/mask-config-secrets.test.js +50 -0
- package/dist/test/unit/github-scripts/mask-config-secrets.test.js.map +1 -0
- package/dist/test/unit/github-scripts/run-with-apify-tokens.test.d.ts +2 -0
- package/dist/test/unit/github-scripts/run-with-apify-tokens.test.d.ts.map +1 -0
- package/dist/test/unit/github-scripts/run-with-apify-tokens.test.js +102 -0
- package/dist/test/unit/github-scripts/run-with-apify-tokens.test.js.map +1 -0
- package/dist/test/unit/run-checks.test.d.ts +2 -0
- package/dist/test/unit/run-checks.test.d.ts.map +1 -0
- package/dist/test/unit/run-checks.test.js +62 -0
- package/dist/test/unit/run-checks.test.js.map +1 -0
- package/dist/test/unit/run-test-result.test.d.ts +2 -0
- package/dist/test/unit/run-test-result.test.d.ts.map +1 -0
- package/dist/test/unit/run-test-result.test.js +34 -0
- package/dist/test/unit/run-test-result.test.js.map +1 -0
- package/dist/test/unit/should-built-and-test.test.js +41 -38
- package/dist/test/unit/should-built-and-test.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/workflow-scripts-src/run-with-apify-tokens.d.ts +3 -0
- package/dist/workflow-scripts-src/run-with-apify-tokens.d.ts.map +1 -0
- package/dist/workflow-scripts-src/run-with-apify-tokens.js +100 -0
- package/dist/workflow-scripts-src/run-with-apify-tokens.js.map +1 -0
- package/docs/cli.md +469 -0
- package/docs/lib.md +276 -0
- package/docs/workflows.md +455 -0
- package/eslint.config.mjs +10 -1
- package/lib/extend-expect.ts +48 -258
- package/lib/lib.ts +25 -34
- package/lib/run-checks.ts +101 -0
- package/lib/run-test-result.ts +45 -55
- package/package.json +4 -2
- package/platform-tests-investigate-and-fix/skills/assess-impact/SKILL.md +42 -0
- package/platform-tests-investigate-and-fix/skills/measure-flakiness/SKILL.md +4 -2
- package/test/bundle/cli-bundle.test.ts +97 -67
- package/test/bundle/token-wrapper.test.ts +110 -0
- package/test/e2e/cli-bundle.e2e.test.ts +60 -93
- package/test/e2e/git-build-release.e2e.test.ts +113 -0
- package/test/e2e/helpers.ts +82 -0
- package/test/unit/bin/actor-filtering.test.ts +8 -0
- package/test/unit/bin/actor-ids.test.ts +47 -0
- package/test/unit/bin/affected-actors-cli.test.ts +271 -0
- package/test/unit/bin/affected-actors.test.ts +221 -0
- package/test/unit/bin/build-cli.test.ts +61 -0
- package/test/unit/bin/build-from-local.test.ts +16 -0
- package/test/unit/bin/build.test.ts +149 -5
- package/test/unit/bin/compiled-cli.ts +23 -0
- package/test/unit/bin/diff-changes.test.ts +181 -114
- package/test/unit/bin/diff.test.ts +25 -28
- package/test/unit/bin/git.test.ts +76 -361
- package/test/unit/bin/notify.test.ts +299 -0
- package/test/unit/bin/stdin-input.test.ts +120 -0
- package/test/unit/bin/test-cli.test.ts +175 -0
- package/test/unit/bin/test-files-glob.test.ts +118 -0
- package/test/unit/bin/test-report.test.ts +118 -0
- package/test/unit/bin/utils/config/load-config.test.ts +26 -1
- package/test/unit/bin/utils/config/parser.test.ts +46 -5
- package/test/unit/bin/utils/config/structures/grouped.test.ts +12 -0
- package/test/unit/bin/utils/config/structures/legacy.test.ts +1 -0
- package/test/unit/github-scripts/mask-config-secrets.test.ts +61 -0
- package/test/unit/github-scripts/run-with-apify-tokens.test.ts +115 -0
- package/test/unit/run-checks.test.ts +76 -0
- package/test/unit/run-test-result.test.ts +44 -0
- package/test/unit/should-built-and-test.test.ts +46 -39
- package/tsconfig.json +1 -1
- package/vitest.config.ts +9 -0
- package/workflow-scripts-src/run-with-apify-tokens.ts +112 -0
- package/.github/scripts/check-major-tag-refs.mjs +0 -72
- package/dist/test/unit/bin/logging.test.d.ts +0 -2
- package/dist/test/unit/bin/logging.test.d.ts.map +0 -1
- package/dist/test/unit/bin/logging.test.js +0 -43
- package/dist/test/unit/bin/logging.test.js.map +0 -1
- package/dist/test/unit/bin/slack.test.d.ts +0 -2
- package/dist/test/unit/bin/slack.test.d.ts.map +0 -1
- package/dist/test/unit/bin/slack.test.js +0 -54
- package/dist/test/unit/bin/slack.test.js.map +0 -1
- package/test/unit/bin/logging.test.ts +0 -52
- package/test/unit/bin/slack.test.ts +0 -65
|
@@ -14,12 +14,12 @@ on:
|
|
|
14
14
|
description: Label added after a successful review and never removed. Set to an empty string to disable.
|
|
15
15
|
required: false
|
|
16
16
|
prompt-ref:
|
|
17
|
-
default:
|
|
17
|
+
default: ''
|
|
18
18
|
type: string
|
|
19
19
|
description: >-
|
|
20
20
|
Ref of this repository to fetch the review instructions from. Defaults to the
|
|
21
|
-
|
|
22
|
-
test a prompt change from a branch.
|
|
21
|
+
commit this workflow was called at, so the instructions always match it. Override
|
|
22
|
+
it only to test a prompt change from a branch.
|
|
23
23
|
required: false
|
|
24
24
|
model:
|
|
25
25
|
default: sonnet
|
|
@@ -55,10 +55,11 @@ jobs:
|
|
|
55
55
|
# head_ref must be used for pull_request but for push and schedule events we have to use ref to get the branch name
|
|
56
56
|
ref: ${{ github.head_ref || github.ref }}
|
|
57
57
|
|
|
58
|
+
# job.workflow_* is this reusable workflow's own repo and commit; the github context is the caller's.
|
|
58
59
|
- name: 'Fetch review instructions'
|
|
59
60
|
run: |
|
|
60
61
|
curl -sfL \
|
|
61
|
-
"https://raw.githubusercontent.com
|
|
62
|
+
"https://raw.githubusercontent.com/${{ job.workflow_repository }}/${{ inputs.prompt-ref || job.workflow_sha }}/.github/review-prompt.md" \
|
|
62
63
|
-o "${{ github.workspace }}/.claude-review-prompt.md"
|
|
63
64
|
|
|
64
65
|
- name: 'Review PR against guidelines'
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
name: Close stale issues
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_call:
|
|
5
|
+
inputs:
|
|
6
|
+
stale-months:
|
|
7
|
+
description: Months without activity before warning issue owners (one month = 30 days). Issues close 30 days after the warning.
|
|
8
|
+
type: number
|
|
9
|
+
default: 6
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
staleIssues:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
timeout-minutes: 30
|
|
15
|
+
permissions:
|
|
16
|
+
issues: write
|
|
17
|
+
concurrency:
|
|
18
|
+
group: stale-issues-${{ github.repository }}
|
|
19
|
+
cancel-in-progress: false
|
|
20
|
+
steps:
|
|
21
|
+
- name: Convert months to days
|
|
22
|
+
id: threshold
|
|
23
|
+
uses: actions/github-script@v9
|
|
24
|
+
env:
|
|
25
|
+
STALE_MONTHS: ${{ inputs.stale-months }}
|
|
26
|
+
with:
|
|
27
|
+
script: |
|
|
28
|
+
const months = Number(process.env.STALE_MONTHS);
|
|
29
|
+
if (!Number.isSafeInteger(months) || months < 1 || !Number.isSafeInteger(months * 30)) {
|
|
30
|
+
throw new Error('stale-months must be a positive whole number whose day count is a safe integer.');
|
|
31
|
+
}
|
|
32
|
+
if (months > 12) {
|
|
33
|
+
throw new Error('stale-months must be less than or equal to 12.');
|
|
34
|
+
}
|
|
35
|
+
return months * 30;
|
|
36
|
+
|
|
37
|
+
- name: Warn and close stale issues
|
|
38
|
+
uses: actions/stale@v11
|
|
39
|
+
with:
|
|
40
|
+
days-before-issue-stale: ${{ steps.threshold.outputs.result }}
|
|
41
|
+
days-before-issue-close: 30
|
|
42
|
+
days-before-pr-stale: ${{ steps.threshold.outputs.result }}
|
|
43
|
+
days-before-pr-close: 30
|
|
44
|
+
stale-issue-label: stale
|
|
45
|
+
stale-issue-message: >-
|
|
46
|
+
This issue has had no activity for ${{ inputs.stale-months }} month(s).
|
|
47
|
+
It will be closed as not planned in 30 days unless it is updated or commented on.
|
|
48
|
+
close-issue-message: Closed as not planned after 30 days without activity following the stale warning.
|
|
49
|
+
close-issue-reason: not_planned
|
|
50
|
+
remove-stale-when-updated: true
|
|
51
|
+
operations-per-run: 1000
|
package/.husky/pre-commit
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
echo "pre-commit: typechecking, linting, testing, checking code formatting, checking for unused exports & validating schemas"
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
# The workflows run the CLI from
|
|
5
|
-
#
|
|
4
|
+
# The workflows run the CLI and token wrapper from these bundles, so they ship with every commit
|
|
5
|
+
# that changes their sources or dependencies.
|
|
6
6
|
npm run -s bundle
|
|
7
|
-
git add .github/cli/apify-test-tools.mjs
|
|
7
|
+
git add .github/cli/apify-test-tools.mjs .github/scripts/run-with-apify-tokens.mjs
|
|
8
8
|
|
|
9
9
|
npm test
|
|
10
10
|
npm run format:check
|
|
@@ -15,4 +15,4 @@ npx lint-staged
|
|
|
15
15
|
# Activate once we resolv unused delete old builds
|
|
16
16
|
# npm run check-unused
|
|
17
17
|
|
|
18
|
-
echo "pre-commit: passed"
|
|
18
|
+
echo "pre-commit: passed"
|
package/.prettierignore
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
CHANGELOG.md
|
|
2
|
-
|
|
2
|
+
.cli-test-*
|
|
3
3
|
# Operating instructions read by Claude, not prose for humans. Prettier collapses the nested bullet
|
|
4
4
|
# list under "do not visit, fetch, infer, or evaluate the following external links" into one run-on
|
|
5
5
|
# line, which changes what the model is told. Keeping it byte-identical also makes re-syncing it
|
|
@@ -11,3 +11,4 @@ test/fixtures
|
|
|
11
11
|
|
|
12
12
|
# Generated by `npm run bundle`
|
|
13
13
|
.github/cli/
|
|
14
|
+
.github/scripts/run-with-apify-tokens.mjs
|
package/CHANGELOG.md
CHANGED
|
@@ -8,11 +8,33 @@ All notable changes to this project will be documented in this file.
|
|
|
8
8
|
### 🚀 Features
|
|
9
9
|
|
|
10
10
|
- **ci:** Ship the workflows' CLI as a bundle in the action instead of installing it ([#200](https://github.com/apify/apify-test-tools/pull/200)) ([a0ef975](https://github.com/apify/apify-test-tools/commit/a0ef9756123a30a8210590b080a2a289c6a9c17c)) by [@metalwarrior665](https://github.com/metalwarrior665)
|
|
11
|
+
- [**breaking**] Revamp get-affected-actors to be a core logic command ([#190](https://github.com/apify/apify-test-tools/pull/190)) ([ea5f244](https://github.com/apify/apify-test-tools/commit/ea5f244cfd42bf3fa9ffd38cd2ad499dde2e83f8)) by [@metalwarrior665](https://github.com/metalwarrior665)
|
|
12
|
+
- [**breaking**] Add logic-less build command and use command chaining in workflows ([#193](https://github.com/apify/apify-test-tools/pull/193)) ([e5b0b86](https://github.com/apify/apify-test-tools/commit/e5b0b86ee06fca51d4be0ddc81b0a4a469d31603)) by [@metalwarrior665](https://github.com/metalwarrior665)
|
|
13
|
+
- **get-affected-actors:** Three-dot diff, narrowed per Actor with --since ([#204](https://github.com/apify/apify-test-tools/pull/204)) ([fa9a0e7](https://github.com/apify/apify-test-tools/commit/fa9a0e7518764dd4722ec9ecbf67b2a26a5a062e)) by [@metalwarrior665](https://github.com/metalwarrior665)
|
|
14
|
+
- Add effort input to Claude investigate-and-fix workflow ([#221](https://github.com/apify/apify-test-tools/pull/221)) ([c2ac078](https://github.com/apify/apify-test-tools/commit/c2ac078aec9ef02337af0e5c06db1b947b6c969b)) by [@foxt451](https://github.com/foxt451)
|
|
15
|
+
- **ci:** Support pnpm ([#214](https://github.com/apify/apify-test-tools/pull/214)) ([ee7d734](https://github.com/apify/apify-test-tools/commit/ee7d7340564c5b8657a8a1f0cf920d67b40ae013)) by [@ruocco-l](https://github.com/ruocco-l)
|
|
16
|
+
- Support flexible secret passing methods in workflows ([#225](https://github.com/apify/apify-test-tools/pull/225)) ([22f7e80](https://github.com/apify/apify-test-tools/commit/22f7e807ca3949656c15b79f848a192d71b15946)) by [@metalwarrior665](https://github.com/metalwarrior665), closes [#205](https://github.com/apify/apify-test-tools/issues/205)
|
|
17
|
+
- [**breaking**] Require env vars of test versions in sync with the default version ([#217](https://github.com/apify/apify-test-tools/pull/217)) ([a2481dd](https://github.com/apify/apify-test-tools/commit/a2481ddf09004308cb54e49b783c8b21a25dcbe4)) by [@metalwarrior665](https://github.com/metalwarrior665)
|
|
18
|
+
- Add impact & priority assessment to claude investigator ([#216](https://github.com/apify/apify-test-tools/pull/216)) ([fd16622](https://github.com/apify/apify-test-tools/commit/fd16622b910ec6e9b5515ea0bd26b0a41c22bd23)) by [@foxt451](https://github.com/foxt451), closes [#208](https://github.com/apify/apify-test-tools/issues/208)
|
|
19
|
+
- Stale issue/pr workflow ([#236](https://github.com/apify/apify-test-tools/pull/236)) ([aff1fa7](https://github.com/apify/apify-test-tools/commit/aff1fa778adb846a60fdacdd26aa13a71729613d)) by [@JuanGalilea](https://github.com/JuanGalilea), closes [#35](https://github.com/apify/apify-test-tools/issues/35)
|
|
20
|
+
- **workflows:** [**breaking**] Skip Slack when report-slack-channel is empty ([#238](https://github.com/apify/apify-test-tools/pull/238)) ([9a15b56](https://github.com/apify/apify-test-tools/commit/9a15b56de9ca42fb5ea753dc478116f9cd9c2c94)) by [@metalwarrior665](https://github.com/metalwarrior665)
|
|
21
|
+
- [**breaking**] Repo-root test-files-glob, platformTestsGlob in the config, and drop subtest ([#239](https://github.com/apify/apify-test-tools/pull/239)) ([640bc97](https://github.com/apify/apify-test-tools/commit/640bc97d9f16cfa07501bc4eae400cd2b1bd0c9c)) by [@metalwarrior665](https://github.com/metalwarrior665), closes [#192](https://github.com/apify/apify-test-tools/issues/192)
|
|
11
22
|
|
|
12
23
|
### 🐛 Bug Fixes
|
|
13
24
|
|
|
14
25
|
- **toBeObject:** Reject null ([#191](https://github.com/apify/apify-test-tools/pull/191)) ([6bdae49](https://github.com/apify/apify-test-tools/commit/6bdae4905756e0ae8dd6146942e6fc04dbead48e)) by [@JuanGalilea](https://github.com/JuanGalilea), closes [#88](https://github.com/apify/apify-test-tools/issues/88)
|
|
15
26
|
- Build and test on test-only changes even when .dockerignore lists the tests ([#177](https://github.com/apify/apify-test-tools/pull/177)) ([5cb1b5a](https://github.com/apify/apify-test-tools/commit/5cb1b5ab5f6f43ec279f9624b402e73d55a5974a)) by [@artogahr](https://github.com/artogahr), closes [#145](https://github.com/apify/apify-test-tools/issues/145)
|
|
27
|
+
- **git:** List both paths of moved files when detecting changes ([#215](https://github.com/apify/apify-test-tools/pull/215)) ([44ba565](https://github.com/apify/apify-test-tools/commit/44ba565242c1ac3daea281a648acb28712bb4363)) by [@metalwarrior665](https://github.com/metalwarrior665)
|
|
28
|
+
- **workflows:** Load setup action and review prompt from the called commit ([#226](https://github.com/apify/apify-test-tools/pull/226)) ([7524711](https://github.com/apify/apify-test-tools/commit/752471135d4d147f6f6492a26c08af388d7ccf72)) by [@metalwarrior665](https://github.com/metalwarrior665)
|
|
29
|
+
- **test:** Clean up compiled CLI dir when build fails ([#224](https://github.com/apify/apify-test-tools/pull/224)) ([f9f2f5c](https://github.com/apify/apify-test-tools/commit/f9f2f5c64cfe936ee0b72a0fbe7408282c68fbac)) by [@JuanGalilea](https://github.com/JuanGalilea)
|
|
30
|
+
- **cli-test:** Look up actor raw IDs for tests that reference them ([#234](https://github.com/apify/apify-test-tools/pull/234)) ([315baf4](https://github.com/apify/apify-test-tools/commit/315baf495dae984cbcd7056a101935536d7b0011)) by [@metalwarrior665](https://github.com/metalwarrior665)
|
|
31
|
+
- **cli-test:** Warn instead of failing on Actors the tester token can't see ([#237](https://github.com/apify/apify-test-tools/pull/237)) ([1d339ab](https://github.com/apify/apify-test-tools/commit/1d339ab04d3190191cffa3766e86a7c74c309985)) by [@metalwarrior665](https://github.com/metalwarrior665)
|
|
32
|
+
- **run-with-apify-token:** Support all config modes ([#219](https://github.com/apify/apify-test-tools/pull/219)) ([4b9e95b](https://github.com/apify/apify-test-tools/commit/4b9e95b8328144eb77805ddd7ae1176ee14b84dc)) by [@JuanGalilea](https://github.com/JuanGalilea)
|
|
33
|
+
|
|
34
|
+
### 🚜 Refactor
|
|
35
|
+
|
|
36
|
+
- [**breaking**] Remove build-for-test and release composite commands ([#203](https://github.com/apify/apify-test-tools/pull/203)) ([85efc54](https://github.com/apify/apify-test-tools/commit/85efc54697e98208c827c4f450906e00eebcd9ca)) by [@metalwarrior665](https://github.com/metalwarrior665)
|
|
37
|
+
- [**breaking**] Remove legacy get-commits, get-latest-commit and get-changed-files ([#228](https://github.com/apify/apify-test-tools/pull/228)) ([d254a6d](https://github.com/apify/apify-test-tools/commit/d254a6dd14ac9cb027a26ec73ca20a6ee10460ec)) by [@metalwarrior665](https://github.com/metalwarrior665)
|
|
16
38
|
|
|
17
39
|
|
|
18
40
|
<!-- git-cliff-unreleased-end -->
|
package/CONTRIBUTING.md
CHANGED
|
@@ -11,8 +11,10 @@ The package consists of three parts:
|
|
|
11
11
|
- `bin/build.ts` actor building
|
|
12
12
|
- `bin/git.ts` git wrappers for getting relevant git commits and changed files
|
|
13
13
|
- `bin/main.ts` entrypoing
|
|
14
|
-
- `bin/
|
|
15
|
-
- `bin/test-report.ts`
|
|
14
|
+
- `bin/run-tests.ts` running the repository's vitest for the `test` command
|
|
15
|
+
- `bin/test-report.ts` turning vitest's JSON report into the report `test` prints
|
|
16
|
+
- `bin/notify.ts` the `notify` command: what it says about test runs and releases, and its targets (Slack for now)
|
|
17
|
+
- `bin/slack.ts` the Slack client
|
|
16
18
|
|
|
17
19
|
CLI command results use `writeJson` from `bin/output.ts` to write newline-terminated JSON to stdout.
|
|
18
20
|
Use the CLI `logger` from `bin/logger.ts` for diagnostics; every level writes to stderr.
|
|
@@ -53,9 +55,11 @@ To work on the library, run the cli from the root of your testing repo:
|
|
|
53
55
|
```sh
|
|
54
56
|
cd /path/to/testing-repo-for-github-actions
|
|
55
57
|
npx tsx /path/to/apify-test-tools/bin/main.ts --help
|
|
56
|
-
npx tsx /path/to/apify-test-tools/bin/main.ts get-
|
|
58
|
+
npx tsx /path/to/apify-test-tools/bin/main.ts get-affected-actors --base master
|
|
57
59
|
```
|
|
58
60
|
|
|
61
|
+
Or clone a test repo into `local-clone/` inside this repo and run `npm run start:dev -- <command>`.
|
|
62
|
+
|
|
59
63
|
#### Working on the library
|
|
60
64
|
|
|
61
65
|
You need to istall the local version of `apify-test-tools` in your cloned `testing-repo-for-github-actions`:
|
|
@@ -69,7 +73,7 @@ You need to run `npm run build` inside `apify-test-tools` repo everytime you wan
|
|
|
69
73
|
## Reusable workflows
|
|
70
74
|
|
|
71
75
|
The `public_`-prefixed workflows are the ones consumer repos call: `public_pr-build-test`,
|
|
72
|
-
`public_platform-tests`, `public_push-build-latest`, `public_claude`, `public_review` and
|
|
76
|
+
`public_platform-tests`, `public_push-build-latest`, `public_claude`, `public_review`, `public_stale-issues` and
|
|
73
77
|
`public_platform-tests-claude-investigate-and-fix`. They live here because they call this package's
|
|
74
78
|
CLI, so a change to both is one PR. GitHub only reads workflow files at the top level of
|
|
75
79
|
`.github/workflows`, so they sit next to this repo's own CI, and the prefix is what separates the
|
|
@@ -82,26 +86,122 @@ renaming one is a breaking change that needs a major tag bump, not a tidy-up.
|
|
|
82
86
|
The tag is not semver, so `git-cliff` would abort on it. It is skipped only because
|
|
83
87
|
`apify/actions`' cliff.toml sets `tag_pattern = "v[0-9]+\."` — a release failing with
|
|
84
88
|
`Semver error: unexpected character` means that pattern changed, not that anything here is wrong.
|
|
85
|
-
The action's "Nothing to release" guard resolves to this tag and
|
|
89
|
+
The action's "Nothing to release" guard resolves to this tag and never fires, so an empty stable
|
|
86
90
|
release fails at `npm publish` instead of erroring cleanly.
|
|
87
91
|
|
|
88
|
-
Consumers pin `@workflows-v0`, not `@master`. See
|
|
89
|
-
[Versioning and releases](./README.md#versioning-and-releases) in the README for how the tag and the
|
|
90
|
-
npm release relate — the short version:
|
|
92
|
+
Consumers pin `@workflows-v0`, not `@master`. See [Versioning and releases](#versioning-and-releases) below.
|
|
91
93
|
|
|
92
|
-
-
|
|
93
|
-
- the lib ships through a stable npm release
|
|
94
|
-
- the CLI runs from `.github/cli/apify-test-tools.mjs`, a bundle the pre-commit hook rebuilds with
|
|
95
|
-
`npm run bundle`. If you commit with `--no-verify`, run it yourself: the `CLI bundle` check fails
|
|
96
|
-
on a stale bundle, and a stale bundle would hold the tag.
|
|
97
|
-
- `npm test` covers the bundle without network (`test/bundle/`). `npm run test:e2e` runs it against two
|
|
94
|
+
- `npm test` covers the bundle without network (`test/bundle/`). `npm run test:e2e` runs it against
|
|
98
95
|
dummy Actors in an isolated sandbox account (`test/e2e/`) and skips itself unless
|
|
99
96
|
`E2E_TEST_APIFY_TOKEN_DBYPODOIHUZABNQTR` is set. CI passes that secret only to the `E2E tests` job.
|
|
97
|
+
The git `build` and release pipeline tests clone
|
|
98
|
+
[testing-repo-for-github-actions](https://github.com/apify-store/testing-repo-for-github-actions) and
|
|
99
|
+
use its `e2e/base` and `e2e/feature` branches as fixtures, so never rebase or delete those.
|
|
100
100
|
|
|
101
101
|
`npm run lint` and `actionlint` (via the `Code checks` workflow) both gate master, so run them before
|
|
102
102
|
pushing workflow changes.
|
|
103
103
|
|
|
104
|
+
The reusable workflows load the composite action with `uses: $/.github/actions/checkout-restore-dependencies`, never
|
|
105
|
+
`apify/apify-test-tools/...@workflows-v0`. `$/` is the
|
|
106
|
+
[self-repository syntax](https://github.blog/changelog/2026-07-30-reference-same-repository-actions-with-self-repository-syntax/):
|
|
107
|
+
it resolves to this repo at the commit the workflow was called at. A hardcoded tag would hand a caller pinned to an
|
|
108
|
+
older SHA, or to a branch, the action and CLI from the tag instead of from the commit they asked for.
|
|
109
|
+
|
|
104
110
|
`public_review` is the odd one out: it fetches `.github/review-prompt.md` over HTTP at run time, because a
|
|
105
|
-
reusable workflow runs with the caller's repo checked out and never gets its own.
|
|
106
|
-
|
|
107
|
-
|
|
111
|
+
reusable workflow runs with the caller's repo checked out and never gets its own. With `prompt-ref` left empty it
|
|
112
|
+
fetches from `job.workflow_repository` at `job.workflow_sha`, the commit the workflow itself came from, so the
|
|
113
|
+
instructions always match the workflow.
|
|
114
|
+
|
|
115
|
+
## Versioning and releases
|
|
116
|
+
|
|
117
|
+
The workflows and the npm package live in one repo but ship on their own schedules:
|
|
118
|
+
|
|
119
|
+
| What | Consumers get it through | Ships when |
|
|
120
|
+
| -------------------------------------------- | ------------------------------------------ | ----------------------- |
|
|
121
|
+
| the workflows and the CLI they call | the `@workflows-v0` tag in `uses:` | every master push |
|
|
122
|
+
| the lib (`testActor`, `describe`, matchers…) | `apify-test-tools` in their `package.json` | a stable release on npm |
|
|
123
|
+
|
|
124
|
+
The CLI is bundled with its dependencies into `.github/cli/apify-test-tools.mjs` (`npm run bundle`, run by the
|
|
125
|
+
pre-commit hook and checked in CI), and the setup action runs it from there. Nothing is installed for it, so a tag is
|
|
126
|
+
a complete statement: these workflows and this CLI, with the exact dependency versions from `package-lock.json` at
|
|
127
|
+
that commit. The consumer's own `node_modules` is left alone, so their tests keep the lib version they locked.
|
|
128
|
+
|
|
129
|
+
- **Workflow or CLI change** — merge it. `workflows-v0` moves once checks and tests pass, and it goes live. No
|
|
130
|
+
release needed, even when a workflow starts using a new CLI feature: both are in the same commit.
|
|
131
|
+
- **Lib change** — merge it, then cut a release when you want it out. Consumers pick it up when they update
|
|
132
|
+
`apify-test-tools`.
|
|
133
|
+
|
|
134
|
+
The CLI and the lib in one job can be different versions now, so the formats between them are a contract: the
|
|
135
|
+
`ACTOR_BUILDS` JSON that `build` writes and the lib reads, and the vitest JSON report (with the run each test started on its `meta`) that `test` reads. Add
|
|
136
|
+
fields freely; renaming or removing one needs a new major tag.
|
|
137
|
+
|
|
138
|
+
`workflows-v0` moving on every master push means `@workflows-v0` is as live as `@master` was — there's no staging
|
|
139
|
+
step. What the tag buys you is a `workflows-v1` for breaking workflow changes, so repos migrate one at a time instead
|
|
140
|
+
of all at once, and a way to roll back by pointing the tag at an earlier commit (**Move major version tag**
|
|
141
|
+
workflow). Bump `MAJOR_TAG` in `.github/workflows/_move_major_tag.yaml` to cut the next major; the old tag then
|
|
142
|
+
freezes where it is and keeps working, CLI included, since the bundle is part of the frozen commit.
|
|
143
|
+
|
|
144
|
+
The tag tracks the **workflows'** contract, not the npm package version. They move independently on purpose, so
|
|
145
|
+
`@workflows-v0` is expected to stay `@workflows-v0` after the package reaches 1.0 — bump it when a workflow breaks
|
|
146
|
+
its callers, not when the package does. The usage examples in the workflows, README and docs repeat the tag
|
|
147
|
+
literally, so update them by hand when you bump it.
|
|
148
|
+
|
|
149
|
+
## Testing workflow changes
|
|
150
|
+
|
|
151
|
+
- Point [testing-repo-for-github-actions](https://github.com/apify-store/testing-repo-for-github-actions) at your
|
|
152
|
+
branch (`uses: ...@your-branch`). It has real attached Actors and tests. The workflows load the composite action
|
|
153
|
+
with `$/` and the branch carries its own CLI bundle, so one branch tests the workflows, the action and the CLI
|
|
154
|
+
together, with nothing to repoint.
|
|
155
|
+
- Make sure the shell code actually works on your laptop first.
|
|
156
|
+
- After merging, watch the workflow on a real project before moving on.
|
|
157
|
+
|
|
158
|
+
## How the workflows scope secrets
|
|
159
|
+
|
|
160
|
+
The public side of this is the [Secrets](./docs/workflows.md#secrets) table.
|
|
161
|
+
|
|
162
|
+
The Actor tokens are the one set that cannot be listed in the workflow, because each Actor names its own token via
|
|
163
|
+
`tokenEnvVar` in `apify-test-tools.config.json`, and a reusable workflow only accepts secrets it declares by name.
|
|
164
|
+
Callers pack them into the `CONFIG_SECRETS` secret. Those steps pass `${{ toJSON(secrets) }}` as `WORKFLOW_SECRETS`
|
|
165
|
+
and run the command through `.github/scripts/run-with-apify-tokens.mjs`, which reads that same config file to decide
|
|
166
|
+
which secrets to pass on. It looks each one up in `CONFIG_SECRETS` first, then among the secrets `secrets: inherit`
|
|
167
|
+
brought:
|
|
168
|
+
|
|
169
|
+
```yaml
|
|
170
|
+
- name: Build
|
|
171
|
+
shell: bash
|
|
172
|
+
env:
|
|
173
|
+
WORKFLOW_SECRETS: ${{ toJSON(secrets) }}
|
|
174
|
+
run: |
|
|
175
|
+
jq '{ actors: (.functionallyChangedActors + .testChangedActors) }' affected.json \
|
|
176
|
+
| node "${{ steps.setup.outputs.scripts-path }}/run-with-apify-tokens.mjs" \
|
|
177
|
+
apify-test-tools build --version-number 0.99
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
The wrapper passes only the tokens the config declares and drops `WORKFLOW_SECRETS`, so neither the CLI nor anything
|
|
181
|
+
under `node_modules` sees the blob. Nothing is written to `$GITHUB_ENV`, so the tokens stay inside that one command
|
|
182
|
+
rather than leaking into later steps. Reading the same file `apify-test-tools` reads means the two can't drift, and a
|
|
183
|
+
secret that merely looks like an Actor token is not passed just because of its name.
|
|
184
|
+
|
|
185
|
+
A token the config declares but the repo hasn't set is a warning, not a failure: a repo can carry an Actor whose
|
|
186
|
+
token isn't configured and still build fine as long as that Actor never changes, and `apify-test-tools` raises a
|
|
187
|
+
precise error naming the Actor at the point it actually needs the token.
|
|
188
|
+
|
|
189
|
+
The runner masks a secret by its exact value, so it only knows `CONFIG_SECRETS` as a whole blob. The setup action
|
|
190
|
+
runs `.github/scripts/mask-config-secrets.sh` first, which registers each value inside it with `::add-mask::`, so a
|
|
191
|
+
token taken out of the blob is masked too.
|
|
192
|
+
|
|
193
|
+
`scripts-path` comes from the setup action (give the step `id: setup`) and points at this repo's `.github/scripts/`
|
|
194
|
+
directory inside the runner's action checkout, so workflows can run these helpers without checking this repo out
|
|
195
|
+
again. The caller's workspace holds the caller's repo, not this one.
|
|
196
|
+
|
|
197
|
+
Two tidier-looking alternatives don't work, so don't reach for them:
|
|
198
|
+
|
|
199
|
+
- **Exporting to `$GITHUB_ENV`** would let the steps call the CLI directly with no wrapper, but `$GITHUB_ENV`
|
|
200
|
+
applies to every later step in the job. In `pr-build-test` the test step runs after the build, so it would
|
|
201
|
+
inherit Actor tokens it has no use for.
|
|
202
|
+
- **Returning the tokens as a step output** would be scoped correctly, but the runner refuses to set an output whose
|
|
203
|
+
value contains a registered secret. It logs `Skip output <name> since it may contain secret` and leaves the output
|
|
204
|
+
empty, so anything reading it downstream gets nothing.
|
|
205
|
+
|
|
206
|
+
The `unitTest` job runs static checks and needs `NPM_TOKEN` only. No job runs `npm ci` or `pnpm install` with Apify
|
|
207
|
+
or Slack credentials in scope, so a postinstall script in the dependency tree cannot read them.
|