faf-taf-git 2.4.1 → 2.4.2
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.
- package/CHANGELOG.md +11 -1
- package/README.md +1 -1
- package/package.json +14 -1
- package/project.faf +2 -2
- package/.faf-dna +0 -95
- package/.fafignore +0 -41
- package/.github/dependabot.yml +0 -10
- package/.github/workflows/ci.yml +0 -53
- package/.github/workflows/claude-code-review.yml +0 -36
- package/.github/workflows/claude.yml +0 -39
- package/.github/workflows/homebrew.yml +0 -19
- package/.taf +0 -98
- package/CLAUDE.md +0 -30
- package/CODE_OF_CONDUCT.md +0 -21
- package/CONTRIBUTING.md +0 -289
- package/SECURITY.md +0 -19
- package/action.yml +0 -50
- package/agent.fafa +0 -53
- package/badge.svg +0 -21
- package/dist/bundle/index.js +0 -36554
- package/dist/index.js +0 -42827
- package/dist/index.js.map +0 -1
- package/dist/licenses.txt +0 -126
- package/dist/sourcemap-register.js +0 -1
- package/docs/RELEASE-NOTES.md +0 -200
- package/docs/USER-GUIDE.md +0 -301
- package/jest.config.js +0 -13
- package/src/badge.ts +0 -138
- package/src/cli.ts +0 -311
- package/src/index.ts +0 -201
- package/src/parsers/bun.ts +0 -103
- package/src/parsers/index.ts +0 -50
- package/src/parsers/jest.ts +0 -104
- package/src/parsers/junit.ts +0 -110
- package/src/parsers/vitest.ts +0 -65
- package/src/parsers/wjttc.ts +0 -160
- package/src/taf-core.ts +0 -139
- package/test-mcp.ts +0 -83
- package/test-standalone.ts +0 -87
- package/tests/action-bundle.test.ts +0 -34
- package/tests/action-parse-error.test.ts +0 -47
- package/tests/badge.test.ts +0 -260
- package/tests/bun-parser.test.ts +0 -173
- package/tests/cli-version.test.ts +0 -31
- package/tests/jest-parser.test.ts +0 -122
- package/tests/junit-parser.test.ts +0 -109
- package/tests/vitest-parser.test.ts +0 -112
- package/tests/wjttc-parser.test.ts +0 -116
- package/tests/wjttc-taf.test.ts +0 -470
- package/tsconfig.json +0 -18
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tests for Jest output parser
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { parseJestOutput } from '../src/parsers/jest';
|
|
6
|
-
|
|
7
|
-
describe('Jest Parser', () => {
|
|
8
|
-
describe('parseJestOutput', () => {
|
|
9
|
-
it('should parse all passing tests', () => {
|
|
10
|
-
const output = `
|
|
11
|
-
Test Suites: 18 passed, 18 total
|
|
12
|
-
Tests: 173 passed, 173 total
|
|
13
|
-
Snapshots: 0 total
|
|
14
|
-
Time: 2.5s
|
|
15
|
-
`;
|
|
16
|
-
|
|
17
|
-
const result = parseJestOutput(output);
|
|
18
|
-
|
|
19
|
-
expect(result).not.toBeNull();
|
|
20
|
-
expect(result?.total).toBe(173);
|
|
21
|
-
expect(result?.passed).toBe(173);
|
|
22
|
-
expect(result?.failed).toBe(0);
|
|
23
|
-
expect(result?.result).toBe('PASSED');
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
it('should parse with failed tests', () => {
|
|
27
|
-
const output = `
|
|
28
|
-
Test Suites: 1 failed, 17 passed, 18 total
|
|
29
|
-
Tests: 1 failed, 172 passed, 173 total
|
|
30
|
-
Snapshots: 0 total
|
|
31
|
-
Time: 2.5s
|
|
32
|
-
`;
|
|
33
|
-
|
|
34
|
-
const result = parseJestOutput(output);
|
|
35
|
-
|
|
36
|
-
expect(result).not.toBeNull();
|
|
37
|
-
expect(result?.total).toBe(173);
|
|
38
|
-
expect(result?.passed).toBe(172);
|
|
39
|
-
expect(result?.failed).toBe(1);
|
|
40
|
-
expect(result?.result).toBe('FAILED');
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
it('should parse with skipped tests', () => {
|
|
44
|
-
const output = `
|
|
45
|
-
Test Suites: 18 passed, 18 total
|
|
46
|
-
Tests: 2 skipped, 171 passed, 173 total
|
|
47
|
-
Snapshots: 0 total
|
|
48
|
-
Time: 2.5s
|
|
49
|
-
`;
|
|
50
|
-
|
|
51
|
-
const result = parseJestOutput(output);
|
|
52
|
-
|
|
53
|
-
expect(result).not.toBeNull();
|
|
54
|
-
expect(result?.total).toBe(173);
|
|
55
|
-
expect(result?.passed).toBe(171);
|
|
56
|
-
expect(result?.failed).toBe(0);
|
|
57
|
-
expect(result?.skipped).toBe(2);
|
|
58
|
-
expect(result?.result).toBe('PASSED');
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
it('should parse with mixed results', () => {
|
|
62
|
-
const output = `
|
|
63
|
-
Test Suites: 2 failed, 16 passed, 18 total
|
|
64
|
-
Tests: 5 failed, 3 skipped, 165 passed, 173 total
|
|
65
|
-
Snapshots: 0 total
|
|
66
|
-
Time: 2.5s
|
|
67
|
-
`;
|
|
68
|
-
|
|
69
|
-
const result = parseJestOutput(output);
|
|
70
|
-
|
|
71
|
-
expect(result).not.toBeNull();
|
|
72
|
-
expect(result?.total).toBe(173);
|
|
73
|
-
expect(result?.passed).toBe(165);
|
|
74
|
-
expect(result?.failed).toBe(5);
|
|
75
|
-
expect(result?.skipped).toBe(3);
|
|
76
|
-
expect(result?.result).toBe('FAILED');
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
it('should handle output without test line', () => {
|
|
80
|
-
const output = `
|
|
81
|
-
Some random output
|
|
82
|
-
No test results here
|
|
83
|
-
`;
|
|
84
|
-
|
|
85
|
-
const result = parseJestOutput(output);
|
|
86
|
-
|
|
87
|
-
expect(result).toBeNull();
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
it('should handle malformed output', () => {
|
|
91
|
-
const output = `
|
|
92
|
-
Tests: invalid data
|
|
93
|
-
`;
|
|
94
|
-
|
|
95
|
-
const result = parseJestOutput(output);
|
|
96
|
-
|
|
97
|
-
expect(result).toBeNull();
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
it('should handle real CLI output with colors', () => {
|
|
101
|
-
const output = `
|
|
102
|
-
PASS src/commands/taf-init.test.ts
|
|
103
|
-
PASS src/commands/taf-log.test.ts
|
|
104
|
-
PASS src/commands/taf-validate.test.ts
|
|
105
|
-
|
|
106
|
-
Test Suites: 18 passed, 18 total
|
|
107
|
-
Tests: 173 passed, 173 total
|
|
108
|
-
Snapshots: 0 total
|
|
109
|
-
Time: 2.512 s
|
|
110
|
-
Ran all test suites.
|
|
111
|
-
`;
|
|
112
|
-
|
|
113
|
-
const result = parseJestOutput(output);
|
|
114
|
-
|
|
115
|
-
expect(result).not.toBeNull();
|
|
116
|
-
expect(result?.total).toBe(173);
|
|
117
|
-
expect(result?.passed).toBe(173);
|
|
118
|
-
expect(result?.failed).toBe(0);
|
|
119
|
-
expect(result?.result).toBe('PASSED');
|
|
120
|
-
});
|
|
121
|
-
});
|
|
122
|
-
});
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* JUnit XML Parser Tests
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { parseJunitOutput } from '../src/parsers/junit';
|
|
6
|
-
import { parseTestOutput, SUPPORTED_PARSERS } from '../src/parsers';
|
|
7
|
-
|
|
8
|
-
describe('JUnit XML Parser', () => {
|
|
9
|
-
describe('parseJunitOutput', () => {
|
|
10
|
-
test('should parse a pytest report (<testsuites> root without totals)', () => {
|
|
11
|
-
const output = `<?xml version="1.0" encoding="utf-8"?>
|
|
12
|
-
<testsuites name="pytest tests"><testsuite name="pytest" errors="0" failures="1" skipped="2" tests="12" time="0.4" timestamp="2026-10-29T20:00:00" hostname="runner">
|
|
13
|
-
<testcase classname="tests.test_a" name="test_ok" time="0.001" />
|
|
14
|
-
<testcase classname="tests.test_a" name="test_bad" time="0.002"><failure message="assert 1 == 2">assert 1 == 2</failure></testcase>
|
|
15
|
-
</testsuite></testsuites>`;
|
|
16
|
-
const result = parseJunitOutput(output);
|
|
17
|
-
expect(result).toEqual({ total: 12, passed: 9, failed: 1, skipped: 2, result: 'FAILED' });
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
test('should use the totals on a <testsuites> root (gotestsum, Maven)', () => {
|
|
21
|
-
const output = `<testsuites tests="40" failures="0" errors="0" skipped="3">
|
|
22
|
-
<testsuite name="pkg/a" tests="25" failures="0" errors="0" skipped="1"></testsuite>
|
|
23
|
-
<testsuite name="pkg/b" tests="15" failures="0" errors="0" skipped="2"></testsuite>
|
|
24
|
-
</testsuites>`;
|
|
25
|
-
expect(parseJunitOutput(output)).toEqual({ total: 40, passed: 37, failed: 0, skipped: 3, result: 'PASSED' });
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
test('should sum the suites when the root has no totals (cargo2junit)', () => {
|
|
29
|
-
const output = `<testsuites>
|
|
30
|
-
<testsuite id="0" name="faf_rust_sdk" package="testsuite/faf_rust_sdk" tests="30" errors="0" failures="0" hostname="localhost" timestamp="2026-10-29T20:00:00Z" time="0">
|
|
31
|
-
<testcase name="parses_minimal" time="0" />
|
|
32
|
-
</testsuite>
|
|
33
|
-
<testsuite id="1" name="integration" tests="8" errors="1" failures="0" skipped="0" time="0"></testsuite>
|
|
34
|
-
</testsuites>`;
|
|
35
|
-
expect(parseJunitOutput(output)).toEqual({ total: 38, passed: 37, failed: 1, skipped: undefined, result: 'FAILED' });
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
test('should parse a single <testsuite> root', () => {
|
|
39
|
-
const output = `<?xml version="1.0"?>
|
|
40
|
-
<testsuite name="jest tests" tests="7" failures="0" errors="0" skipped="0"></testsuite>`;
|
|
41
|
-
expect(parseJunitOutput(output)).toEqual({ total: 7, passed: 7, failed: 0, skipped: undefined, result: 'PASSED' });
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
test('should count nested suites once (outermost level only)', () => {
|
|
45
|
-
const output = `<testsuites>
|
|
46
|
-
<testsuite name="outer" tests="5" failures="0" errors="0">
|
|
47
|
-
<testsuite name="inner" tests="5" failures="0" errors="0"></testsuite>
|
|
48
|
-
</testsuite>
|
|
49
|
-
</testsuites>`;
|
|
50
|
-
expect(parseJunitOutput(output)!.total).toBe(5);
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
test('should count failures and errors together as failed', () => {
|
|
54
|
-
const output = `<testsuite tests="10" failures="2" errors="1" skipped="1"></testsuite>`;
|
|
55
|
-
expect(parseJunitOutput(output)).toEqual({ total: 10, passed: 6, failed: 3, skipped: 1, result: 'FAILED' });
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
test('should count disabled tests as skipped', () => {
|
|
59
|
-
const output = `<testsuites tests="6" failures="0" errors="0" disabled="2"></testsuites>`;
|
|
60
|
-
expect(parseJunitOutput(output)).toEqual({ total: 6, passed: 4, failed: 0, skipped: 2, result: 'PASSED' });
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
test('should count <testcase> elements when the suites carry no counts', () => {
|
|
64
|
-
const output = `<testsuites><testsuite name="bare">
|
|
65
|
-
<testcase name="a" />
|
|
66
|
-
<testcase name="b"><failure message="boom" /></testcase>
|
|
67
|
-
<testcase name="c"><skipped /></testcase>
|
|
68
|
-
<testcase name="d"><error message="crash" /></testcase>
|
|
69
|
-
</testsuite></testsuites>`;
|
|
70
|
-
expect(parseJunitOutput(output)).toEqual({ total: 4, passed: 1, failed: 2, skipped: 1, result: 'FAILED' });
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
test('should accept single-quoted attributes', () => {
|
|
74
|
-
expect(parseJunitOutput(`<testsuite tests='3' failures='0'></testsuite>`)!.total).toBe(3);
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
test('should ignore a commented-out suite', () => {
|
|
78
|
-
const output = `<!-- <testsuite tests="99" failures="9"></testsuite> -->
|
|
79
|
-
<testsuite tests="2" failures="0"></testsuite>`;
|
|
80
|
-
expect(parseJunitOutput(output)).toEqual({ total: 2, passed: 2, failed: 0, skipped: undefined, result: 'PASSED' });
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
test('should return null for a report with zero tests', () => {
|
|
84
|
-
expect(parseJunitOutput(`<testsuites><testsuite tests="0" failures="0"></testsuite></testsuites>`)).toBeNull();
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
test('should return null for output that is not JUnit XML', () => {
|
|
88
|
-
expect(parseJunitOutput('Tests: 173 passed, 173 total')).toBeNull();
|
|
89
|
-
expect(parseJunitOutput('')).toBeNull();
|
|
90
|
-
});
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
describe('parseTestOutput routing', () => {
|
|
94
|
-
test('should list JUnit XML first among the supported parsers', () => {
|
|
95
|
-
expect(SUPPORTED_PARSERS[0]).toBe('JUnit XML');
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
test('should read the XML counts even when captured stdout holds another summary line', () => {
|
|
99
|
-
const output = `<testsuite tests="20" failures="0" errors="0" skipped="0">
|
|
100
|
-
<system-out>Tests: 3 passed, 3 total</system-out>
|
|
101
|
-
</testsuite>`;
|
|
102
|
-
expect(parseTestOutput(output)!.total).toBe(20);
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
test('should still route plain Jest output to the Jest parser', () => {
|
|
106
|
-
expect(parseTestOutput('Tests: 1 failed, 172 passed, 173 total')!.total).toBe(173);
|
|
107
|
-
});
|
|
108
|
-
});
|
|
109
|
-
});
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Vitest Parser Tests
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { parseVitestOutput } from '../src/parsers/vitest';
|
|
6
|
-
|
|
7
|
-
describe('Vitest Parser', () => {
|
|
8
|
-
describe('parseVitestOutput', () => {
|
|
9
|
-
test('should parse all passing tests', () => {
|
|
10
|
-
const output = `
|
|
11
|
-
✓ tests/basic.test.ts (3)
|
|
12
|
-
✓ tests/advanced.test.ts (5)
|
|
13
|
-
|
|
14
|
-
Test Files 2 passed (2)
|
|
15
|
-
Tests 8 passed (8)
|
|
16
|
-
Start at 14:23:45
|
|
17
|
-
Duration 1.23s
|
|
18
|
-
`;
|
|
19
|
-
const result = parseVitestOutput(output);
|
|
20
|
-
expect(result).not.toBeNull();
|
|
21
|
-
expect(result!.total).toBe(8);
|
|
22
|
-
expect(result!.passed).toBe(8);
|
|
23
|
-
expect(result!.failed).toBe(0);
|
|
24
|
-
expect(result!.result).toBe('PASSED');
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
test('should parse with failed tests', () => {
|
|
28
|
-
const output = `
|
|
29
|
-
❯ tests/basic.test.ts (3)
|
|
30
|
-
✓ adds numbers
|
|
31
|
-
× fails gracefully
|
|
32
|
-
✓ handles edge case
|
|
33
|
-
|
|
34
|
-
Test Files 1 failed | 1 passed (2)
|
|
35
|
-
Tests 1 failed | 7 passed (8)
|
|
36
|
-
Start at 14:23:45
|
|
37
|
-
Duration 2.34s
|
|
38
|
-
`;
|
|
39
|
-
const result = parseVitestOutput(output);
|
|
40
|
-
expect(result).not.toBeNull();
|
|
41
|
-
expect(result!.total).toBe(8);
|
|
42
|
-
expect(result!.passed).toBe(7);
|
|
43
|
-
expect(result!.failed).toBe(1);
|
|
44
|
-
expect(result!.result).toBe('FAILED');
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
test('should parse with skipped tests', () => {
|
|
48
|
-
const output = `
|
|
49
|
-
✓ tests/basic.test.ts (7)
|
|
50
|
-
|
|
51
|
-
Test Files 1 passed (1)
|
|
52
|
-
Tests 2 skipped | 5 passed (7)
|
|
53
|
-
Start at 14:23:45
|
|
54
|
-
Duration 0.89s
|
|
55
|
-
`;
|
|
56
|
-
const result = parseVitestOutput(output);
|
|
57
|
-
expect(result).not.toBeNull();
|
|
58
|
-
expect(result!.total).toBe(7);
|
|
59
|
-
expect(result!.passed).toBe(5);
|
|
60
|
-
expect(result!.skipped).toBe(2);
|
|
61
|
-
expect(result!.result).toBe('PASSED');
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
test('should parse with failed, skipped, and todo', () => {
|
|
65
|
-
const output = `
|
|
66
|
-
Test Files 1 failed | 2 passed (3)
|
|
67
|
-
Tests 1 failed | 2 skipped | 1 todo | 6 passed (10)
|
|
68
|
-
Duration 3.45s
|
|
69
|
-
`;
|
|
70
|
-
const result = parseVitestOutput(output);
|
|
71
|
-
expect(result).not.toBeNull();
|
|
72
|
-
expect(result!.total).toBe(10);
|
|
73
|
-
expect(result!.passed).toBe(6);
|
|
74
|
-
expect(result!.failed).toBe(1);
|
|
75
|
-
expect(result!.skipped).toBe(3); // 2 skipped + 1 todo
|
|
76
|
-
expect(result!.result).toBe('FAILED');
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
test('should handle output without test summary', () => {
|
|
80
|
-
const output = 'Some random output\nNo test results here';
|
|
81
|
-
const result = parseVitestOutput(output);
|
|
82
|
-
expect(result).toBeNull();
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
test('should handle output with ANSI color codes', () => {
|
|
86
|
-
const output = `
|
|
87
|
-
\x1b[32m ✓\x1b[0m tests/basic.test.ts (5)
|
|
88
|
-
|
|
89
|
-
Test Files \x1b[1m\x1b[32m1 passed\x1b[0m (1)
|
|
90
|
-
Tests \x1b[1m\x1b[32m5 passed\x1b[0m (5)
|
|
91
|
-
Duration 0.45s
|
|
92
|
-
`;
|
|
93
|
-
const result = parseVitestOutput(output);
|
|
94
|
-
expect(result).not.toBeNull();
|
|
95
|
-
expect(result!.total).toBe(5);
|
|
96
|
-
expect(result!.passed).toBe(5);
|
|
97
|
-
expect(result!.result).toBe('PASSED');
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
test('should handle large test counts', () => {
|
|
101
|
-
const output = `
|
|
102
|
-
Test Files 45 passed (45)
|
|
103
|
-
Tests 1234 passed (1234)
|
|
104
|
-
Duration 45.67s
|
|
105
|
-
`;
|
|
106
|
-
const result = parseVitestOutput(output);
|
|
107
|
-
expect(result).not.toBeNull();
|
|
108
|
-
expect(result!.total).toBe(1234);
|
|
109
|
-
expect(result!.passed).toBe(1234);
|
|
110
|
-
});
|
|
111
|
-
});
|
|
112
|
-
});
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WJTTC output parser — human log + --json suite
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { parseWjttcOutput } from '../src/parsers/wjttc';
|
|
6
|
-
import { parseTestOutput } from '../src/parsers';
|
|
7
|
-
|
|
8
|
-
describe('parseWjttcOutput', () => {
|
|
9
|
-
describe('human log', () => {
|
|
10
|
-
test('all passing', () => {
|
|
11
|
-
const output = `pc-ai WJTTC
|
|
12
|
-
----------
|
|
13
|
-
PASS VAL-01 valid-simple portfolio accepts
|
|
14
|
-
PASS OPT-01 $450 / MCC 4511
|
|
15
|
-
----------
|
|
16
|
-
2/2 passed
|
|
17
|
-
`;
|
|
18
|
-
const r = parseWjttcOutput(output);
|
|
19
|
-
expect(r).not.toBeNull();
|
|
20
|
-
expect(r!.total).toBe(2);
|
|
21
|
-
expect(r!.passed).toBe(2);
|
|
22
|
-
expect(r!.failed).toBe(0);
|
|
23
|
-
expect(r!.result).toBe('PASSED');
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
test('mixed pass/fail uses summary and FAIL lines', () => {
|
|
27
|
-
const output = `pc-ai WJTTC
|
|
28
|
-
----------
|
|
29
|
-
PASS GATE-01 valid portfolio reaches optimize
|
|
30
|
-
FAIL DEPLOY-01 production serves the committed build
|
|
31
|
-
----------
|
|
32
|
-
1/2 passed
|
|
33
|
-
`;
|
|
34
|
-
const r = parseWjttcOutput(output);
|
|
35
|
-
expect(r).not.toBeNull();
|
|
36
|
-
expect(r!.total).toBe(2);
|
|
37
|
-
expect(r!.passed).toBe(1);
|
|
38
|
-
expect(r!.failed).toBe(1);
|
|
39
|
-
expect(r!.result).toBe('FAILED');
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
test('rejects bare N/N passed without WJTTC banner', () => {
|
|
43
|
-
expect(parseWjttcOutput('12/12 passed\n')).toBeNull();
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
describe('--json suite', () => {
|
|
48
|
-
test('pc-ai-wjttc summary object', () => {
|
|
49
|
-
const output = JSON.stringify({
|
|
50
|
-
suite: 'pc-ai-wjttc',
|
|
51
|
-
total: 33,
|
|
52
|
-
passed: 31,
|
|
53
|
-
failed: 2,
|
|
54
|
-
results: [],
|
|
55
|
-
});
|
|
56
|
-
const r = parseWjttcOutput(output);
|
|
57
|
-
expect(r).not.toBeNull();
|
|
58
|
-
expect(r!.total).toBe(33);
|
|
59
|
-
expect(r!.passed).toBe(31);
|
|
60
|
-
expect(r!.failed).toBe(2);
|
|
61
|
-
expect(r!.result).toBe('FAILED');
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
test('prefers results[] length when it disagrees with total (partition)', () => {
|
|
65
|
-
const output = JSON.stringify({
|
|
66
|
-
suite: 'pc-ai-wjttc',
|
|
67
|
-
total: 33,
|
|
68
|
-
passed: 33,
|
|
69
|
-
failed: 0,
|
|
70
|
-
results: [
|
|
71
|
-
{ id: 'VAL-01', ok: true },
|
|
72
|
-
{ id: 'OPT-01', ok: true },
|
|
73
|
-
{ id: 'GATE-01', ok: false },
|
|
74
|
-
],
|
|
75
|
-
});
|
|
76
|
-
const r = parseWjttcOutput(output);
|
|
77
|
-
expect(r).not.toBeNull();
|
|
78
|
-
expect(r!.total).toBe(3);
|
|
79
|
-
expect(r!.passed).toBe(2);
|
|
80
|
-
expect(r!.failed).toBe(1);
|
|
81
|
-
expect(r!.result).toBe('FAILED');
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
test('ignores other JSON suites', () => {
|
|
85
|
-
const output = JSON.stringify({
|
|
86
|
-
suite: 'pc-ai-deployed',
|
|
87
|
-
total: 12,
|
|
88
|
-
passed: 12,
|
|
89
|
-
failed: 0,
|
|
90
|
-
});
|
|
91
|
-
expect(parseWjttcOutput(output)).toBeNull();
|
|
92
|
-
});
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
describe('dispatcher', () => {
|
|
96
|
-
test('parseTestOutput picks WJTTC human log', () => {
|
|
97
|
-
const output = `pc-ai WJTTC
|
|
98
|
-
----------
|
|
99
|
-
PASS FAF-01 project.faf claims match
|
|
100
|
-
----------
|
|
101
|
-
1/1 passed
|
|
102
|
-
`;
|
|
103
|
-
const r = parseTestOutput(output);
|
|
104
|
-
expect(r).not.toBeNull();
|
|
105
|
-
expect(r!.total).toBe(1);
|
|
106
|
-
expect(r!.result).toBe('PASSED');
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
test('does not steal Jest Tests: line', () => {
|
|
110
|
-
const output = 'Tests: 10 passed, 10 total';
|
|
111
|
-
const r = parseTestOutput(output);
|
|
112
|
-
expect(r).not.toBeNull();
|
|
113
|
-
expect(r!.total).toBe(10);
|
|
114
|
-
});
|
|
115
|
-
});
|
|
116
|
-
});
|