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

Enable configuration cache in tests #152

Merged
merged 1 commit into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
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 @@ -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
Loading