Skip to content

Commit

Permalink
TS-38628 Enhance test verification for execution listener callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
Avanatiker committed Dec 14, 2024
1 parent b8e441f commit c7cf5ac
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import com.teamscale.test_impacted.engine.executor.SimpleTestDescriptor
import com.teamscale.test_impacted.test_descriptor.JUnitJupiterTestDescriptorResolver
import org.junit.platform.engine.EngineExecutionListener
import org.junit.platform.engine.UniqueId
import org.mockito.kotlin.*

/** Test setup where no test is impacted. */
internal class NoImpactedTestsTest : ImpactedTestEngineTestBase() {
Expand All @@ -30,7 +31,18 @@ internal class NoImpactedTestsTest : ImpactedTestEngineTestBase() {
override val engines = listOf(DummyEngine(testEngine1Root))
override val impactedTests = emptyList<PrioritizableTestCluster>()

override fun verifyCallbacks(executionListener: EngineExecutionListener) {}
override fun verifyCallbacks(executionListener: EngineExecutionListener) {
// Verify that the root container (engine) starts and finishes
verify(executionListener).executionStarted(testEngine1Root)
verify(executionListener).executionFinished(eq(testEngine1Root), any())

// Verify that each non-impacted test starts and finishes correctly
verify(executionListener).executionStarted(firstTestClass)
verify(executionListener).executionFinished(eq(firstTestClass), any())

verify(executionListener).executionStarted(nonImpactedTestCase1)
verify(executionListener).executionFinished(eq(nonImpactedTestCase1), any())
}

companion object {
private const val FIRST_TEST_CLASS = "FirstTestClass"
Expand Down

0 comments on commit c7cf5ac

Please sign in to comment.