@@ -34,28 +34,32 @@ val integrationTestConfiguration = extensions.create<IntegrationTestExtension>("
3434configurations[integrationTest.implementationConfigurationName].extendsFrom(configurations.testImplementation.get())
3535configurations[integrationTest.runtimeOnlyConfigurationName].extendsFrom(configurations.testRuntimeOnly.get())
3636
37+ val sonarRuntimeVersion: String = System .getProperty(" sonar.runtimeVersion" , " LATEST_RELEASE" )
3738tasks.register<Test >(" integrationTest" ) {
3839 description = " Runs integration tests."
3940 group = " verification"
4041 inputs.dir(integrationTestConfiguration.testSources)
41- inputs.property(" SQ version" , System .getProperty( " sonar.runtimeVersion " , " LATEST_RELEASE " ) )
42+ inputs.property(" SQ version" , sonarRuntimeVersion )
4243 inputs.property(" keep SQ running" , System .getProperty(" keepSonarqubeRunning" , " false" ))
4344 useJUnitPlatform()
4445
4546 testClassesDirs = integrationTest.output.classesDirs
4647 classpath = configurations[integrationTest.runtimeClasspathConfigurationName] + integrationTest.output
4748
48- if (System .getProperty(" sonar.runtimeVersion" ) != null ) {
49- systemProperty(" sonar.runtimeVersion" , System .getProperty(" sonar.runtimeVersion" , " LATEST_RELEASE" ))
50- }
49+ systemProperty(" sonar.runtimeVersion" , sonarRuntimeVersion)
5150
52- if ( System .getProperty(" keepSonarqubeRunning" ) != null ) {
53- systemProperty(" keepSonarqubeRunning" , System .getProperty( " keepSonarqubeRunning " ) )
51+ System .getProperty(" keepSonarqubeRunning" )?. let {
52+ systemProperty(" keepSonarqubeRunning" , it )
5453 }
5554
5655 testLogging {
5756 // log the full stack trace (default is the 1st line of the stack trace)
5857 exceptionFormat = TestExceptionFormat .FULL
5958 events(STARTED , PASSED , SKIPPED , FAILED )
6059 }
60+
61+ outputs.upToDateWhen {
62+ // As the exact SQ version is not known at configuration time, we cannot know if the task is up-to-date
63+ false
64+ }
6165}
0 commit comments