-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #1382 TLDR; * fix NPE when `<testsuites/>` was deserialized (a workaround was needed though) * prevent XML results from being uploaded (for smart flank) if contain no results When an infrastructure error occurs result matrix is empty which leads to empty `JUnitTestResult`being created. Flank should not upload empty results to prevent old data corruption. Flank should also handle XML results with a self-closed root element (XML results for smart flank can be also uploaded manually). That could be easily fixed by changing `EMPTY_ELEMENT_AS_NULL` to false but flank uses this configuration quite extensively (ex skipped tag), so it's not an option. A small workaround was implemented: when the XML file is parsed flank checks if the string contains `<testsuites/>`. If does, an empty `JUnitTestResult` object is returned. ## Test Plan > How do we know the code works? Unfortunately, I did not come up with any way of testing it (no idea how to simulate infrastructure error). I covered it in unit test (with mocks) ## Checklist - [x] Documented - [x] Unit tested
- Loading branch information
1 parent
2d29824
commit 9d1ba8d
Showing
12 changed files
with
99 additions
and
8 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
3 changes: 3 additions & 0 deletions
3
test_runner/src/test/kotlin/ftl/fixtures/empty_result/.gitignore
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,3 @@ | ||
*.txt | ||
*.html | ||
*.csv |
2 changes: 2 additions & 0 deletions
2
test_runner/src/test/kotlin/ftl/fixtures/empty_result/JUnitReport.xml
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,2 @@ | ||
<?xml version='1.0' encoding='UTF-8' ?> | ||
<testsuites/> |
12 changes: 12 additions & 0 deletions
12
test_runner/src/test/kotlin/ftl/fixtures/empty_result/matrix_ids.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,12 @@ | ||
{ | ||
"matrix-xo22hroienrza": { | ||
"matrixId": "matrix-xo22hroienrza", | ||
"state": "FINISHED", | ||
"gcsPath": "test-lab-jwwvtzdh5d20w-yyju9fnudnpts/2018-09-09_00:38:10.110000_UQjK/shard_0", | ||
"webLink": "https://console.firebase.google.com/project/delta-essence-114723/testlab/histories/bh.58317d9cd7ab9ba2/matrices/6385582924491679444/executions/bs.bb41d8a3f63489be", | ||
"downloaded": false, | ||
"billableVirtualMinutes": 1, | ||
"billablePhysicalMinutes": 0, | ||
"outcome": "inconclusive" | ||
} | ||
} |
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