-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix missing junit report in legacy mode
- Loading branch information
1 parent
bff021a
commit 0229017
Showing
4 changed files
with
108 additions
and
1 deletion.
There are no files selected for viewing
92 changes: 92 additions & 0 deletions
92
integration_tests/src/test/kotlin/integration/LegacyResultIT.kt
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,92 @@ | ||
package integration | ||
|
||
import FlankCommand | ||
import com.google.common.truth.Truth | ||
import org.junit.Test | ||
import run | ||
import utils.CONFIGS_PATH | ||
import utils.FLANK_JAR_PATH | ||
import utils.androidRunCommands | ||
import utils.asOutputReport | ||
import utils.assertCostMatches | ||
import utils.assertExitCode | ||
import utils.assertTestCountMatches | ||
import utils.findTestDirectoryFromOutput | ||
import utils.firstTestSuiteOverview | ||
import utils.iosRunCommands | ||
import utils.json | ||
import utils.removeUnicode | ||
import utils.toJUnitXmlFile | ||
import utils.toOutputReportFile | ||
|
||
class LegacyResultIT { | ||
private val name = this::class.java.simpleName | ||
|
||
@Test | ||
fun androidLegacyJUnitResultTest() { | ||
val result = FlankCommand( | ||
flankPath = FLANK_JAR_PATH, | ||
ymlPath = "$CONFIGS_PATH/flank_android_single_legacy.yml", | ||
params = androidRunCommands | ||
).run( | ||
workingDirectory = "./", | ||
testSuite = name | ||
) | ||
|
||
assertExitCode(result, 0) | ||
|
||
val resOutput = result.output.removeUnicode() | ||
val resultDirectory = resOutput.findTestDirectoryFromOutput() | ||
Truth.assertThat(resultDirectory.toJUnitXmlFile().exists()).isTrue() | ||
|
||
val outputReport = resultDirectory.toOutputReportFile().json().asOutputReport() | ||
|
||
Truth.assertThat(outputReport.error).isEmpty() | ||
Truth.assertThat(outputReport.cost).isNotNull() | ||
|
||
outputReport.assertCostMatches() | ||
|
||
Truth.assertThat(outputReport.testResults.count()).isEqualTo(1) | ||
Truth.assertThat(outputReport.weblinks.count()).isEqualTo(1) | ||
|
||
val testSuiteOverview = outputReport.firstTestSuiteOverview | ||
|
||
testSuiteOverview.assertTestCountMatches( | ||
total = 2, | ||
skipped = 1 | ||
) | ||
} | ||
|
||
@Test | ||
fun iosLegacyJUnitResultTest() { | ||
val result = FlankCommand( | ||
flankPath = FLANK_JAR_PATH, | ||
ymlPath = "$CONFIGS_PATH/flank_ios_single_legacy.yml", | ||
params = iosRunCommands | ||
).run( | ||
workingDirectory = "./", | ||
testSuite = name | ||
) | ||
|
||
assertExitCode(result, 0) | ||
|
||
val resOutput = result.output.removeUnicode() | ||
val resultDirectory = resOutput.findTestDirectoryFromOutput() | ||
Truth.assertThat(resultDirectory.toJUnitXmlFile().exists()).isTrue() | ||
|
||
val outputReport = resultDirectory.toOutputReportFile().json().asOutputReport() | ||
|
||
Truth.assertThat(outputReport.error).isEmpty() | ||
Truth.assertThat(outputReport.cost).isNotNull() | ||
|
||
Truth.assertThat(outputReport.testResults.count()).isEqualTo(1) | ||
Truth.assertThat(outputReport.weblinks.count()).isEqualTo(1) | ||
|
||
val testSuiteOverview = outputReport.firstTestSuiteOverview | ||
|
||
testSuiteOverview.assertTestCountMatches( | ||
total = 17, | ||
skipped = 0 | ||
) | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
integration_tests/src/test/resources/cases/flank_android_single_legacy.yml
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,8 @@ | ||
gcloud: | ||
app: ../test_runner/src/test/kotlin/ftl/fixtures/tmp/apk/app-debug.apk | ||
test: ../test_runner/src/test/kotlin/ftl/fixtures/tmp/apk/app-single-success-debug-androidTest.apk | ||
|
||
flank: | ||
disable-sharding: true | ||
output-report: json | ||
legacy-junit-result: true |
7 changes: 7 additions & 0 deletions
7
integration_tests/src/test/resources/cases/flank_ios_single_legacy.yml
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,7 @@ | ||
gcloud: | ||
test: "../test_runner/src/test/kotlin/ftl/fixtures/tmp/ios/EarlGreyExample/EarlGreyExample.zip" | ||
xctestrun-file: "../test_runner/src/test/kotlin/ftl/fixtures/tmp/ios/EarlGreyExample/EarlGreyExampleSwiftTests.xctestrun" | ||
|
||
flank: | ||
output-report: json | ||
legacy-junit-result: true |
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