agentic-workflow-manager 9.11.10 → 9.11.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -8,21 +8,90 @@ const fs_1 = __importDefault(require("fs"));
|
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
9
|
const CLI_ROOT = path_1.default.resolve(__dirname, '..', '..');
|
|
10
10
|
const REPO_ROOT = path_1.default.resolve(CLI_ROOT, '..');
|
|
11
|
+
function readWorkflow(name) {
|
|
12
|
+
return fs_1.default.readFileSync(path_1.default.join(REPO_ROOT, '.github', 'workflows', name), 'utf8').replace(/\r\n/g, '\n');
|
|
13
|
+
}
|
|
14
|
+
function assertArmPartition(source) {
|
|
15
|
+
const workflow = source.replace(/\r\n/g, '\n');
|
|
16
|
+
expect(workflow.match(/^ windows-arm-hot:\s*$/gm)).toHaveLength(1);
|
|
17
|
+
const [matrixJob, rest] = workflow.split(/^ windows-arm-hot:\s*$/m);
|
|
18
|
+
expect(rest).toBeDefined();
|
|
19
|
+
const hotJob = rest.split(/^ [a-z][\w-]*:\s*$/m)[0];
|
|
20
|
+
expect(matrixJob).toMatch(/- name: Tests?\n if: matrix\.target != 'win32-arm64'\n working-directory: cli\n run: npx jest --runInBand --bail\n/);
|
|
21
|
+
const remainder = matrixJob.match(/- name: Tests? \(Windows ARM remainder\)\n if: matrix\.target == 'win32-arm64'\n working-directory: cli\n run: ([^\n]+)/)?.[1];
|
|
22
|
+
expect(remainder).toMatch(/^npx jest --runInBand --bail --testPathIgnorePatterns='[^']+'$/);
|
|
23
|
+
const ignorePattern = remainder?.match(/--testPathIgnorePatterns='([^']+)'/)?.[1];
|
|
24
|
+
expect(ignorePattern).toBe(String.raw `node_modules|[/\\]cli[/\\]tests[/\\]commands[/\\]watch[/\\]track-(finalize|freeze)\.test\.ts$`);
|
|
25
|
+
const ignored = new RegExp(ignorePattern);
|
|
26
|
+
for (const separator of ['/', '\\']) {
|
|
27
|
+
const root = ['repo', 'cli', 'tests'].join(separator);
|
|
28
|
+
for (const suite of ['track-finalize', 'track-freeze']) {
|
|
29
|
+
expect(ignored.test([root, 'commands', 'watch', `${suite}.test.ts`].join(separator))).toBe(true);
|
|
30
|
+
expect(ignored.test([root, 'other', `${suite}.test.ts`].join(separator))).toBe(false);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
const remainderStep = matrixJob.split(/- name: Tests? \(Windows ARM remainder\)\n/)[1]?.split(/^ - name:/m)[0];
|
|
34
|
+
expect(remainderStep).toBeDefined();
|
|
35
|
+
expect(remainderStep).not.toContain('continue-on-error: true');
|
|
36
|
+
expect(matrixJob.match(/uses: actions\/upload-artifact@v4/g)).toHaveLength(1);
|
|
37
|
+
expect(hotJob).toContain('runs-on: windows-11-arm');
|
|
38
|
+
expect(hotJob).toContain('run: npm run native:build');
|
|
39
|
+
expect(hotJob).toContain('run: npm run native:test-build');
|
|
40
|
+
expect(hotJob.split('\n')).toContain(' run: npx jest --runTestsByPath tests/commands/watch/track-finalize.test.ts tests/commands/watch/track-freeze.test.ts --runInBand --bail');
|
|
41
|
+
expect(hotJob).not.toContain('upload-artifact@v4');
|
|
42
|
+
expect(hotJob).not.toContain('secure-fs-win32-arm64');
|
|
43
|
+
expect(hotJob).not.toMatch(/^\s*if:/m);
|
|
44
|
+
expect(hotJob).not.toContain('continue-on-error: true');
|
|
45
|
+
}
|
|
11
46
|
describe('native release artifacts', () => {
|
|
12
47
|
it('runs each platform suite once without weakening publication', () => {
|
|
13
48
|
for (const name of ['ci.yml', 'release.yml']) {
|
|
14
|
-
const workflow =
|
|
49
|
+
const workflow = readWorkflow(name);
|
|
15
50
|
expect(workflow).not.toContain('- name: Windows admission smoke');
|
|
16
51
|
expect(workflow).not.toContain('run: npx jest tests/commands/plan/index.test.ts --runInBand --bail');
|
|
17
52
|
expect(workflow).toContain('run: npx jest --runInBand --bail');
|
|
18
53
|
}
|
|
19
|
-
const release =
|
|
20
|
-
expect(release).toMatch(/release:\s*\n\s*needs: test/);
|
|
54
|
+
const release = readWorkflow('release.yml');
|
|
55
|
+
expect(release).toMatch(/release:\s*\n\s*needs: \[test, windows-arm-hot\]/);
|
|
21
56
|
for (const target of ['linux-x64', 'linux-arm64', 'darwin-x64', 'darwin-arm64', 'win32-x64', 'win32-arm64']) {
|
|
22
57
|
expect(release).toContain(`target: ${target}`);
|
|
23
58
|
}
|
|
24
59
|
expect(release).toContain('cancel-in-progress: false');
|
|
25
60
|
});
|
|
61
|
+
it('partitions the two hot ARM suites without duplicating the native artifact', () => {
|
|
62
|
+
for (const name of ['ci.yml', 'release.yml']) {
|
|
63
|
+
const workflow = readWorkflow(name);
|
|
64
|
+
assertArmPartition(workflow);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
it('checks the same partition after a Windows CRLF checkout', () => {
|
|
68
|
+
for (const name of ['ci.yml', 'release.yml']) {
|
|
69
|
+
const workflow = readWorkflow(name);
|
|
70
|
+
assertArmPartition(workflow.replace(/\n/g, '\r\n'));
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
it('rejects swapped matrix guards, non-gating hot tests and duplicate artifacts', () => {
|
|
74
|
+
for (const name of ['ci.yml', 'release.yml']) {
|
|
75
|
+
const workflow = readWorkflow(name);
|
|
76
|
+
const swapped = workflow.replace(/if: matrix\.target (?:!=|==) 'win32-arm64'/g, (guard) => guard.includes('!=') ? "if: matrix.target == 'win32-arm64'" : "if: matrix.target != 'win32-arm64'");
|
|
77
|
+
const nonGating = workflow.replace(' windows-arm-hot:\n', ' windows-arm-hot:\n continue-on-error: true\n');
|
|
78
|
+
const duplicateArtifact = workflow.replace('uses: actions/upload-artifact@v4', 'uses: actions/upload-artifact@v4\n - uses: actions/upload-artifact@v4');
|
|
79
|
+
const broadIgnore = workflow.replace(/(--testPathIgnorePatterns='[^']+)(?=')/, '$1|runner\\.test\\.ts$');
|
|
80
|
+
const skippedHot = workflow.replace(' - name: Test hot Windows ARM suites\n', ' - name: Test hot Windows ARM suites\n if: false\n');
|
|
81
|
+
const nonGatingRemainder = workflow.replace(/(run: npx jest --runInBand --bail --testPathIgnorePatterns='[^']+'\n)/, '$1 continue-on-error: true\n');
|
|
82
|
+
const maskedHot = workflow.replace(/(run: npx jest --runTestsByPath [^\n]+ --runInBand --bail)(?=\n)/, '$1; exit 0');
|
|
83
|
+
for (const mutated of [swapped, nonGating, duplicateArtifact, broadIgnore, skippedHot, nonGatingRemainder, maskedHot]) {
|
|
84
|
+
expect(mutated).not.toBe(workflow);
|
|
85
|
+
}
|
|
86
|
+
expect(() => assertArmPartition(swapped)).toThrow();
|
|
87
|
+
expect(() => assertArmPartition(nonGating)).toThrow();
|
|
88
|
+
expect(() => assertArmPartition(duplicateArtifact)).toThrow();
|
|
89
|
+
expect(() => assertArmPartition(broadIgnore)).toThrow();
|
|
90
|
+
expect(() => assertArmPartition(skippedHot)).toThrow();
|
|
91
|
+
expect(() => assertArmPartition(nonGatingRemainder)).toThrow();
|
|
92
|
+
expect(() => assertArmPartition(maskedHot)).toThrow();
|
|
93
|
+
}
|
|
94
|
+
});
|
|
26
95
|
it('keeps native prebuilds generated instead of versioned source', () => {
|
|
27
96
|
const gitignore = fs_1.default.readFileSync(path_1.default.join(REPO_ROOT, '.gitignore'), 'utf8');
|
|
28
97
|
const tracked = (0, child_process_1.execFileSync)('git', ['ls-files', '--', 'cli/prebuilds'], {
|
|
@@ -37,7 +106,7 @@ describe('native release artifacts', () => {
|
|
|
37
106
|
const pkg = JSON.parse(fs_1.default.readFileSync(path_1.default.join(CLI_ROOT, 'package.json'), 'utf8'));
|
|
38
107
|
expect(pkg.scripts['native:test-build']).toContain('secure_fs_test');
|
|
39
108
|
for (const name of ['ci.yml', 'release.yml']) {
|
|
40
|
-
const workflow =
|
|
109
|
+
const workflow = readWorkflow(name);
|
|
41
110
|
const testBuild = workflow.indexOf('run: npm run native:test-build');
|
|
42
111
|
const jest = workflow.indexOf('run: npx jest --runInBand --bail');
|
|
43
112
|
expect(testBuild).toBeGreaterThanOrEqual(0);
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|