@@ -2,13 +2,13 @@ package datadog.gradle.plugin.version
22
33import org.assertj.core.api.Assertions.assertThat
44import org.gradle.testkit.runner.GradleRunner
5+ import org.junit.jupiter.api.Disabled
56import org.junit.jupiter.api.Test
67import org.junit.jupiter.api.io.CleanupMode
78import org.junit.jupiter.api.io.TempDir
89import java.io.File
910import java.io.IOException
1011
11-
1212class TracerVersionIntegrationTest {
1313
1414 @Test
@@ -89,41 +89,25 @@ class TracerVersionIntegrationTest {
8989 projectDir,
9090 " 1.53.0-SNAPSHOT-DIRTY" ,
9191 beforeGradle = {
92- exec(projectDir, " git" , " init" , " --initial-branch" , " main" )
93- exec(projectDir,
" git" ,
" config" ,
" user.email" ,
" [email protected] " )
94- exec(projectDir, " git" , " config" , " user.name" , " Test" )
95- exec(projectDir, " git" , " add" , " -A" )
96- exec(projectDir, " git" , " commit" , " -m" , " A commit" )
97- exec(projectDir, " git" , " tag" , " v1.52.0" , " -m" , " " )
98-
99- File (projectDir, " settings.gradle.kts" ).appendText("""
100-
101- // uncommitted change this file,
102- """ .trimIndent())
103- }
104- )
105- }
92+ println (" Setting up git repository in $projectDir " )
93+ File (projectDir, " gradle.properties" ).writeText(
94+ """
95+ tracerVersion.dirtiness=true
96+ """ .trimIndent()
97+ )
10698
107- @Test
108- fun `should ignore dirtiness if CI env` (@TempDir projectDir : File ) { // CI patch some tracked files
109- assertTracerVersion(
110- projectDir,
111- " 1.52.0" ,
112- beforeGradle = {
11399 exec(projectDir, " git" , " init" , " --initial-branch" , " main" )
114100 exec(projectDir,
" git" ,
" config" ,
" user.email" ,
" [email protected] " )
115101 exec(projectDir, " git" , " config" , " user.name" , " Test" )
116102 exec(projectDir, " git" , " add" , " -A" )
117103 exec(projectDir, " git" , " commit" , " -m" , " A commit" )
118104 exec(projectDir, " git" , " tag" , " v1.52.0" , " -m" , " " )
119105
120- // dirty file ignored
121106 File (projectDir, " settings.gradle.kts" ).appendText("""
122107
123108 // uncommitted change this file,
124109 """ .trimIndent())
125- },
126- additionalEnv = mapOf (" CI" to " true" )
110+ }
127111 )
128112 }
129113
@@ -157,6 +141,12 @@ class TracerVersionIntegrationTest {
157141 projectDir,
158142 " 1.53.0-SNAPSHOT-DIRTY" ,
159143 beforeGradle = {
144+ File (projectDir, " gradle.properties" ).writeText(
145+ """
146+ tracerVersion.dirtiness=true
147+ """ .trimIndent()
148+ )
149+
160150 exec(projectDir, " git" , " init" , " --initial-branch" , " main" )
161151 exec(projectDir,
" git" ,
" config" ,
" user.email" ,
" [email protected] " )
162152 exec(projectDir, " git" , " config" , " user.name" , " Test" )
@@ -268,7 +258,6 @@ class TracerVersionIntegrationTest {
268258 expectedVersion : String ,
269259 beforeGradle : () -> Unit = {},
270260 workingDirectory : File = projectDir,
271- additionalEnv : Map <String , String > = mapOf("CI " to "false"),
272261 ) {
273262 File (projectDir, " settings.gradle.kts" ).writeText(
274263 """
@@ -296,7 +285,6 @@ class TracerVersionIntegrationTest {
296285 // .withGradleVersion(gradleVersion) // Use current gradle version
297286 .withPluginClasspath()
298287 .withArguments(" printVersion" , " --quiet" )
299- .withEnvironment(System .getenv() + additionalEnv)
300288 .withProjectDir(workingDirectory)
301289 // .withDebug(true)
302290 .build()
0 commit comments