Skip to content

Commit

Permalink
Sort exclusions. This helps with determinism on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
slinkydeveloper committed Aug 5, 2024
1 parent 570f057 commit 22baeda
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions src/main/kotlin/dev/restate/sdktesting/main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -151,16 +151,17 @@ Run test suite, executing the service as container.
val failures = report.failedTests
if (failures.isNotEmpty() || exclusions.isNotEmpty()) {
newExclusions[testSuite.name] =
failures
.mapNotNull { it.source.getOrNull() }
.mapNotNull {
when (it) {
is ClassSource -> it.className!!
is MethodSource -> it.className!!
else -> null
}
}
.distinct() + exclusions
(failures
.mapNotNull { it.source.getOrNull() }
.mapNotNull {
when (it) {
is ClassSource -> it.className!!
is MethodSource -> it.className!!
else -> null
}
}
.distinct() + exclusions)
.sorted()
}
if (failures.isNotEmpty()) {
newFailures = true
Expand All @@ -169,7 +170,7 @@ Run test suite, executing the service as container.

// Write out the exclusions file
FileOutputStream(testRunnerOptions.reportDir.resolve("exclusions.new.yaml").toFile()).use {
Yaml.default.encodeToStream(ExclusionsFile(newExclusions), it)
Yaml.default.encodeToStream(ExclusionsFile(newExclusions.toSortedMap()), it)
}

// Print final report
Expand Down

0 comments on commit 22baeda

Please sign in to comment.