Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: delete test fixtures after test run. #1315

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,20 @@ abstract class AbstractFunctionalSpec extends Specification {
* <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>
*/
private static boolean isCi = System.getenv("CI") == "true"

// def cleanup() {
// // Delete fixtures on CI to prevent disk space growing out of bounds
// if (gradleProject != null && isCi) {
// try {
// gradleProject.rootDir.deleteDir()
// } catch (Throwable t) {
// }
// }
// }

def cleanup() {
// Delete fixtures on CI to prevent disk space growing out of bounds
if (gradleProject != null && isCi) {
def dir = gradleProject.rootDir
try {
println("Deleting $dir...")
dir.deleteDir()
} catch (Throwable t) {
System.err.println("Error deleting $dir: ${t.localizedMessage}")
t.printStackTrace()
}
}
}

protected static Boolean quick() {
return System.getProperty('com.autonomousapps.quick').toBoolean()
Expand Down
Loading