Open
Conversation
Contributor
Author
|
I want to test this PR a bit more before giving it the green light for review. |
- Enhanced testSingle to support native IDE unit test execution - Removed logic for selecting test cases via the `testCaseToRun` property - Refactored test code to eliminate redundancy - Added inputs.dir for test/data and webapp to support incremental builds - Fixed testImplementation to extend from setupImplementation This change enables native IDE test execution and simplifies the build logic.
To preserve backward compatibility, this change restores the logic for selecting a test case via the `testCaseToRun` property.
57eea8a to
7e654dd
Compare
Contributor
Author
|
I have split this PR into two commits to allow selectively removing the old selection logic based on the non-standard |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR standardizes unit test execution while preserving backward compatibility and enabling native IDE integration.
Changes:
testSingle:--tests(default convention in Gradle).TestCmsSystemInfo*when no explicit property or filter is provided.-PtestCaseToRun=<TestClass>property, emitting a deprecation warning but functioning exactly as before.testtask: Always executesorg.opencms.test.AllTestsfor backward-compatible CI behavior.testImplementationto extendsetupImplementationfor correct classpath.Usage:
Verification:
The following validations were performed to ensure parity, backward compatibility, and IDE integration:
./gradlew testSingle(without arguments) executesTestCmsSystemInfo*as before../gradlew testexecutesorg.opencms.test.AllTests, maintaining consistent CI behavior.testtask with native--testsfiltering without conflicts (See notice below)../gradlew testSingle --tests <ClassName>and./gradlew testSingle --tests <ClassName.methodName>correctly override the default and run only the specified tests (See notice below).Notice on Gradle Test Filtering and JUnit 3 Suites
When using legacy JUnit 3 tests that implement a
public static Test suite()method, Gradle's--tests Class.methodfiltering does not apply at the method level as one might expect. In this case, JUnit executes exactly the tests returned by the suite (typically the whole test class), which overrides Gradle's method-level selection. This is expected behavior of JUnit 3's suite-based execution model, not a Gradle bug. Tests without asuite()method use default discovery and therefore support method-level filtering correctly.