apify-test-tools 0.10.2-beta.15 → 0.10.2-beta.17
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/.github/cli/apify-test-tools.mjs +25 -25
- package/.github/workflows/public_platform-tests-claude-investigate-and-fix.yaml +1 -0
- package/.github/workflows/public_platform-tests.yaml +6 -4
- package/.github/workflows/public_push-build-latest.yaml +4 -3
- package/CHANGELOG.md +2 -0
- package/bin/actor-ids.ts +11 -8
- package/bin/run-tests.ts +2 -1
- package/dist/bin/actor-ids.d.ts +5 -6
- package/dist/bin/actor-ids.d.ts.map +1 -1
- package/dist/bin/actor-ids.js +9 -3
- package/dist/bin/actor-ids.js.map +1 -1
- package/dist/bin/run-tests.d.ts.map +1 -1
- package/dist/bin/run-tests.js +1 -1
- package/dist/bin/run-tests.js.map +1 -1
- package/dist/test/unit/bin/actor-ids.test.js +11 -3
- package/dist/test/unit/bin/actor-ids.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/docs/cli.md +4 -3
- package/docs/workflows.md +10 -4
- package/package.json +1 -1
- package/test/unit/bin/actor-ids.test.ts +11 -7
package/docs/cli.md
CHANGED
|
@@ -296,9 +296,10 @@ The input is a JSON array of Actors, each given by its full name, its raw ID or
|
|
|
296
296
|
with it (`buildId` and `buildNumber`, as `build` and `build-from-local` print them), or against its default build
|
|
297
297
|
without one. Other fields are ignored, so the output of [`get-actor-configs`](#listing-actors-get-actor-configs) works
|
|
298
298
|
as it is. `test` looks up the ID an Actor is listed without with `TESTER_APIFY_TOKEN`, so its tests run whichever ID
|
|
299
|
-
they name it by.
|
|
300
|
-
|
|
301
|
-
|
|
299
|
+
they name it by. An Actor the token can't see keeps only the ID it was listed with, and a warning names it, so an
|
|
300
|
+
Actor no test uses doesn't stop the run. A dry-run plan, empty or invalid input is an error, as with `build`. So is a
|
|
301
|
+
missing `TESTER_APIFY_TOKEN`: without it the lib skips every platform test, and the run would pass having tested
|
|
302
|
+
nothing. `test` passes the Actors to vitest as `ACTOR_BUILDS`, in place of any
|
|
302
303
|
`ACTOR_BUILDS` in its own environment.
|
|
303
304
|
|
|
304
305
|
It runs vitest with `--maxConcurrency=20 --fileParallelism --maxWorkers=100`, since platform tests mostly wait on
|
package/docs/workflows.md
CHANGED
|
@@ -107,9 +107,9 @@ Releases the Actors a push changed. Skipped when the head commit message contain
|
|
|
107
107
|
4. `delete-old-builds` deletes old builds of every Actor in the config (see
|
|
108
108
|
[`delete-old-builds`](cli.md#deleting-old-builds-delete-old-builds)).
|
|
109
109
|
|
|
110
|
-
| Input | Type | Default | Description
|
|
111
|
-
| ---------------------- | ------ | ------- |
|
|
112
|
-
| `report-slack-channel` | string | `''` | Slack channel for the report. Empty
|
|
110
|
+
| Input | Type | Default | Description |
|
|
111
|
+
| ---------------------- | ------ | ------- | ----------------------------------------------- |
|
|
112
|
+
| `report-slack-channel` | string | `''` | Slack channel for the report. Empty skips Slack |
|
|
113
113
|
|
|
114
114
|
Secrets: `SLACK_BOT_TOKEN`, the Actor tokens in `CONFIG_SECRETS`, and optionally `NPM_TOKEN`.
|
|
115
115
|
|
|
@@ -126,6 +126,8 @@ on:
|
|
|
126
126
|
jobs:
|
|
127
127
|
buildLatest:
|
|
128
128
|
uses: apify/apify-test-tools/.github/workflows/public_push-build-latest.yaml@workflows-v0
|
|
129
|
+
with:
|
|
130
|
+
report-slack-channel: '#notif-my-repo'
|
|
129
131
|
secrets:
|
|
130
132
|
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
|
|
131
133
|
# One entry per secret apify-test-tools.config.json names, today each `tokenEnvVar`
|
|
@@ -148,7 +150,7 @@ vitest's own JSON report are uploaded as the `vitest-results` artifact. Runs onl
|
|
|
148
150
|
| ---------------------- | ------ | ------- | ---------------------------------------------------------------------------- |
|
|
149
151
|
| `test-files-glob` | string | `''` | Which tests to run, relative to `test/platform`. Empty runs everything in it |
|
|
150
152
|
| `subtest` | string | `''` | Deprecated, use `test-files-glob` |
|
|
151
|
-
| `report-slack-channel` | string | `''` | Slack channel for the results. Empty
|
|
153
|
+
| `report-slack-channel` | string | `''` | Slack channel for the results. Empty skips Slack |
|
|
152
154
|
|
|
153
155
|
Secrets: `TESTER_APIFY_TOKEN` (required), `SLACK_BOT_TOKEN`, and optionally `NPM_TOKEN`.
|
|
154
156
|
|
|
@@ -166,6 +168,8 @@ on:
|
|
|
166
168
|
jobs:
|
|
167
169
|
platformTestsDaily:
|
|
168
170
|
uses: apify/apify-test-tools/.github/workflows/public_platform-tests.yaml@workflows-v0
|
|
171
|
+
with:
|
|
172
|
+
report-slack-channel: '#notif-my-repo'
|
|
169
173
|
secrets:
|
|
170
174
|
TESTER_APIFY_TOKEN: ${{ secrets.TESTER_APIFY_TOKEN }}
|
|
171
175
|
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
|
|
@@ -187,6 +191,7 @@ jobs:
|
|
|
187
191
|
uses: apify/apify-test-tools/.github/workflows/public_platform-tests.yaml@workflows-v0
|
|
188
192
|
with:
|
|
189
193
|
test-files-glob: hourly
|
|
194
|
+
report-slack-channel: '#notif-my-repo'
|
|
190
195
|
secrets:
|
|
191
196
|
TESTER_APIFY_TOKEN: ${{ secrets.TESTER_APIFY_TOKEN }}
|
|
192
197
|
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
|
|
@@ -286,6 +291,7 @@ jobs:
|
|
|
286
291
|
uses: apify/apify-test-tools/.github/workflows/public_platform-tests.yaml@workflows-v0
|
|
287
292
|
with:
|
|
288
293
|
test-files-glob: hourly
|
|
294
|
+
report-slack-channel: '#notif-my-repo'
|
|
289
295
|
secrets:
|
|
290
296
|
TESTER_APIFY_TOKEN: ${{ secrets.TESTER_APIFY_TOKEN }}
|
|
291
297
|
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
|
package/package.json
CHANGED
|
@@ -32,12 +32,16 @@ describe('withActorIds', () => {
|
|
|
32
32
|
expect(client.actor).not.toHaveBeenCalled();
|
|
33
33
|
});
|
|
34
34
|
|
|
35
|
-
it('
|
|
36
|
-
|
|
37
|
-
'
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
)
|
|
35
|
+
it('keeps an Actor the token cannot see as listed, instead of failing the run', async () => {
|
|
36
|
+
const targets = [
|
|
37
|
+
{ actorFullName: 'owner/missing' },
|
|
38
|
+
{ actorRawId: 'rawMissing' },
|
|
39
|
+
{ actorFullName: 'owner/a' },
|
|
40
|
+
];
|
|
41
|
+
expect(await withActorIds(targets, fakeClient())).toEqual([
|
|
42
|
+
{ actorFullName: 'owner/missing' },
|
|
43
|
+
{ actorRawId: 'rawMissing' },
|
|
44
|
+
{ actorFullName: 'owner/a', actorRawId: 'rawA' },
|
|
45
|
+
]);
|
|
42
46
|
});
|
|
43
47
|
});
|