Skip to content

Commit

Permalink
Merge pull request #20128 Ensure headless status in test
Browse files Browse the repository at this point in the history
  • Loading branch information
bot-gradle committed Mar 9, 2022
2 parents 396837b + aa4235c commit 36dc525
Showing 1 changed file with 5 additions and 4 deletions.
Expand Up @@ -406,7 +406,8 @@ class UndeclaredBuildInputsIntegrationTest extends AbstractConfigurationCacheInt
@Issue("https://github.com/gradle/gradle/issues/19710")
def "modification of allowed properties does not invalidate cache"() {
buildFile("""
System.setProperty("java.awt.headless", "true")
def oldValue = System.setProperty("java.awt.headless", "true")
println("previous value = \$oldValue")
// Attempt to capture the modified property value.
println("configuration time value=\${System.getProperty("java.awt.headless")}")
Expand All @@ -420,20 +421,20 @@ class UndeclaredBuildInputsIntegrationTest extends AbstractConfigurationCacheInt
def configurationCache = newConfigurationCacheFixture()

when:
configurationCacheRun("printProperty")
configurationCacheRun("-Djava.awt.headless=false", "printProperty")

then:
configurationCache.assertStateStored()
outputContains("configuration time value=true")
outputContains("execution time value=true")

when:
configurationCacheRun("printProperty")
configurationCacheRun("-Djava.awt.headless=false", "printProperty")

then:
configurationCache.assertStateLoaded()
// TODO(https://github.com/gradle/gradle/issues/18432) This should be changed to "true".
outputContains("execution time value=null")
outputContains("execution time value=false")
}

def "reports build logic reading environment variables with getenv(String) using GString parameters"() {
Expand Down

0 comments on commit 36dc525

Please sign in to comment.