Files
qwen-code/scripts/tests/cua-driver-release-workflow.test.js
顾盼 a791e47a54 feat(cua): streamline computer use and port native reliability fixes (#14846)
* feat(cua): preload the JavaScript computer use runtime

* refactor(cua): remove the native Wayland backend

* feat(cua): move app computer use into the driver

* feat(cua): preserve background delivery and port platform fixes

* feat(cua): add explicit desktop input and browser runtime facade

* feat(cua): package the unified 0.26.0 computer use runtime

* fix(cua): finalize cross-platform native reliability

* fix(cua): isolate runtime releases from CLI versioning

* fix(cua): keep Electron out of root workspace installs

* fix(cua): synchronize consumers and async cleanup tests

* fix(browser): migrate smoke to preloaded cua runtime

* docs(cua): document MCP setup for Qwen Code Claude Code and Codex
2026-10-21 14:03:31 +08:00

77 lines
2.6 KiB
JavaScript

/**
* @license
* Copyright 2026 Qwen Team
* SPDX-License-Identifier: Apache-2.0
*/
import { readFileSync } from 'node:fs';
import { describe, expect, it } from 'vitest';
const workflow = readFileSync('.github/workflows/cd-cua-driver.yml', 'utf8');
const packageVerifier = readFileSync(
'packages/cua-driver/scripts/verify-cua-sdk-package.mjs',
'utf8',
);
const shellInstaller = readFileSync(
'packages/cua-driver/scripts/_install-rust.sh',
'utf8',
);
const powershellInstaller = readFileSync(
'packages/cua-driver/scripts/install.ps1',
'utf8',
);
describe('CUA SDK release workflow', () => {
it('fails closed when a driver production dispatch disables notarization', () => {
expect(workflow).toContain(
'"${{ inputs.dry_run }}" != "true" && "${{ inputs.notarize }}" != "true"',
);
});
it('requires Gatekeeper to accept the notarized app', () => {
expect(workflow).toContain(
'spctl -a -vv -t exec release/QwenCuaDriver.app',
);
expect(workflow).not.toMatch(/spctl[^\n]+\|\| true/u);
});
it('retries transient Debian mirror failures', () => {
expect(workflow.match(/apt-get -o Acquire::Retries=3/g)).toHaveLength(2);
});
it('smokes the high-level ComputerUse runtime from a clean package', () => {
expect(packageVerifier).toContain('await ComputerUse.create(');
expect(packageVerifier).toContain('await computer.appCall("click"');
expect(workflow).toContain('await ComputerUse.create(');
expect(workflow).toContain('await computer.close()');
});
it('keeps installer version assignments machine-rewritable', () => {
expect(shellInstaller).toMatch(/^CUA_DRIVER_RS_BAKED_VERSION="[^"\n]+"$/mu);
expect(powershellInstaller).toMatch(
/^\$Script:CuaDriverRsBakedVersion = "[^"\n]+"$/mu,
);
});
it('keeps historical Windows UIAccess assets installable', () => {
expect(powershellInstaller).toContain(
'$SignedUiaRequiredFrom = [version]"0.20.3"',
);
expect(powershellInstaller).toContain(
'$LegacyUiaRequiredFrom = [version]"0.2.8"',
);
expect(powershellInstaller).toMatch(
/\$requiresSignedUia = \[version\]\$version -ge \$SignedUiaRequiredFrom/,
);
expect(powershellInstaller).toMatch(
/elseif \(\$requiresLegacyUia\) \{[\s\S]*?cua-driver-uia\.exe/,
);
expect(powershellInstaller).toContain(
"@('qwen-cua-driver-uia.exe', 'cua-driver-uia.exe')",
);
expect(powershellInstaller).toMatch(
/if \(\$requiresSignedUia\) \{[\s\S]*?release archive is missing required qwen-cua-driver-uia\.exe[\s\S]*?Get-AuthenticodeSignature/,
);
});
});