-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: support groups in interleaved parallel job outputs (#62)
* Import project in IntelliJ IDEA (ignore project folder) * Add basic test for groups * Add tests for #60 and interleaved groups * Fix #60
- Loading branch information
1 parent
4245c86
commit 84ecaff
Showing
6 changed files
with
155 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
bin/ | ||
node_modules/ | ||
coverage/ | ||
build/ | ||
build/ | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
import { OutputParser } from "@aj/output-parser/output-parser"; | ||
import path from "path"; | ||
import fs from "fs"; | ||
|
||
describe("parseOutput", () => { | ||
const resources = path.resolve(process.cwd(), "test", "unit", "resources", "output-parser"); | ||
|
||
describe("groups", () => { | ||
test("some groups", async () => { | ||
const output = fs.readFileSync(path.join(resources, "act-groups-sorted.log")).toString(); | ||
const parser = new OutputParser(output); | ||
|
||
const result = parser.parseOutput(); | ||
|
||
expect(result).toStrictEqual([ | ||
{ | ||
"groups": [ | ||
{ | ||
"name": "Unit Tests", | ||
"output": "1231 tests executed." | ||
}, | ||
{ | ||
"name": "Integration Tests", | ||
"output": "32 tests executed." | ||
} | ||
], | ||
"name": "Main Testing", | ||
"output": "1231 tests executed.\n32 tests executed.", | ||
"status": 0 | ||
}, | ||
{ | ||
"groups": [ | ||
{ | ||
"name": "Lint", | ||
"output": "No linting errors found." | ||
} | ||
], | ||
"name": "Main Lint", | ||
"output": "No linting errors found.", | ||
"status": 0 | ||
} | ||
]); | ||
}); | ||
|
||
test("interleaved groups", async () => { | ||
const output = fs.readFileSync(path.join(resources, "act-groups-interleaved.log")).toString(); | ||
const parser = new OutputParser(output); | ||
|
||
const result = parser.parseOutput(); | ||
|
||
expect(result).toStrictEqual([ | ||
{ | ||
"groups": [ | ||
{ | ||
"name": "Unit Tests", | ||
"output": "1231 tests executed." | ||
}, | ||
{ | ||
"name": "Integration Tests", | ||
"output": "32 tests executed." | ||
} | ||
], | ||
"name": "Main Testing", | ||
"output": "1231 tests executed.\n32 tests executed.", | ||
"status": 0 | ||
}, | ||
{ | ||
"groups": [ | ||
{ | ||
"name": "Lint", | ||
"output": "No linting errors found." | ||
} | ||
], | ||
"name": "Main Lint", | ||
"output": "No linting errors found.", | ||
"status": 0 | ||
} | ||
]); | ||
}); | ||
|
||
test("mixed groups", async () => { | ||
const output = fs.readFileSync(path.join(resources, "act-groups-mixed.log")).toString(); | ||
const parser = new OutputParser(output); | ||
|
||
const result = parser.parseOutput(); | ||
|
||
expect(result).toStrictEqual([ | ||
{ | ||
"groups": [ | ||
{ | ||
"name": "Unit Tests", | ||
"output": "1231 tests executed." | ||
}, | ||
{ | ||
"name": "Integration Tests", | ||
"output": "32 tests executed." | ||
} | ||
], | ||
"name": "Main Testing", | ||
"output": "1231 tests executed.\n32 tests executed.", | ||
"status": 0 | ||
}, | ||
{ | ||
"name": "Main Lint", | ||
"output": "No problems found.", | ||
"status": 0 | ||
} | ||
]); | ||
}); | ||
}); | ||
}); |
13 changes: 13 additions & 0 deletions
13
test/unit/resources/output-parser/act-groups-interleaved.log
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[Build/Tests ] ⭐ Run Main Testing | ||
[Build/Tests ] ❓ ::group::Unit Tests | ||
[Build/Tests ] | 1231 tests executed. | ||
[Build/Static Analysis ] ⭐ Run Main Lint | ||
[Build/Static Analysis ] ❓ ::group::Lint | ||
[Build/Tests ] ❓ ::endgroup:: | ||
[Build/Static Analysis ] | No linting errors found. | ||
[Build/Tests ] ❓ ::group::Integration Tests | ||
[Build/Tests ] | 32 tests executed. | ||
[Build/Tests ] ❓ ::endgroup:: | ||
[Build/Tests ] ✅ Success - Main Testing | ||
[Build/Static Analysis ] ❓ ::endgroup:: | ||
[Build/Static Analysis ] ✅ Success - Main Lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[Build/Tests ] ⭐ Run Main Testing | ||
[Build/Tests ] ❓ ::group::Unit Tests | ||
[Build/Static Analysis ] ⭐ Run Main Lint | ||
[Build/Static Analysis ] | No problems found. | ||
[Build/Tests ] | 1231 tests executed. | ||
[Build/Tests ] ❓ ::endgroup:: | ||
[Build/Tests ] ❓ ::group::Integration Tests | ||
[Build/Tests ] | 32 tests executed. | ||
[Build/Tests ] ❓ ::endgroup:: | ||
[Build/Static Analysis ] ✅ Success - Main Lint | ||
[Build/Tests ] ✅ Success - Main Testing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[Build/Tests ] ⭐ Run Main Testing | ||
[Build/Tests ] ❓ ::group::Unit Tests | ||
[Build/Tests ] | 1231 tests executed. | ||
[Build/Tests ] ❓ ::endgroup:: | ||
[Build/Tests ] ❓ ::group::Integration Tests | ||
[Build/Tests ] | 32 tests executed. | ||
[Build/Tests ] ❓ ::endgroup:: | ||
[Build/Tests ] ✅ Success - Main Testing | ||
[Build/Static Analysis ] ⭐ Run Main Lint | ||
[Build/Static Analysis ] ❓ ::group::Lint | ||
[Build/Static Analysis ] | No linting errors found. | ||
[Build/Static Analysis ] ❓ ::endgroup:: | ||
[Build/Static Analysis ] ✅ Success - Main Lint |