Skip to content

Commit e02ce3c

Browse files
committed
fix(ci): keep OpenWork workflow tests across syncs
1 parent b232d0a commit e02ce3c

4 files changed

Lines changed: 5 additions & 377 deletions

File tree

scripts/sync-qwen-release.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,10 @@ if ! git -C "$repo_root" rev-parse --verify --quiet MERGE_HEAD >/dev/null; then
132132
fi
133133

134134
# OpenWork owns its public identity and CI policy; upstream code stays incremental.
135-
for overlay in README.md TRADEMARK.md SECURITY.md .github/workflows; do
135+
for overlay in README.md TRADEMARK.md SECURITY.md .github/workflows \
136+
scripts/tests/desktop-oss-workflow.test.js \
137+
scripts/tests/no-ak-integration-ci.test.js \
138+
scripts/tests/security-workflows.test.js; do
136139
git -C "$repo_root" rm -r -f --ignore-unmatch -- "$overlay" >/dev/null
137140
if git -C "$repo_root" cat-file -e "$before_merge:$overlay" 2>/dev/null; then
138141
git -C "$repo_root" checkout "$before_merge" -- "$overlay"

scripts/tests/desktop-oss-workflow.test.js

Lines changed: 0 additions & 157 deletions
This file was deleted.

scripts/tests/no-ak-integration-ci.test.js

Lines changed: 1 addition & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,7 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7-
import { execFileSync } from 'node:child_process';
8-
import {
9-
existsSync,
10-
mkdirSync,
11-
mkdtempSync,
12-
readFileSync,
13-
rmSync,
14-
} from 'node:fs';
15-
import { tmpdir } from 'node:os';
7+
import { readFileSync } from 'node:fs';
168
import path from 'node:path';
179
import { describe, expect, it } from 'vitest';
1810

@@ -27,104 +19,6 @@ const NODE_ACTION_PATH = '.github/actions/self-hosted-node/action.yml';
2719
const GUARD_STEP = 'Verify checkout includes expected head commit';
2820

2921
describe('no-AK integration CI wiring', () => {
30-
it.runIf(process.platform === 'linux')(
31-
'keeps Linux Unix socket paths short and identity-stable',
32-
() => {
33-
const workflow = readFileSync(
34-
path.join(ROOT, '.github/workflows/ci.yml'),
35-
'utf8',
36-
);
37-
const routingBlocks = ['test', 'test_macos', 'test_windows'].map(
38-
(jobName) => {
39-
const testStep = getWorkflowStep(
40-
getWorkflowJob(workflow, jobName),
41-
'Run tests and generate reports',
42-
);
43-
const start = testStep.indexOf('export TMPDIR=');
44-
expect(
45-
start,
46-
`${jobName}: TMPDIR routing block`,
47-
).toBeGreaterThanOrEqual(0);
48-
const end = testStep.indexOf('\n ( while true', start);
49-
expect(end, `${jobName}: sampler sentinel`).toBeGreaterThan(start);
50-
return testStep.slice(start, end);
51-
},
52-
);
53-
expect(new Set(routingBlocks)).toHaveLength(1);
54-
const [routeTemp] = routingBlocks;
55-
const root = mkdtempSync(path.join(tmpdir(), 'ci-temp-routing-'));
56-
const longRunnerTemp = path.join(root, 'x'.repeat(180));
57-
58-
try {
59-
mkdirSync(longRunnerTemp);
60-
const [routedTemp, resolvedTemp] = execFileSync(
61-
'bash',
62-
[
63-
'-c',
64-
`${routeTemp}\nprintf '%s\\n%s\\n' "$TMPDIR" "$(cd "$TMPDIR" && pwd -P)"`,
65-
],
66-
{
67-
encoding: 'utf8',
68-
env: {
69-
...process.env,
70-
RUNNER_OS: 'Linux',
71-
RUNNER_TEMP: longRunnerTemp,
72-
},
73-
},
74-
)
75-
.trim()
76-
.split('\n');
77-
78-
expect(resolvedTemp).toBe(routedTemp);
79-
expect(routedTemp).toMatch(/^\/var\/tmp\/qwen-ci-/);
80-
expect(existsSync(routedTemp)).toBe(false);
81-
expect(
82-
Buffer.byteLength(
83-
path.join(routedTemp, 'qwen-agent-view-XXXXXX', 'supervisor.sock'),
84-
),
85-
).toBeLessThan(108);
86-
expect(
87-
workflow.match(/mktemp -d \/var\/tmp\/qwen-ci-XXXXXX/g),
88-
).toHaveLength(3);
89-
expect(workflow).toContain('QWEN_CI_TMPDIR="$(mktemp -d');
90-
expect(workflow).toContain('if [ -n "$QWEN_CI_TMPDIR" ]; then');
91-
} finally {
92-
rmSync(root, { recursive: true, force: true });
93-
}
94-
},
95-
);
96-
97-
it('preserves test failures in every wrapped OS job', () => {
98-
const workflow = readFileSync(
99-
path.join(ROOT, '.github/workflows/ci.yml'),
100-
'utf8',
101-
);
102-
103-
for (const jobName of ['test', 'test_macos', 'test_windows']) {
104-
const testStep = getWorkflowStep(
105-
getWorkflowJob(workflow, jobName),
106-
'Run tests and generate reports',
107-
);
108-
expect(testStep).toContain(
109-
'trap \'rm -rf "$TMPDIR" 2>/dev/null || true\' EXIT',
110-
);
111-
let previous = -1;
112-
for (const command of [
113-
'set +e',
114-
'npm run test:ci',
115-
'RC=$?',
116-
'set -e',
117-
'pkill -TERM -P "$SAMPLER_PID" 2>/dev/null || true',
118-
'kill "$SAMPLER_PID" 2>/dev/null || true',
119-
'exit "$RC"',
120-
]) {
121-
const index = testStep.indexOf(command);
122-
expect(index, `${jobName}: ${command}`).toBeGreaterThan(previous);
123-
previous = index;
124-
}
125-
}
126-
});
127-
12822
it('defines a focused no-AK integration script', () => {
12923
const packageJson = JSON.parse(
13024
readFileSync(path.join(ROOT, 'package.json'), 'utf8'),

0 commit comments

Comments
 (0)