Skip to content

Commit

Permalink
Enable configuration cache in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rpalcolea committed Nov 13, 2023
1 parent 2792526 commit 26d1677
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ import nebula.test.IntegrationTestKitSpec

abstract class AbstractIntegrationTestKitSpec extends IntegrationTestKitSpec {
def setup() {

// Enable configuration cache :)
new File(projectDir, 'gradle.properties') << '''org.gradle.configuration-cache=true'''.stripIndent()
}


void disableConfigurationCache() {
def propertiesFile = new File(projectDir, 'gradle.properties')
if(propertiesFile.exists()) {
propertiesFile.delete()
}
propertiesFile.createNewFile()
propertiesFile << '''org.gradle.configuration-cache=false'''.stripIndent()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,9 @@ class AlignRulesPluginInteractionSpec extends AbstractIntegrationTestKitSpec {

@Unroll
def 'dependency-lock plugin applied after resolution-rules plugin with non-locked resolution rules - fail due to dependency lock state is out of date '() {
// This disables configuration cache because dependency verifier is not compatible yet
// TODO: change it once dependency verifier is compatible with configuration cache
disableConfigurationCache()
// note: this is a more unusual case. Typically resolution rules are distributed like a library, version controlled, and locked like other dependencies
def (GradleDependencyGenerator mavenrepo, File rulesJsonFile) = dependencyLockAlignInteractionSetupWithUnlockedResolutionRulesConfiguration()
buildFile << """\
Expand Down Expand Up @@ -1136,6 +1139,9 @@ class AlignRulesPluginInteractionSpec extends AbstractIntegrationTestKitSpec {

@Unroll
def 'dependency-lock plugin applied before resolution-rules plugin with non-locked resolution rules - fail due to dependency lock state is out of date '() {
// This disables configuration cache because dependency verifier is not compatible yet
// TODO: change it once dependency verifier is compatible with configuration cache
disableConfigurationCache()
// note: this is a more unusual case. Typically resolution rules are distributed like a library, version controlled, and locked like other dependencies
def (GradleDependencyGenerator mavenrepo, File rulesJsonFile) = dependencyLockAlignInteractionSetupWithUnlockedResolutionRulesConfiguration()
buildFile << """\
Expand Down

0 comments on commit 26d1677

Please sign in to comment.