Commit cd01580
fix(java): a test read files another test class writes, with nothing declaring the order
`conformance`'s full-reactor job went red a second time — a different module, a
different test, the same shape as the last one:
WorkingSchemaValidationTest.demonstrateConstraintSystemSuccess:124
Should have substantial constraint evidence in generated schemas
It had been hidden behind the failure fixed in `1c24b8f9d`: Maven fails fast, so
the earlier run died in `metaobjects-metadata` and never built `codegen-base`.
The three tests in this class read `target/working-{metadata-schema,ai-documentation}
.json`, which `WorkingSchemaGeneratorTest` writes. Nothing declared that order, so it
was surefire's `runOrder` — default `filesystem`, i.e. whatever order the class files
happen to sit in on THAT machine. Reproduced locally with
`-Dsurefire.runOrder=reversealphabetical` (Validation sorts after Generator, so
reversing puts the consumer first): green by default, red reversed, identical to the
runner.
**Both failure modes here are bad, and they are opposite.** The test that failed
logs a warning for the missing file, `continue`s, and then asserts on an evidence
count of zero — so an absent PRECONDITION is reported as "Should have substantial
constraint evidence in generated schemas", which reads like a codegen regression and
sends you looking in the wrong place. The other two `return` early and PASS, having
checked nothing at all: on the machine where the files are missing, this class
silently validates no schema.
Fixed by generating the artifacts in `@BeforeClass` — the pattern the two sibling
consumers in this module (`SimpleSchemaValidationTest`, `SchemaValidationTest`) already
use, so this closes the last door rather than adding a new rule. The early `return`s
become unreachable instead of load-bearing, and those two tests now assert for real.
Verified from a clean `target/` under all four run orders — default, alphabetical,
reversealphabetical (the one that reproduced CI), and random: 70 tests, 0 failures each.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NTcEKXTQMYt84fAjuw5A2M1 parent 1c24b8f commit cd01580
1 file changed
Lines changed: 36 additions & 0 deletions
File tree
- server/java/codegen-base/src/test/java/com/metaobjects/generator
Lines changed: 36 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
21 | 57 | | |
22 | 58 | | |
23 | 59 | | |
| |||
0 commit comments