Skip to content

Commit 247e012

Browse files
test: cleanup fixtures after each test run on CI.
1 parent eec2cb1 commit 247e012

File tree

2 files changed

+21
-7
lines changed

2 files changed

+21
-7
lines changed

src/functionalTest/groovy/com/autonomousapps/AbstractFunctionalSpec.groovy

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ abstract class AbstractFunctionalSpec extends Specification {
2020
protected static final GRADLE_8_4 = GradleVersion.version('8.4')
2121
protected static final GRADLE_8_9 = GradleVersion.version('8.9')
2222
protected static final GRADLE_8_10 = GradleVersion.version('8.10.2')
23-
protected static final GRADLE_8_11 = GradleVersion.version('8.11-rc-1')
23+
protected static final GRADLE_8_11 = GradleVersion.version('8.11')
2424

2525
protected static final GRADLE_LATEST = GRADLE_8_10
2626

@@ -29,11 +29,26 @@ abstract class AbstractFunctionalSpec extends Specification {
2929
protected static final SUPPORTED_GRADLE_VERSIONS = [
3030
GradleVersions.minGradleVersion,
3131
GRADLE_LATEST,
32-
// GRADLE_8_11,
32+
//GRADLE_8_11,
3333
]
3434

3535
protected GradleProject gradleProject = null
3636

37+
/**
38+
* <a href="https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables">Default environment variables on Github Actions</a>
39+
*/
40+
private static boolean isCi = System.getenv("CI") == "true"
41+
42+
def cleanup() {
43+
// Delete fixtures on CI to prevent disk space growing out of bounds
44+
if (gradleProject != null && isCi) {
45+
try {
46+
gradleProject.rootDir.deleteDir()
47+
} catch (Throwable t) {
48+
}
49+
}
50+
}
51+
3752
protected static Boolean quick() {
3853
return System.getProperty('com.autonomousapps.quick').toBoolean()
3954
}

src/functionalTest/groovy/com/autonomousapps/jvm/DuplicateClasspathSpec.groovy

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.autonomousapps.jvm
22

3-
import com.autonomousapps.Flags
43
import com.autonomousapps.jvm.projects.BinaryIncompatibilityProject
54
import com.autonomousapps.jvm.projects.DuplicateClasspathProject
65
import com.autonomousapps.utils.Colors
@@ -53,11 +52,11 @@ final class DuplicateClasspathSpec extends AbstractJvmSpec {
5352
5453
Source set: main
5554
\\--- compile classpath
56-
+--- com/example/producer/Producer$Inner.class is provided by multiple dependencies: [:producer-1, :producer-2]
57-
\\--- com/example/producer/Producer.class is provided by multiple dependencies: [:producer-1, :producer-2]
55+
+--- com/example/producer/Producer is provided by multiple dependencies: [:producer-1, :producer-2]
56+
\\--- com/example/producer/Producer$Inner is provided by multiple dependencies: [:producer-1, :producer-2]
5857
\\--- runtime classpath
59-
+--- com/example/producer/Producer$Inner.class is provided by multiple dependencies: [:producer-1, :producer-2]
60-
\\--- com/example/producer/Producer.class is provided by multiple dependencies: [:producer-1, :producer-2]'''
58+
+--- com/example/producer/Producer is provided by multiple dependencies: [:producer-1, :producer-2]
59+
\\--- com/example/producer/Producer$Inner is provided by multiple dependencies: [:producer-1, :producer-2]'''
6160
.stripIndent()
6261
)
6362

0 commit comments

Comments
 (0)