Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't add repository to buildscript for base class tests
- The base class tests depend upon CC's eager resolution failing due to a lack of repositories definied. So if we define them in the setup method, those builds succeed, when expected to fail, thus failing tests. - Need to specific repo in every new test then.
- Loading branch information
Showing
1 changed file
with
18 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,20 +30,26 @@ class CheckstylePluginIntegrationTest extends WellBehavedPluginTest { | |
return "check" | ||
} | ||
|
||
/** | ||
* To ensure the plugins fails (as expected) with configuration cache, do NOT add a repository to the build here, | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
tresat
Author
Member
|
||
* the tests in the base class are relying on a failure during eager dependency resolution with CC. | ||
*/ | ||
def setup() { | ||
buildFile << """ | ||
apply plugin: 'groovy' | ||
${mavenCentralRepository()} | ||
""" | ||
} | ||
|
||
|
||
@Issue("https://github.com/gradle/gradle/issues/21301") | ||
def "can pass a URL in configProperties"() { | ||
given: | ||
buildFile """ | ||
apply plugin: 'checkstyle' | ||
dependencies { implementation localGroovy() } | ||
${mavenCentralRepository()} | ||
dependencies { implementation localGroovy() } | ||
checkstyle { | ||
|
@@ -69,6 +75,8 @@ class CheckstylePluginIntegrationTest extends WellBehavedPluginTest { | |
buildFile """ | ||
apply plugin: 'checkstyle' | ||
${mavenCentralRepository()} | ||
checkstyle { | ||
enableExternalDtdLoad = true | ||
} | ||
|
@@ -95,6 +103,8 @@ class CheckstylePluginIntegrationTest extends WellBehavedPluginTest { | |
buildFile """ | ||
apply plugin: 'checkstyle' | ||
${mavenCentralRepository()} | ||
tasks.withType(Checkstyle).configureEach { | ||
enableExternalDtdLoad = true | ||
} | ||
|
@@ -121,6 +131,8 @@ class CheckstylePluginIntegrationTest extends WellBehavedPluginTest { | |
buildFile """ | ||
apply plugin: 'checkstyle' | ||
${mavenCentralRepository()} | ||
checkstyle { | ||
enableExternalDtdLoad = false | ||
} | ||
|
@@ -151,6 +163,8 @@ class CheckstylePluginIntegrationTest extends WellBehavedPluginTest { | |
buildFile """ | ||
apply plugin: 'checkstyle' | ||
${mavenCentralRepository()} | ||
checkstyle { | ||
enableExternalDtdLoad = false | ||
} | ||
|
@@ -172,6 +186,8 @@ class CheckstylePluginIntegrationTest extends WellBehavedPluginTest { | |
def "enable_external_dtd_load feature NOT enabled by default"() { | ||
given:buildFile """ | ||
apply plugin: 'checkstyle' | ||
${mavenCentralRepository()} | ||
""" | ||
|
||
file('src/main/java/org/sample/MyClass.java') << multilineJavaClass() | ||
|
This is fine, but just to clarify, so would actually remove the expectation for a build failure under CC for tests in this class (see test cases in super class). We do want to be able to run test cases successfully under CC, and adding a repo in the config is a common fix.