Skip to content

Commit cd630dd

Browse files
committed
docs(AGENTS): document unit vs IT lifecycle, wrapper verify behavior, and focused run patterns; reinforce logging discipline (#29)
1 parent 8eaae67 commit cd630dd

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

AGENTS.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,37 @@ git push -u origin "rel-$VERSION" && echo "✅ Success" || echo "🛑 Unable to
320320
- `pom.xml` (parent) holds the Central Publishing plugin configuration shared across modules.
321321

322322

323+
## Test Execution Guide (Unit vs. IT) — and Wrapper Behavior
324+
325+
- Test lifecycles are standard Maven:
326+
- Unit tests run under Surefire during the `test` phase.
327+
- Integration tests (ITs, classes matching `*IT.java`, `*ITCase.java`) run under Failsafe during `integration-test` and are verified during `verify`.
328+
329+
- Wrapper changes (required usage):
330+
- `./mvn-test-no-boilerplate.sh` (root) and `json-java21-schema/mvn-test-no-boilerplate.sh` now run `verify` by default so ITs execute reliably.
331+
- The wrapper prints a banner: `[INFO] Running: mvn(d) verify ...` and shows both surefire and failsafe sections without hiding logs. Pass through `-pl`, `-Dtest=...`, and JUL level flags as needed.
332+
333+
- Focused runs (recommended patterns):
334+
- Unit-only, fast loop (skip ITs):
335+
- `./mvn-test-no-boilerplate.sh -pl json-java21-schema -DskipITs=true -Dtest=OpenRPCFragmentsUnitTest -Djava.util.logging.ConsoleHandler.level=INFO`
336+
- IT focus (skip unit tests):
337+
- `./mvn-test-no-boilerplate.sh -pl json-java21-schema -DskipTests=true -Dit.test=OpenRPCSchemaValidationIT -Djava.util.logging.ConsoleHandler.level=INFO`
338+
- Full module (units + ITs):
339+
- `./mvn-test-no-boilerplate.sh -pl json-java21-schema -Djava.util.logging.ConsoleHandler.level=INFO`
340+
341+
- Logging discipline in tests (non‑negotiable):
342+
- Add `INFO` prologue at the top of every test method (tests extend `JsonSchemaLoggingConfig`).
343+
- Main code logs are FINE/FINER/FINEST; only tests announce at INFO.
344+
345+
- Methodical build‑up to OpenRPC IT:
346+
- Start with unit tests for schema fragments that use currently supported keywords (e.g., required, type, properties, arrays, simple formats).
347+
- Use a “compile‑only” posture by denying all remote schemes when exercising fragments that must not fetch, to reveal missing features deterministically.
348+
- Once fragments are green, run the OpenRPC IT to validate curated documents end‑to‑end.
349+
350+
Notes
351+
- The wrappers prefer `mvnd` if available; otherwise they fall back to `mvn`.
352+
- The wrappers do not suppress framework logs — use JUL levels (`-Djava.util.logging.ConsoleHandler.level=...`) to control verbosity.
353+
323354
#### Minimum Viable (MVF) Architecture
324355
1. **Restatement of the approved whiteboard sketch**
325356
- Compile-time uses a LIFO work stack of schema sources (URIs). Begin with the initial source. Each pop parses/builds the root and scans `$ref` tokens, tagging each as LOCAL (same document) or REMOTE (different document). REMOTE targets are pushed when unseen (dedup by normalized document URI). The Roots Registry maps `docUri → Root`.

0 commit comments

Comments
 (0)