Repository navigation
Run the README check and the scale test as test suite targets - #28
Merged
Merged
Conversation
The correlator's unit test task declared README.md as an input because one test checks the README's option tables against the parser, so any README edit, such as the release workflow's version update, reran the whole unit suite. That test now carries the readme tag and runs in its own readmeTest task, the only one whose input is the README; check depends on it.
Both ran their suite's own test classes on its own runtime classpath, wired by hand onto plain Test tasks. As targets of the test and integrationTest suites they get the suite's classes, classpath and test framework, and whatever the build configures on every target; each keeps only its tag filter and its own settings. packagedJarTest stays a plain Test task: its classpath is the shaded JAR without the suite's runtime classpath, which is what it proves.
The integration tests got the shaded correlator JAR for the public API check, which now runs in packagedJarTest with the JAR on its own classpath, and for the removed compatibility JFR test. No remaining integration test uses it.
The JVM Test Suite plugin's documented wiring is check depending on the suite, which builds every target of it. check depended on the test and integrationTest tasks, so each extra target needed its own dependsOn; depending on both suites runs readmeTest and scaleTest without one.
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.
Summary
The README check gets its own task. The correlator's
testtask declaredREADME.mdas an input, becauseCommandLineTest.readmeMatchesParserchecks the README's option tables against the CLI parser. Any README edit therefore reran the whole correlator unit suite, about 50 seconds per CI job. That includes the release workflow's version update: see the v0.6.0 README update run.readmeMatchesParsercarries thereadmetag, andtestexcludes it.readmeTesttask runs only that test. It is the only task whose input is the README, andcheckdepends on it.Extra test tasks are suite targets. Following the Gradle 9 upgrade guide's recommendation for adding extra
Testtasks:readmeTestis registered as a target of thetestsuite.scaleTestis registered as a target of theintegrationTestsuite, where it used to be a plainTesttask withtestClassesDirsandclasspathwired by hand.The correlator JAR leaves the
integrationTestclasspath. It was there for the public API check, which now runs inpackagedJarTestwith the JAR on its own classpath, and for the removed compatibility JFR test. No remaining integration test uses it. The agent'sclasspath += files(agentJar)stays: its host-native tests load the native bundle from the JAR'sMETA-INF/nativeresources.checkdepends on the suites. Following the JVM Test Suite plugin guide,checknow depends on thetestandintegrationTestsuites instead of their default tasks, so every target of a suite runs with it. That makes the hand-written dependencies onreadmeTestandscaleTestunnecessary. A dry run shows each module'scheckrunning the same test tasks as before.packagedJarTeststays a plainTesttask. Its classpath is deliberately the shaded JAR and the bare test libraries, without the suite's runtime classpath. The agent'scontainerIntegrationTest…tasks are a custom task type, notTest.Verification
./gradlew spotlessCheck :jonoffcpu-agent:check :jonoffcpu-correlator:check :jonoffcpu-jfr-converter:checkpasses. With--configuration-cache-problems=warnit reports no problems, and the second run reuses the configuration cache.readmeTestruns exactlyreadmeMatchesParser, andscaleTestruns exactlyretentionTracksDistinctStacksNotIntervals.:jonoffcpu-correlator:test,integrationTestandscaleTeststayedUP-TO-DATE. OnlyreadmeTestreran, or came from the cache.