Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ gradlePlugin {
"Adds source set and task for running integration tests separately from unit tests (standalone)"
implementationClass = "nebula.plugin.responsible.NebulaIntegTestStandalonePlugin"
tags.addAll("nebula", "project")
compatibility {
features {
configurationCache = true
}
}
}
}
}
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
package nebula.project

import nebula.test.dsl.*
import nebula.test.dsl.TestKitAssertions.assertThat
import org.gradle.testkit.runner.TaskOutcome
import org.junit.jupiter.api.io.TempDir
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.EnumSource
import java.io.File

internal class NebulaIntegTestStandalonePluginTest {
@TempDir
lateinit var projectDir: File

@ParameterizedTest
@EnumSource(SupportedGradleVersion::class)
fun test(gradle: SupportedGradleVersion) {
val runner = testProject(projectDir) {
properties {
buildCache(true)
configurationCache(true)
}
rootProject {
plugins {
id("java-library")
id("com.netflix.nebula.integtest-standalone")
}
repositories {
mavenCentral()
}
dependencies("""testImplementation("junit:junit:latest.release")""")
src {
sourceSet("integTest") {
junit4Test()
language("resources", "integTest.properties", "")
}
}
}
}

val checkResult = runner.run("check") {
withGradleVersion(gradle.version)
}
assertThat(checkResult)
.hasNoMutableStateWarnings()
.hasNoDeprecationWarnings()
assertThat(checkResult.task(":test"))
.hasOutcome(TaskOutcome.NO_SOURCE)
assertThat(checkResult.task(":integrationTest"))
.`as`("check does not depend on integrationTest")
.isNull()
val integrationTestResult = runner.run("integrationTest") {
withGradleVersion(gradle.version)
}
assertThat(integrationTestResult)
.hasNoMutableStateWarnings()
.hasNoDeprecationWarnings()
assertThat(integrationTestResult.task(":integrationTest"))
.`as`("check depends on integrationTest")
.hasOutcome(TaskOutcome.SUCCESS, TaskOutcome.FROM_CACHE)
assertThat(projectDir.resolve("build/classes/java/integTest/nebula/HelloWorldTest.class"))
.`as`("compiles integration test classes")
.exists()
assertThat(projectDir.resolve("build/resources/integTest/integTest.properties"))
.`as`("copies integTest resources")
.exists()
assertThat(projectDir.resolve("build/integTest-results/TEST-nebula.HelloWorldTest.xml"))
.`as`("produces integTest xml test report")
.exists()
assertThat(projectDir.resolve("build/reports/integTest/index.html"))
.`as`("produces integTest html test report")
.exists()
}
}
Loading