Skip to content

docs: add build & test guidance for coding agents (AGENTS.md)#2

Draft
milamberspace wants to merge 1 commit into
trunkfrom
jmeter-agents-build-notes
Draft

docs: add build & test guidance for coding agents (AGENTS.md)#2
milamberspace wants to merge 1 commit into
trunkfrom
jmeter-agents-build-notes

Conversation

@milamberspace

Copy link
Copy Markdown
Owner

What

Adds a short "Building and testing (for coding agents)" section to
AGENTS.md so 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

  • Core gradlew tasks: build, test, :src:core:test, check,
    runGui, createDist, style.
  • JDK selection for build and tests via -PjdkBuildVersion /
    -PjdkTestVersion / -PjdkTestVendor, with a copy-paste example
    (run the suite on JDK 21 / Corretto) — the exact flag agents were
    missing.
  • Dependency-checksum refresh (-PupdateExpectedJars check), coverage,
    and RAT tasks.
  • Pointer to the CI matrix and the Error Prone job.

Pure documentation; no code or build changes. Points to the existing
gradle.md and README.md "Test builds" section rather than duplicating
them.

🤖 Generated with Claude Code

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 vlsi left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would avoid writing "common sense" in agents.md

Comment thread AGENTS.md
@@ -1 +1,46 @@
Security model: [SECURITY.md](./SECURITY.md)

## Building and testing (for coding agents)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Building and testing (for coding agents)
## Building and testing

Comment thread AGENTS.md
Comment on lines +5 to +16
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`

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Comment thread AGENTS.md
Comment on lines +20 to +35
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`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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`.

Comment thread AGENTS.md
Comment on lines +43 to +46

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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants