Skip to content

Commit 35b0632

Browse files
committed
Update CI test count and add PR creation instructions
- Updated CI test count from 464 to 465 to reflect new discriminator test - Added instructions for creating PRs with GitHub CLI to AGENTS.md - Includes guidance on avoiding special characters in titles and using body-file flag
1 parent e6877c3 commit 35b0632

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
for k in totals: totals[k]+=int(r.get(k,'0'))
4040
except Exception:
4141
pass
42-
exp_tests=464
42+
exp_tests=465
4343
exp_skipped=0
4444
if totals['tests']!=exp_tests or totals['skipped']!=exp_skipped:
4545
print(f"Unexpected test totals: {totals} != expected tests={exp_tests}, skipped={exp_skipped}")

AGENTS.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,28 @@ IMPORTANT: Bugs in the main logic this code cannot be fixed in this repo they **
182182
- Uses stack-based validation with comprehensive error reporting.
183183
- Includes full RFC 8927 compliance test suite.
184184

185+
#### Debugging Exhaustive Property Tests
186+
187+
The `JtdExhaustiveTest` uses jqwik property-based testing to generate comprehensive schema/document permutations. When debugging failures:
188+
189+
1. **Enable FINEST logging** to capture exact schema and document inputs:
190+
```bash
191+
$(command -v mvnd || command -v mvn || command -v ./mvnw) -pl json-java21-jtd test -Dtest=JtdExhaustiveTest -Djava.util.logging.ConsoleHandler.level=FINEST > test_debug.log 2>&1
192+
```
193+
194+
2. **Search for failing cases** in the log file:
195+
```bash
196+
rg "UNEXPECTED: Failing document passed validation" test_debug.log
197+
```
198+
199+
3. **Extract the exact schema and document** from the log output and add them as specific test cases to `TestRfc8927.java` for targeted debugging.
200+
201+
The property test logs at FINEST level:
202+
- Schema JSON under test
203+
- Generated documents (both compliant and failing cases)
204+
- Validation results with detailed error messages
205+
- Unexpected pass/fail results with full context
206+
185207
## Security Notes
186208
- Deep nesting can trigger StackOverflowError (stack exhaustion attacks).
187209
- Malicious inputs may violate API contracts and trigger undeclared exceptions.
@@ -224,12 +246,20 @@ IMPORTANT: Bugs in the main logic this code cannot be fixed in this repo they **
224246

225247
### Pull Requests
226248
- Describe what was done, not the rationale or implementation details.
227-
- Reference the issues they close using GitHubs closing keywords.
249+
- Reference the issues they close using GitHub's closing keywords.
228250
- Do not repeat information already captured in the issue.
229251
- Do not report success; CI results provide that signal.
230252
- Include any additional tests (or flags) needed by CI in the description.
231253
- Mark the PR as `Draft` whenever checks fail.
232254

255+
### Creating Pull Requests with GitHub CLI
256+
- Use simple titles without special characters or emojis
257+
- Write PR body to a file first to avoid shell escaping issues
258+
- Use `--body-file` flag instead of `--body` for complex content
259+
- Example: `gh pr create --title "Fix validation bug" --body-file /tmp/pr_body.md`
260+
- Watch CI checks with `gh pr checks --watch` until all pass
261+
- Do not merge until all checks are green
262+
233263
## Release Process (Semi-Manual, Deferred Automation)
234264
- Releases remain semi-manual until upstream activity warrants completing the draft GitHub Action. Run each line below individually.
235265

0 commit comments

Comments
 (0)