From 22baeda06521eab808bd06efd099a80331321b24 Mon Sep 17 00:00:00 2001 From: slinkydeveloper Date: Mon, 5 Aug 2024 10:51:59 +0200 Subject: [PATCH] Sort exclusions. This helps with determinism on CI --- .../kotlin/dev/restate/sdktesting/main.kt | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/main/kotlin/dev/restate/sdktesting/main.kt b/src/main/kotlin/dev/restate/sdktesting/main.kt index 14b56a0..7d22c94 100644 --- a/src/main/kotlin/dev/restate/sdktesting/main.kt +++ b/src/main/kotlin/dev/restate/sdktesting/main.kt @@ -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 @@ -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