docs: add build & test guidance for coding agents (AGENTS.md)#2
docs: add build & test guidance for coding agents (AGENTS.md)#2milamberspace wants to merge 2 commits into
Conversation
Document the JMeter build/test essentials so any coding agent knows how to build, run, and test the project — independent of any agent framework: - core gradlew tasks (build, test, check, runGui, createDist, style) - JDK selection for build and tests via -PjdkBuildVersion / -PjdkTestVersion / -PjdkTestVendor (the test-JDK flag), with an example - dependency-checksum refresh, coverage, and RAT tasks - pointer to the CI matrix and the Error Prone job Addresses the dev@ suggestion to give agents JMeter-specific build context (e.g. how to trigger tests under a specific JDK version). Generated-by: Claude Opus 4.8
vlsi
left a comment
There was a problem hiding this comment.
I would avoid writing "common sense" in agents.md
| @@ -1 +1,46 @@ | |||
| Security model: [SECURITY.md](./SECURITY.md) | |||
|
|
|||
| ## Building and testing (for coding agents) | |||
There was a problem hiding this comment.
| ## Building and testing (for coding agents) | |
| ## Building and testing |
| JMeter builds with Gradle. Use the wrapper `./gradlew` (or `gw` from | ||
| [gdub](https://github.com/dougborg/gdub)). The full command list is in | ||
| [`gradle.md`](gradle.md), and toolchain details are in the | ||
| [Test builds](README.md#test-builds) section of `README.md`. The essentials: | ||
|
|
||
| - **Build everything (incl. tests + static checks):** `./gradlew build` | ||
| - **Unit tests only:** `./gradlew test` — single module, e.g. `./gradlew :src:core:test` | ||
| - **All checks (tests, checkstyle, spotless, …):** `./gradlew check` | ||
| - **Run the GUI from source:** `./gradlew runGui` | ||
| - **Assemble a runnable dist:** `./gradlew createDist && ./bin/jmeter` | ||
| - **Format before committing:** `./gradlew style` (spotlessApply + checkstyleAll); check-only: `./gradlew spotlessCheck checkstyleAll` | ||
| - **Skip tests:** append `-x test` |
There was a problem hiding this comment.
| JMeter builds with Gradle. Use the wrapper `./gradlew` (or `gw` from | |
| [gdub](https://github.com/dougborg/gdub)). The full command list is in | |
| [`gradle.md`](gradle.md), and toolchain details are in the | |
| [Test builds](README.md#test-builds) section of `README.md`. The essentials: | |
| - **Build everything (incl. tests + static checks):** `./gradlew build` | |
| - **Unit tests only:** `./gradlew test` — single module, e.g. `./gradlew :src:core:test` | |
| - **All checks (tests, checkstyle, spotless, …):** `./gradlew check` | |
| - **Run the GUI from source:** `./gradlew runGui` | |
| - **Assemble a runnable dist:** `./gradlew createDist && ./bin/jmeter` | |
| - **Format before committing:** `./gradlew style` (spotlessApply + checkstyleAll); check-only: `./gradlew spotlessCheck checkstyleAll` | |
| - **Skip tests:** append `-x test` | |
| JMeter builds with Gradle. Use `./gradlew --quiet ...` to reduce output verbosity. | |
| After modifying Java code, before reporting the change as done (handing control back to the user), run `./gradlew --quiet classes style` and fix any reported issues. |
Agents already know Gradle commands. There's no point in duplicating them like ./gradlew build.
| JMeter uses Gradle [toolchains](https://docs.gradle.org/current/userguide/toolchains.html), | ||
| so JDKs are found locally or auto-provisioned. The default build JDK is 17 | ||
| (artifacts target Java 8). To build or test under a specific JDK — the way CI | ||
| runs its matrix — pass build parameters: | ||
|
|
||
| - `-PjdkBuildVersion=<n>` — JDK to build with (e.g. `21`) | ||
| - `-PjdkTestVersion=<n>` — JDK to run **tests** with; `0` means "use the current Java" | ||
| - `-PjdkTestVendor=<vendor>` / `-PjdkTestImplementation=<impl>` — pin the vendor / VM implementation | ||
|
|
||
| Example — run the test suite on JDK 21 (Corretto): | ||
|
|
||
| ```sh | ||
| ./gradlew test -PjdkTestVersion=21 -PjdkTestVendor=corretto | ||
| ``` | ||
|
|
||
| List every available build parameter with `./gradlew parameters`. |
There was a problem hiding this comment.
| JMeter uses Gradle [toolchains](https://docs.gradle.org/current/userguide/toolchains.html), | |
| so JDKs are found locally or auto-provisioned. The default build JDK is 17 | |
| (artifacts target Java 8). To build or test under a specific JDK — the way CI | |
| runs its matrix — pass build parameters: | |
| - `-PjdkBuildVersion=<n>` — JDK to build with (e.g. `21`) | |
| - `-PjdkTestVersion=<n>` — JDK to run **tests** with; `0` means "use the current Java" | |
| - `-PjdkTestVendor=<vendor>` / `-PjdkTestImplementation=<impl>` — pin the vendor / VM implementation | |
| Example — run the test suite on JDK 21 (Corretto): | |
| ```sh | |
| ./gradlew test -PjdkTestVersion=21 -PjdkTestVendor=corretto | |
| ``` | |
| List every available build parameter with `./gradlew parameters`. | |
| JMeter uses Gradle toolchains; JDKs are found locally or auto-provisioned. The code targets JDK 17. To test under a specific JDK pass build parameters: | |
| - `-PjdkTestVersion=<n>` — JDK to run **tests** with; `0` means "use the current Java" | |
| - `-PjdkTestVendor=<vendor>` / `-PjdkTestImplementation=<impl>` — pin the vendor / VM implementation (jdkTestVersion is enough for most cases) | |
| List every available build parameter with `./gradlew parameters`. |
|
|
||
| CI mirrors these across a JDK × vendor × OS × timezone × locale matrix (see | ||
| [`.github/workflows/main.yml`](.github/workflows/main.yml)); the Error Prone | ||
| static-analysis job runs on JDK 21. |
There was a problem hiding this comment.
| CI mirrors these across a JDK × vendor × OS × timezone × locale matrix (see | |
| [`.github/workflows/main.yml`](.github/workflows/main.yml)); the Error Prone | |
| static-analysis job runs on JDK 21. |
Apply @vlsi's review on PR #2: keep only JMeter-specific, non-obvious guidance an agent doesn't already know — the --quiet flag, the "run ./gradlew --quiet classes style before handing back" instruction, and the JDK-test build parameters. Drop the generic gradlew build/test/check list, the heading suffix, and the checksums/coverage/RAT/CI section. Generated-by: Claude Opus 4.8
|
Agreed on the principle — AGENTS.md should carry only what an agent doesn't already know (JMeter-specific, non-obvious), not generic Gradle. I've applied all four suggestions (pushed in 0b9667b): dropped the obvious |
|
I think this would be mergeable for apache/jmeter. |
What
Adds a short "Building and testing (for coding agents)" section to
AGENTS.mdso any AI coding agent has JMeter's build context up front —independent of any agent framework.
Follows the suggestion on the dev@ DISCUSS thread
to give agents JMeter-specific build knowledge (in particular, how to run
tests under a specific JDK version).
Contents
gradlewtasks:build,test,:src:core:test,check,runGui,createDist,style.-PjdkBuildVersion/-PjdkTestVersion/-PjdkTestVendor, with a copy-paste example(run the suite on JDK 21 / Corretto) — the exact flag agents were
missing.
-PupdateExpectedJars check), coverage,and RAT tasks.
Pure documentation; no code or build changes. Points to the existing
gradle.mdandREADME.md"Test builds" section rather than duplicatingthem.
🤖 Generated with Claude Code