Skip to content

Use absolute path for temporary directory in tests #52228

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

Merged
merged 2 commits into from
Feb 11, 2020
Merged
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 @@ -686,16 +686,13 @@ class BuildPlugin implements Plugin<Project> {
test.jvmArgs '-ea', '-esa'
}

// we use './temp' since this is per JVM and tests are forbidden from writing to CWD
test.systemProperties 'java.io.tmpdir': './temp',
'java.awt.headless': 'true',
test.systemProperties 'java.awt.headless': 'true',
'tests.gradle': 'true',
'tests.artifact': project.name,
'tests.task': test.path,
'tests.security.manager': 'true',
'jna.nosys': 'true'


// ignore changing test seed when build is passed -Dignore.tests.seed for cacheability experimentation
if (System.getProperty('ignore.tests.seed') != null) {
nonInputProperties.systemProperty('tests.seed', BuildParams.testSeed)
Expand All @@ -707,6 +704,8 @@ class BuildPlugin implements Plugin<Project> {
nonInputProperties.systemProperty('gradle.dist.lib', new File(project.class.location.toURI()).parent)
nonInputProperties.systemProperty('gradle.worker.jar', "${project.gradle.getGradleUserHomeDir()}/caches/${project.gradle.gradleVersion}/workerMain/gradle-worker.jar")
nonInputProperties.systemProperty('gradle.user.home', project.gradle.getGradleUserHomeDir())
// we use 'temp' relative to CWD since this is per JVM and tests are forbidden from writing to CWD
nonInputProperties.systemProperty('java.io.tmpdir', test.workingDir.toPath().resolve('temp'))

nonInputProperties.systemProperty('compiler.java', "${-> BuildParams.compilerJavaVersion.majorVersion}")

Expand Down