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
Accessing test options no longer warns, but locks in test framework selection #21750
Conversation
subprojects/testing-jvm/src/integTest/groovy/org/gradle/testing/TestTaskIntegrationTest.groovy
Outdated
Show resolved
Hide resolved
subprojects/testing-jvm/src/main/java/org/gradle/api/tasks/testing/Test.java
Outdated
Show resolved
Hide resolved
Nice catch. Yes, I'll remove that map for a (very minor) optimization. |
…amework after options are already set - Also provide each test framework with a display name property for user-facing references.
… set is blocked elsewhere
subprojects/testing-jvm/src/integTest/groovy/org/gradle/testing/TestTaskIntegrationTest.groovy
Outdated
Show resolved
Hide resolved
subprojects/testing-jvm/src/main/java/org/gradle/api/tasks/testing/Test.java
Show resolved
Hide resolved
subprojects/testing-jvm/src/main/java/org/gradle/api/tasks/testing/Test.java
Show resolved
Hide resolved
- Add comment explaining why. - Add tests to ensure behavior remains correct.
…accessed; check this when changing framework in a suite - We need to check not just when changing the test framework within a test task, but when changing the test framework for a suite if the associated test tasks for that suite have had options accessed. Otherwise, the test task will silently continue to use the options and framework first configured without switching to the new ones. - Create new test class to demonstrate misconfigurations of options.
- Consolidate options-related tests.
I think I’ve now covered all the cases where you could cause issues by changing the test framework after setting options. This ended up being a little more complex than we had anticipated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call on adding all the new tests. Mostly just nitpicks here and there but LGTM
...ojects/testing-jvm/src/integTest/groovy/org/gradle/testing/TestOptionsIntegrationSpec.groovy
Outdated
Show resolved
Hide resolved
...ojects/testing-jvm/src/integTest/groovy/org/gradle/testing/TestOptionsIntegrationSpec.groovy
Outdated
Show resolved
Hide resolved
...ojects/testing-jvm/src/integTest/groovy/org/gradle/testing/TestOptionsIntegrationSpec.groovy
Outdated
Show resolved
Hide resolved
...grationSpec/reExecutesWhenPropertyIsChanged/src/integTest/java/org/gradle/SomeTestClass.java
Show resolved
Hide resolved
...ting-jvm/src/integTest/groovy/org/gradle/testing/testsuites/TestSuitesIntegrationTest.groovy
Outdated
Show resolved
Hide resolved
...ting-jvm/src/integTest/groovy/org/gradle/testing/junit/JUnitCategoriesIntegrationSpec.groovy
Outdated
Show resolved
Hide resolved
subprojects/testing-jvm/src/main/java/org/gradle/api/tasks/testing/Test.java
Show resolved
Hide resolved
subprojects/plugins/src/main/java/org/gradle/api/plugins/jvm/internal/DefaultJvmTestSuite.java
Outdated
Show resolved
Hide resolved
- Remove margin bar in multiline strings. - Make naming of migrated method consistent. - Remove extraneous comments.
…ite in error message if attempt fails due to test options already being accessed
@bot-gradle test this |
OK, I've already triggered the following builds for you: |
# Conflicts: # subprojects/plugins/src/main/java/org/gradle/api/plugins/jvm/internal/DefaultJvmTestSuite.java # subprojects/testing-jvm/src/main/java/org/gradle/api/internal/tasks/testing/TestFramework.java # subprojects/testing-jvm/src/main/java/org/gradle/api/internal/tasks/testing/junit/JUnitTestFramework.java # subprojects/testing-jvm/src/main/java/org/gradle/api/internal/tasks/testing/junitplatform/JUnitPlatformTestFramework.java # subprojects/testing-jvm/src/main/java/org/gradle/api/internal/tasks/testing/testng/TestNGTestFramework.java
@bot-gradle test this |
OK, I've already triggered the following builds for you: |
Fixes #21747
This undoes #19058 for Gradle 8.0.