From 2c58ab9e9773bff9351107240ceb7423b4ea4c9b Mon Sep 17 00:00:00 2001 From: Florian Dreier Date: Fri, 13 Dec 2024 12:00:35 +0100 Subject: [PATCH] TS-38628 Fix null partition --- .../test_impacted/test_descriptor/TestDescriptorUtils.kt | 2 +- .../test_impacted/engine/ImpactedTestEngineTestBase.kt | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/impacted-test-engine/src/main/kotlin/com/teamscale/test_impacted/test_descriptor/TestDescriptorUtils.kt b/impacted-test-engine/src/main/kotlin/com/teamscale/test_impacted/test_descriptor/TestDescriptorUtils.kt index 032f8769..bd57619a 100644 --- a/impacted-test-engine/src/main/kotlin/com/teamscale/test_impacted/test_descriptor/TestDescriptorUtils.kt +++ b/impacted-test-engine/src/main/kotlin/com/teamscale/test_impacted/test_descriptor/TestDescriptorUtils.kt @@ -99,7 +99,7 @@ object TestDescriptorUtils { @JvmStatic fun getAvailableTests( rootTestDescriptor: TestDescriptor, - partition: String? + partition: String ): AvailableTests { val availableTests = AvailableTests() diff --git a/impacted-test-engine/src/test/kotlin/com/teamscale/test_impacted/engine/ImpactedTestEngineTestBase.kt b/impacted-test-engine/src/test/kotlin/com/teamscale/test_impacted/engine/ImpactedTestEngineTestBase.kt index cf2373d1..10559a08 100644 --- a/impacted-test-engine/src/test/kotlin/com/teamscale/test_impacted/engine/ImpactedTestEngineTestBase.kt +++ b/impacted-test-engine/src/test/kotlin/com/teamscale/test_impacted/engine/ImpactedTestEngineTestBase.kt @@ -22,6 +22,11 @@ abstract class ImpactedTestEngineTestBase { @Test fun testEngineExecution() { + whenever(impactedTestsProvider.getImpactedTestsFromTeamscale(any())) + .thenReturn(impactedTests) + whenever(impactedTestsProvider.partition) + .thenReturn("partition") + val testEngine = createInternalImpactedTestEngine(engines) val engineDescriptor = testEngine @@ -33,8 +38,6 @@ abstract class ImpactedTestEngineTestBase { .thenReturn(executionListener) whenever(executionRequest.rootTestDescriptor) .thenReturn(engineDescriptor) - whenever(impactedTestsProvider.getImpactedTestsFromTeamscale(any())) - .thenReturn(impactedTests) testEngine.execute(executionRequest)