Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(schema): Correctly validate schema version (#2494)
* fix(schema): Correctly validate schema version * fix regex * Add unit test for v2 schema * Add v1 and v2 unit test to scala metrics * Add pending state in strict report v2 * Add Pending deserialization to scala * Update scala MutationTestResult schemaVersion to 2 * Update test to assert schema version 2 * Update encoder tests to schema version 2 * trim themeBackgroundColor in mutation testing elements integration test
- Loading branch information
1 parent
e605f8d
commit 72979e7
Showing
10 changed files
with
137 additions
and
14 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
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
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
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
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
File renamed without changes.
117 changes: 117 additions & 0 deletions
117
packages/report-schema/testResources/strict-report-v2.json
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,117 @@ | ||
{ | ||
"$schema": "../src/mutation-testing-report-schema.json", | ||
"schemaVersion": "2", | ||
"thresholds": { | ||
"high": 80, | ||
"low": 60 | ||
}, | ||
"config": { | ||
"custom": "config" | ||
}, | ||
"framework": { | ||
"name": "Stryker", | ||
"version": "4.3.0", | ||
"branding": { | ||
"homepageUrl": "https://stryker-mutator.io", | ||
"imageUrl": "https://stryker-mutator.io/img/stryker.svg" | ||
}, | ||
"dependencies": { | ||
"@stryker-mutator/jest-runner": "1.0.2", | ||
"nodejs": "12", | ||
"jest": "15.0.1" | ||
} | ||
}, | ||
"files": { | ||
"foo.js": { | ||
"language": "javascript", | ||
"source": "function add(a, b) {\n return a + b;\n}", | ||
"mutants": [ | ||
{ | ||
"id": "1", | ||
"mutatorName": "Arithmetic Operator", | ||
"location": { | ||
"start": { | ||
"line": 2, | ||
"column": 12 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 13 | ||
} | ||
}, | ||
"static": true, | ||
"status": "Survived", | ||
"description": "Changed + in -", | ||
"duration": 42, | ||
"replacement": "-", | ||
"coveredBy": ["test-2"] | ||
}, | ||
{ | ||
"id": "2", | ||
"mutatorName": "Block Statement", | ||
"location": { | ||
"start": { | ||
"line": 1, | ||
"column": 20 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 1 | ||
} | ||
}, | ||
"status": "Pending", | ||
"statusReason": "Expected 'foo' to be 'bar'", | ||
"coveredBy": ["test-1", "test-2", "test-3"], | ||
"killedBy": ["test-2"], | ||
"duration": 4, | ||
"replacement": "&&", | ||
"testsCompleted": 2 | ||
} | ||
] | ||
} | ||
}, | ||
"system": { | ||
"ci": true, | ||
"os": { | ||
"description": "Ubuntu 20.04.1 LTS", | ||
"platform": "linux", | ||
"version": "20.04.1" | ||
}, | ||
"cpu": { | ||
"baseClock": 2300, | ||
"logicalCores": 8, | ||
"model": "Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz" | ||
}, | ||
"ram": { | ||
"total": 320000 | ||
} | ||
}, | ||
"performance": { | ||
"setup": 200, | ||
"initialRun": 3231, | ||
"mutation": 60321 | ||
}, | ||
"projectRoot": "/home/user/projects/project-under-test", | ||
"testFiles": { | ||
"test/foo.spec.js": { | ||
"source": "describe('add', () => {})", | ||
"tests": [ | ||
{ | ||
"id": "test-1", | ||
"name": "foo should bar", | ||
"location": { | ||
"start": { "line": 4, "column": 1 }, | ||
"end": { "line": 6, "column": 1 } | ||
} | ||
}, | ||
{ | ||
"id": "test-2", | ||
"name": "baz should qux", | ||
"location": { | ||
"start": { "line": 8, "column": 1 } | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} |