Skip to content

Commit 6f06484

Browse files
committed
back to wip k2
1 parent 296c7d4 commit 6f06484

5 files changed

Lines changed: 968 additions & 43 deletions

File tree

AGENTS.md

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,43 @@ mvn clean compile -DskipTests
3030
```
3131

3232
### Running Tests
33-
```bash
34-
# Run all tests
35-
mvn test
3633

37-
# Run tests with clean output (recommended)
34+
You MUST NOT ever filter test output as you are looking for something you do not know what it is that is the nature of debugging.
35+
36+
You MUST restrict the amount of tokens by adding logging at INFO, FINE, FINER and FINEST and you SHOULD run at a specific model/test/method level that best zooms in on the issue.
37+
38+
You MUST NOT add any 'temporary logging' all logging MUST be as above
39+
40+
You SHOULD NOT delete logging as that makes no sense only change the level be finer to turn it down.
41+
42+
You MUST add a jul log statement at INFO level at the top of each and every test method announcing that it is running.
43+
44+
You MUST have all new tests extend a class such as ` extends JsonSchemaLoggingConfig` so that the correct env vars set log levels in a way that is compatible with ./mvn-test-no-boilerplate.sh as outlined below.
45+
46+
You MUST NOT GUESS you SHOULD add more logging or more test methods you are a text based mind you can see all bugs with appropriate logging.
47+
48+
You MUST prefer the rich and varied use of ./mvn-test-no-boilerplate.sh as per:
49+
50+
```bash
51+
# Run tests with clean output (only recommended post all bugs fixed expected to be fixed)
3852
./mvn-test-no-boilerplate.sh
3953

4054
# Run specific test class
41-
./mvn-test-no-boilerplate.sh -Dtest=JsonParserTests
42-
./mvn-test-no-boilerplate.sh -Dtest=JsonTypedUntypedTests
55+
./mvn-test-no-boilerplate.sh -Dtest=BlahTest -Djava.util.logging.ConsoleHandler.level=FINE
4356

4457
# Run specific test method
45-
./mvn-test-no-boilerplate.sh -Dtest=JsonParserTests#testParseEmptyObject
58+
./mvn-test-no-boilerplate.sh -Dtest=BlahTest#testSomething -Djava.util.logging.ConsoleHandler.level=FINEST
4659

4760
# Run tests in specific module
48-
./mvn-test-no-boilerplate.sh -pl json-java21-api-tracker -Dtest=ApiTrackerTest
61+
./mvn-test-no-boilerplate.sh -pl json-java21-api-tracker -Dtest=ApiTrackerTest -Djava.util.logging.ConsoleHandler.level=FINE
4962
```
5063

64+
65+
You MUST NEVER pipe any output to anything that limits visiablity. We only use logging to find what we didn't know. It is an oxymoron to pipe logging to head or tail or grep.
66+
67+
You MAY opt to log the actual data structures as the come on and off the stack or are reified at `FINEST` as that is trace level for detailed debuging. You should only run one test method at a time at that level. If it is creating vast amounts of output due to infinite loops then this is the ONLY time you may use head or tail yet you MUST head A LARGE ENOUGH SIMPLE OF DATA to see the actual problem it is NOT ACCEPTABLE to create a million line trace file then look at 100 top lines when all of that is mvn start up. The fraction of any log you look at MUST be as large as should be the actual trace log of a good test and you should do 2x that such as thousands of lines.
68+
69+
5170
### JSON Compatibility Suite
5271
```bash
5372
# Build and run compatibility report
@@ -58,12 +77,6 @@ mvn exec:java -pl json-compatibility-suite
5877
mvn exec:java -pl json-compatibility-suite -Dexec.args="--json"
5978
```
6079

61-
### Debug Logging
62-
```bash
63-
# Enable debug logging for specific test
64-
./mvn-test-no-boilerplate.sh -Dtest=JsonParserTests -Djava.util.logging.ConsoleHandler.level=FINER
65-
```
66-
6780
## Releasing to Maven Central
6881

6982
Prerequisites

0 commit comments

Comments
 (0)