Files
qwen-code/scripts/run-macos-ci-group.js
T
易良andQwen-Coder 84aee5b9b7 test(web-shell): include transcript coverage in recovery fixture (#15883)
* test(web-shell): include transcript coverage in recovery fixture

Co-authored-by: Qwen-Coder <[email protected]>

* test(web-shell): complete recovery event fixtures

Remove the unevaluated transcript type guard and supply required event terminal flags without changing assertions.

Co-authored-by: Qwen-Coder <[email protected]>

* fix(ci): use runner temp for Web Shell browser smoke (#15884)

* fix(ci): use runner temp for Web Shell browser smoke

Co-authored-by: Qwen-Coder <[email protected]>

* fix(ci): resolve runner temp in the browser step context

Co-authored-by: Qwen-Coder <[email protected]>

---------

Co-authored-by: Qwen-Coder <[email protected]>

* fix(ci): partition the complete macOS test suite into bounded jobs (#15888)

* fix(ci): use runner temp for Web Shell browser smoke

Co-authored-by: Qwen-Coder <[email protected]>

* fix(ci): resolve runner temp in the browser step context

Co-authored-by: Qwen-Coder <[email protected]>

* fix(ci): partition the complete macOS test suite into bounded jobs

Co-authored-by: Qwen-Coder <[email protected]>

* fix(ci): account for the macOS aggregate job budget

Record the additional five-minute aggregate without changing any test execution timeout.

Co-authored-by: Qwen-Coder <[email protected]>

* test(install): isolate Windows fixtures from persistent PATH (#15889)

Co-authored-by: Qwen-Coder <[email protected]>

* fix(ci): write the macOS shard matrix in block style and pin its gates

The seven-row matrix used YAML flow mappings, which `.yamllint.yml`
forbids (`braces: forbid: 'non-empty'`), so the `Run yamllint` step
cannot go green on this branch. Rewrite the rows in the block style
every other workflow matrix in this repo already uses.

Add the test pins the shard plumbing was missing:

- the `cli`/`core` dispatch argv, including the bare `--` that keeps
  `--shard` forwarded to vitest instead of consumed by npm, and the
  per-group `NODE_OPTIONS` choice
- `id: 'install'` on `test_macos_shards`, which the suite's
  `steps.install.outcome` gate silently reads as '' if it is renamed
- the aggregate `test_macos` gate against the shards' gate, so the
  preserved check name cannot report `skipped` while the legs fail

Co-authored-by: Qwen-Coder <[email protected]>
Patrol-Run: qwen-pr-closeout/jmvu6810z1y

* fix(ci): preserve shell fixture gates on macOS system Bash

Handle empty issue families under nounset without mapfile and explicitly reject either missing OSS credential. Keep failure assertions and include shell diagnostics.

Co-authored-by: Qwen-Coder <[email protected]>

---------

Co-authored-by: Qwen-Coder <[email protected]>

* fix(ci): keep macOS aggregate failures eligible for infra retry

Co-authored-by: Qwen-Coder <[email protected]>

---------

Co-authored-by: Qwen-Coder <[email protected]>
2026-10-30 18:24:19 +08:00

65 lines
1.7 KiB
JavaScript

/**
* @license
* Copyright 2026 Qwen Team
* SPDX-License-Identifier: Apache-2.0
*/
import { spawnSync } from 'node:child_process';
import { resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
export function runMacOsGroup(group, shard, spawn = spawnSync) {
const options = {
stdio: 'inherit',
env:
group === 'scripts'
? process.env
: { ...process.env, NODE_OPTIONS: '--max-old-space-size=3072' },
};
const run = (args) => spawn('npm', args, options).status ?? 1;
if (group === 'cli' || group === 'core') {
return run([
'run',
'test:ci',
`--workspace=packages/${group}`,
'--',
`--shard=${shard}`,
]);
}
if (group === 'scripts') {
const standalone = run(['run', 'test:standalone:runtimes:ci']);
const scripts = run(['run', 'test:scripts:unit']);
return standalone || scripts;
}
if (group !== 'rest') {
throw new Error(`Unknown macOS test group: ${group}`);
}
const metadata = spawn(
'npm',
['pkg', 'get', 'scripts.test:ci', '--workspaces', '--json'],
{ encoding: 'utf8' },
);
if (metadata.status !== 0) return metadata.status ?? 1;
const workspaces = Object.entries(JSON.parse(metadata.stdout))
.filter(
([name, script]) =>
typeof script === 'string' &&
name !== '@qwen-code/qwen-code' &&
name !== '@qwen-code/qwen-code-core',
)
.map(([name]) => `--workspace=${name}`);
if (workspaces.length === 0) {
throw new Error('No remaining workspace test suites were discovered');
}
return run(['run', 'test:ci', ...workspaces]);
}
if (
process.argv[1] &&
resolve(process.argv[1]) === fileURLToPath(import.meta.url)
) {
process.exitCode = runMacOsGroup(process.argv[2], process.argv[3]);
}