-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(fix) Handle test results with very large XML attributes and record f…
…ailure timestamp
- Loading branch information
Showing
10 changed files
with
155 additions
and
23 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
14 changes: 12 additions & 2 deletions
14
server/parsing/junit-results-parser/src/main/java/projektor/parser/JUnitResultsParser.java
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
34 changes: 34 additions & 0 deletions
34
.../junit-results-parser/src/test/groovy/projektor/parser/JUnitResultsParserLargeSpec.groovy
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,34 @@ | ||
package projektor.parser | ||
|
||
import org.apache.commons.lang3.RandomStringUtils | ||
import projektor.parser.model.TestCase | ||
import projektor.parser.model.TestSuite | ||
import spock.lang.Specification | ||
import spock.lang.Subject | ||
|
||
class JUnitResultsParserLargeSpec extends Specification { | ||
@Subject | ||
JUnitResultsParser testResultsParser = new JUnitResultsParser() | ||
|
||
def "should be able to parse results with large XML attributes"() { | ||
given: | ||
String resultsXmlWithHugeAttribute = """<?xml version="1.0" encoding="UTF-8"?> | ||
<testsuite name="projektor.example.spock.PassingSpec" tests="1" skipped="0" failures="0" errors="0" timestamp="2019-10-01T13:15:45" hostname="Craigs-MacBook-Pro.local" time="0.002"> | ||
<properties/> | ||
<testcase name="long-name-${RandomStringUtils.randomAlphabetic(1_000_000)}" classname="projektor.example.spock.PassingSpec" time="0.002"/> | ||
<system-out><![CDATA[]]></system-out> | ||
<system-err><![CDATA[]]></system-err> | ||
</testsuite> | ||
""" | ||
|
||
when: | ||
TestSuite testSuite = testResultsParser.parseTestSuite(resultsXmlWithHugeAttribute) | ||
|
||
then: | ||
testSuite.testCases.size() == 1 | ||
|
||
TestCase testCase = testSuite.testCases[0] | ||
|
||
testCase.name.startsWith("long-name-") | ||
} | ||
} |
16 changes: 11 additions & 5 deletions
16
...se-schema/src/main/java/projektor/database/generated/tables/ResultsProcessingFailure.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
...a/src/main/java/projektor/database/generated/tables/daos/ResultsProcessingFailureDao.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
32 changes: 27 additions & 5 deletions
32
...ema/src/main/java/projektor/database/generated/tables/pojos/ResultsProcessingFailure.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
62 changes: 51 additions & 11 deletions
62
...main/java/projektor/database/generated/tables/records/ResultsProcessingFailureRecord.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
...base-schema/src/main/resources/db/migration/V22__AddResultsProcessingFailureTimestamp.sql
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 @@ | ||
ALTER TABLE results_processing_failure ADD COLUMN created_timestamp TIMESTAMP; |
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