Commit c0db341
authored
* fix(export): let CI demand fixture completeness via IFC_LITE_REQUIRE_FIXTURES
fixture_or_skip! (and its fixture_opt backend) already eprintln! a skip
message, but cargo test captures stdout/stderr for a passing test and only
releases the buffer on failure -- so on a plain `cargo test` the message is
written and discarded, and the test looks identical to one that actually
asserted something (#2802). Measured on rust/export's lib target: 56 of 228
tests are this kind of no-op pass without `pnpm fixtures`; with fixtures
fetched, 227 of 228 run for real (one references a fixture,
issues/860_solid_stratum.ifc, that isn't catalogued in
tests/models/manifest.json at all).
Setting IFC_LITE_REQUIRE_FIXTURES=1 turns a missing fixture into a panic
instead of a skip, so CI (which already runs `pnpm fixtures` before `cargo
test`) can fail loudly on fixture drift instead of silently running fewer
tests. Unset, behavior is unchanged: a fixture-less local `cargo test`
remains a legitimate, skipping workflow.
Not wired into any workflow here -- that's the maintainer's call, and the
stale issues/860_solid_stratum.ifc reference would need fixing (or dropping)
before the flag could be turned on without a spurious failure.
* fix(export): fail closed on unrecognised IFC_LITE_REQUIRE_FIXTURES values, wire gate into CI
louistrue's review on #2835 found two gaps: (1) the env var was never set
anywhere, so the gate protected nothing as merged; (2) the value check
(`== Ok("1")`) fell through to "off" for any unrecognised truthy spelling
(`true`, `yes`, `TRUE`), which is the exact silent-pass failure this PR
exists to close.
Extract the parse into `require_fixtures()`: unset/empty/"0" stays off
(unchanged default), "1" turns the gate on, and anything else panics
instead of guessing. Wire `IFC_LITE_REQUIRE_FIXTURES: "1"` into the
`rust-tests` job's test step in test.yml, the only job that both fetches
fixtures unconditionally and runs `cargo test --workspace` against
ifc-lite-export.
Note: issues/860_solid_stratum.ifc, referenced by
gltf::tests::glb_nodes_have_export_rows_for_legacy_products, has no entry
in tests/models/manifest.json and can never be fetched by
scripts/fixtures/fetch-fixtures.mjs. Enabling this gate will turn that
test — and therefore the rust-tests job — red until that stale reference
is resolved.
* fix(export): reject non-Unicode IFC_LITE_REQUIRE_FIXTURES instead of silently disabling the gate
require_fixtures() matched Err(_) => false, which treated a present but
non-Unicode value the same as an unset variable. That let a misconfigured
value silently disable the fixture-enforcement gate instead of failing
loudly like every other unrecognised value does.
Split the pure decision into require_fixtures_from(Result<String, VarError>)
so NotPresent and NotUnicode are matched separately, and so a test can cover
NotUnicode without mutating the real process environment (which would race
other tests calling require_fixtures concurrently).
1 parent 071eb0a commit c0db341
2 files changed
Lines changed: 101 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
720 | 720 | | |
721 | 721 | | |
722 | 722 | | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
723 | 728 | | |
724 | 729 | | |
725 | 730 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 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 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
17 | 74 | | |
18 | 75 | | |
19 | 76 | | |
| |||
23 | 80 | | |
24 | 81 | | |
25 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
26 | 88 | | |
27 | 89 | | |
28 | 90 | | |
29 | 91 | | |
30 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
31 | 98 | | |
32 | 99 | | |
33 | 100 | | |
| |||
50 | 117 | | |
51 | 118 | | |
52 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
0 commit comments