Skip to content

Commit

Permalink
fix(tests): Introduce junit5 vintage engine for running junit4 test c…
Browse files Browse the repository at this point in the history
…ases over junit5 in rosco (#958)

Spring boot 2.4.x removed JUnit5 vintage engine from spring-boot-starter-test.
[https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.4-Release-Notes#junit-5s-vintage-engine-removed-from-spring-boot-starter-test]
It is required for executing junit4 based test cases in rosco.
So, introducing junit-vintage-engine dependency in build.gradle, using testRuntimeOnly() as suggested in section 3.1 of https://junit.org/junit5/docs/5.6.2/user-guide/index.pdf

After applying this fix, coverage increased from 217 to 252 test case executions.
  • Loading branch information
j-sandy authored Mar 2, 2023
1 parent ac1695c commit 368f8e5
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ subprojects {
annotationProcessor("org.springframework.boot:spring-boot-configuration-processor")
testAnnotationProcessor platform("io.spinnaker.kork:kork-bom:$korkVersion")
testAnnotationProcessor "org.projectlombok:lombok"
testRuntimeOnly "org.junit.vintage:junit-vintage-engine"
}

test {
testLogging {
exceptionFormat = 'full'
}
useJUnitPlatform()
}
}

Expand Down
4 changes: 0 additions & 4 deletions rosco-manifests/rosco-manifests.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,3 @@ dependencies {
testImplementation "org.mockito:mockito-core"
testImplementation "org.spockframework:spock-core"
}

test {
useJUnitPlatform()
}
4 changes: 0 additions & 4 deletions rosco-web/rosco-web.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ dependencies {
testImplementation "org.objenesis:objenesis"
}

test {
useJUnitPlatform()
}

ospackage {
from('../halconfig/packer') {
into '/opt/rosco/config/packer'
Expand Down

0 comments on commit 368f8e5

Please sign in to comment.