Commit 3e3dc63
authored
ci: fix E2E tests (#3855)
The scheduled E2E runs have been red since 2 July. Two independent
causes.
## The token
Every failure was `ApifyApiError: User was not found or authentication
token is not valid` (401), which looks like an expired secret but is not
— the login succeeds every run.
The harness read the token out of `~/.apify/auth.json`. Since
[apify-cli#1197](apify/apify-cli#1197) the
bundle distribution (what CI installs) stores the token in the OS
keyring and strips it from that file — intended behaviour, as plaintext
storage was the bug it fixed. The file still exists, so the `existsSync`
guard passed, `getApifyToken()` returned `undefined`, and
`process.env.APIFY_TOKEN ??= undefined` coerced it to the literal string
`"undefined"`. That bogus token is what the API rejected.
It landed within the `1.6.3` beta line (`beta.6` wrote `auth.json`,
`beta.25` wrote the keyring), which is why it broke ~2 weeks before
1.7.0 shipped.
- Pass `APIFY_TOKEN` from the existing secret, so the harness no longer
reaches into the CLI's credential store. The beta CLI is still installed
and exercised as before.
- Throw a clear error when `auth.json` has no token, instead of silently
yielding `"undefined"`.
## The demo store
With the token fixed, PLATFORM actually ran its tests for the first time
since 2 July — and `cheerio-robots-file` then failed on `429`s from
`warehouse-theme-metal.myshopify.com`. The robots.txt behaviour under
test was fine; the crawl never got off the ground, so `requestsFinished`
was 0 and the precondition failed.
The store rate-limits plain-HTTP clients from the platform's shared
egress IP. The browser-driven tests on the same IP get through. The six
tests crawling that store now go through
`Actor.createProxyConfiguration()`.1 parent b3c3ef2 commit 3e3dc63
8 files changed
Lines changed: 23 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| 90 | + | |
| 91 | + | |
90 | 92 | | |
91 | 93 | | |
92 | 94 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| 92 | + | |
| 93 | + | |
92 | 94 | | |
93 | 95 | | |
94 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
342 | 351 | | |
343 | 352 | | |
344 | 353 | | |
| |||
0 commit comments