Skip to content

Commit a170873

Browse files
authored
fix(e2e): broaden xiaoyuzhou skip logic for overseas CI runners (#316)
* fix: remove duplicate getErrorMessage import in discovery.ts Squash merge left a duplicate import line causing TS2300 and oxc parse errors in CI. Also clean up stale blank lines in discovery.ts and execution.ts. * fix(e2e): broaden xiaoyuzhou skip logic for overseas CI runners The isExpectedChineseSiteRestriction function only matched FETCH_ERROR with specific HTTP status codes. On overseas CI runners, xiaoyuzhou may also return PARSE_ERROR (mangled HTML) or NOT_FOUND (geo-redirected pages), causing false test failures. Now matches all CliError codes from the adapter.
1 parent 75f4237 commit a170873

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/e2e/public-commands.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ import { parseJsonOutput, runCli } from './helpers.js';
88

99
function isExpectedChineseSiteRestriction(code: number, stderr: string): boolean {
1010
if (code === 0) return false;
11-
return /Error \[FETCH_ERROR\]: HTTP (403|429|451|503)\b/.test(stderr);
11+
// Overseas CI runners may get HTTP errors, geo-blocks, DNS failures,
12+
// or receive mangled HTML that fails parsing.
13+
return /Error \[(FETCH_ERROR|PARSE_ERROR|NOT_FOUND)\]/.test(stderr)
14+
|| /fetch failed/.test(stderr);
1215
}
1316

1417
function isExpectedApplePodcastsRestriction(code: number, stderr: string): boolean {

0 commit comments

Comments
 (0)