Skip to content

Run the README check and the scale test as test suite targets - #28

Merged
lhotari merged 5 commits into
mainfrom
readme-test
Sep 24, 2026
Merged

lhotari merged 5 commits into
mainfrom
readme-test

Conversation

@lhotari

@lhotari lhotari commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The README check gets its own task. The correlator's test task declared README.md as an input, because CommandLineTest.readmeMatchesParser checks 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.

  • readmeMatchesParser carries the readme tag, and test excludes it.
  • A new readmeTest task runs only that test. It is the only task whose input is the README, and check depends on it.

Extra test tasks are suite targets. Following the Gradle 9 upgrade guide's recommendation for adding extra Test tasks:

  • readmeTest is registered as a target of the test suite.
  • scaleTest is registered as a target of the integrationTest suite, where it used to be a plain Test task with testClassesDirs and classpath wired by hand.
  • Both get their suite's classes, runtime classpath and test framework, plus anything the build configures on every target. Each keeps only its tag filter and its own settings.

The correlator JAR leaves the integrationTest classpath. It was there 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 agent's classpath += files(agentJar) stays: its host-native tests load the native bundle from the JAR's META-INF/native resources.

check depends on the suites. Following the JVM Test Suite plugin guide, check now depends on the test and integrationTest suites instead of their default tasks, so every target of a suite runs with it. That makes the hand-written dependencies on readmeTest and scaleTest unnecessary. A dry run shows each module's check running the same test tasks as before.

packagedJarTest stays a plain Test task. Its classpath is deliberately the shaded JAR and the bare test libraries, without the suite's runtime classpath. The agent's containerIntegrationTest… tasks are a custom task type, not Test.

Verification

  • ./gradlew spotlessCheck :jonoffcpu-agent:check :jonoffcpu-correlator:check :jonoffcpu-jfr-converter:check passes. With --configuration-cache-problems=warn it reports no problems, and the second run reuses the configuration cache.
  • readmeTest runs exactly readmeMatchesParser, and scaleTest runs exactly retentionTracksDistinctStacksNotIntervals.
  • After a temporary README edit, :jonoffcpu-correlator:test, integrationTest and scaleTest stayed UP-TO-DATE. Only readmeTest reran, or came from the cache.

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.
@lhotari lhotari added the maintenance Build, CI, dependency and other maintenance changes label Sep 24, 2026
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.
@lhotari lhotari changed the title Check the README's option tables in a task of their own Run the README check and the scale test as test suite targets Sep 24, 2026
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.
@lhotari
lhotari merged commit 3f9a80c into main Sep 24, 2026
7 checks passed
@lhotari
lhotari deleted the readme-test branch September 24, 2026 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Build, CI, dependency and other maintenance changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant