Skip to content

Commit cfedb49

Browse files
Process junit xml even when full junit is not enabled (Flank#935)
* Process junit xml even when full junit is not enabled * Update release notes Co-authored-by: bootstraponline <[email protected]>
1 parent a3965db commit cfedb49

File tree

7 files changed

+34
-5
lines changed

7 files changed

+34
-5
lines changed

contributing.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Run `./gradlew check` to fix lint issues
3333

3434
## Adding new gcloud property common to iOS and Android
3535

36-
- Add property to `GcloudYml` and update `keys`
36+
- Add property to `GcloudYml` and update `keys` in config files
3737
- Update `IArgs` with new property
3838
- Update `AndroidArgs` to reference the propery and update `toString`
3939
- Update `IosArgs` to reference the propery and `toString`

release_notes.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
- [#950](https://github.com/Flank/flank/pull/950) Fix crash when --legacy-junit-result set. ([adamfilipow92](https://github.com/adamfilipow92))
44
- [#948](https://github.com/Flank/flank/pull/948) Increment retry tries and change sync tag for jfrogSync. ([piotradamczyk5](https://github.com/piotradamczyk5))
55
- [#946](https://github.com/Flank/flank/pull/946) Added tests for flank scripts. ([piotradamczyk5](https://github.com/piotradamczyk5))
6-
-
6+
- [#935](https://github.com/Flank/flank/pull/935) Process junit xml even when full junit is not enabled. ([kozaxinan](https://github.com/kozaxinan))
77
-
88
-
99

test_runner/src/main/kotlin/ftl/config/common/CommonFlankConfig.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ data class CommonFlankConfig @JsonIgnore constructor(
161161
"ignore-failed-tests",
162162
"keep-file-path",
163163
"output-style",
164-
"disable-results-upload"
164+
"disable-results-upload",
165+
"full-junit-result"
165166
)
166167

167168
const val defaultLocalResultsDir = "results"

test_runner/src/main/kotlin/ftl/reports/util/ReportManager.kt

+1
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ object ReportManager {
115115
when {
116116
args.fullJUnitResult -> processFullJunitResult(args, matrices, testShardChunks)
117117
args.useLegacyJUnitResult -> processJunitXml(testSuite, args, testShardChunks)
118+
else -> processJunitXml(testSuite, args, testShardChunks)
118119
}
119120
matrices.validateMatrices(args.ignoreFailedTests)
120121
}

test_runner/src/test/kotlin/ftl/fixtures/flank.ios.yml

+1
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ flank:
1818
num-test-runs: 1
1919
run-timeout: 60m
2020
output-style: single
21+
full-junit-result: false

test_runner/src/test/kotlin/ftl/fixtures/flank.local.yml

+1
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@ flank:
3030
num-test-runs: 1
3131
run-timeout: 60m
3232
output-style: single
33+
full-junit-result: false

test_runner/src/test/kotlin/ftl/reports/utils/ReportManagerTest.kt

+27-2
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,31 @@ class ReportManagerTest {
8888
verify { GcStorage.uploadJunitXml(junitTestResult!!, mockArgs) }
8989
}
9090

91+
@Test
92+
fun `uploadJunitXml should be called when legacy junit disabled`() {
93+
val matrix = matrixPathToObj("./src/test/kotlin/ftl/fixtures/success_result", AndroidArgs.default())
94+
val mockArgs = prepareMockAndroidArgs()
95+
every { mockArgs.useLegacyJUnitResult } returns false
96+
every { mockArgs.project } returns "projecId"
97+
98+
val junitTestResult = ReportManager.processXmlFromFile(matrix, mockArgs, ::parseOneSuiteXml)
99+
ReportManager.generate(matrix, mockArgs, emptyList())
100+
verify { GcStorage.uploadJunitXml(junitTestResult!!, mockArgs) }
101+
}
102+
103+
@Test
104+
fun `uploadJunitXml should be called when full junit enabled`() {
105+
val matrix = matrixPathToObj("./src/test/kotlin/ftl/fixtures/success_result", AndroidArgs.default())
106+
val mockArgs = prepareMockAndroidArgs()
107+
every { mockArgs.useLegacyJUnitResult } returns false
108+
every { mockArgs.fullJUnitResult } returns true
109+
every { mockArgs.project } returns "projecId"
110+
111+
val junitTestResult = ReportManager.processXmlFromFile(matrix, mockArgs, ::parseOneSuiteXml)
112+
ReportManager.generate(matrix, mockArgs, emptyList())
113+
verify { GcStorage.uploadJunitXml(junitTestResult!!, mockArgs) }
114+
}
115+
91116
@Test
92117
fun `uploadResults should be called`() {
93118
val matrix = matrixPathToObj("./src/test/kotlin/ftl/fixtures/success_result", AndroidArgs.default())
@@ -106,7 +131,7 @@ class ReportManagerTest {
106131
}
107132

108133
@Test
109-
fun `uploadResults should't be called when disable-results-upload set`() {
134+
fun `uploadResults shouldn't be called when disable-results-upload set`() {
110135
val matrix = matrixPathToObj("./src/test/kotlin/ftl/fixtures/success_result", AndroidArgs.default())
111136
val mockArgs = prepareMockAndroidArgs()
112137
every { mockArgs.disableResultsUpload } returns true
@@ -125,7 +150,7 @@ class ReportManagerTest {
125150
}
126151

127152
@Test
128-
fun `uploadResults with FullJUnit should't be called`() {
153+
fun `uploadResults without FullJUnit shouldn't be called`() {
129154
val matrix = matrixPathToObj("./src/test/kotlin/ftl/fixtures/success_result", AndroidArgs.default())
130155
val mockArgs = prepareMockAndroidArgs()
131156
mockkObject(GcStorage) {

0 commit comments

Comments
 (0)