Commit e21fa6b
test(e2e): read the cache root from mcpp, not from a bash re-derivation (#318)
* test(e2e): read the cache root from mcpp, not from a bash re-derivation
170 asserted the staging source lived under ${MCPP_HOME:-$HOME/.mcpp}/build-cache/v1.
That re-derivation is wrong for a SELF-CONTAINED install, where the unpacked tree
itself is the home — the shape of every release tarball and every
`xlings install mcpp`. Running the suite against the released 2026.7.30.2 binary
therefore failed the test while the binary was correct:
FAIL: std BMI cache is '<tarball>/build-cache/v1/std/...',
expected under '/home/speak/.mcpp/build-cache/v1/std'
CI never saw it because the binary under test lives at target/<triple>/<fp>/bin/mcpp,
which mcpp.home::root() deliberately disqualifies from self-contained detection.
The root now comes from `mcpp cache dir`, which exists precisely so "where is the
cache" has one answer. Verified passing against both shapes: the released tarball
binary and a dev build.
* test(e2e): accept either build verb where a dependency may come from the cache
Fallout from making the global cache work, and one of the two is a negative
assertion my change silently weakened.
163 asserted `Compiling acme.widget`. What it tests is that the descriptor was
found BY IDENTITY and the package joined the build; whether its objects were
compiled here or served from the cache belongs to a different subsystem. Now that
hits actually skip work, a sibling app dir under the same MCPP_HOME — 163 builds
several — can legitimately supply them, which is how it failed on Windows CI:
Cached acme.widget v1.38.1 (2 units)
FAIL: 163_identity_first_resolution.sh
82 is the more important one. Its NEGATIVE check ("widget must not be pulled when
the feature is inactive") grepped only `Compiling widget`, so a wrongly-pulled
dependency whose objects happened to be cached would announce `Cached widget` and
pass. Both directions now match either verb through one `pulled()` helper, so the
positive cannot be too narrow and the negative cannot be too weak.
25 and 48 grep the ROOT package's Compiling line, which is never cached; left
alone.
---------
Co-authored-by: sunrisepeak <speakshen@163.com>1 parent 3fec883 commit e21fa6b
3 files changed
Lines changed: 37 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
82 | 91 | | |
83 | 92 | | |
84 | 93 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
60 | | - | |
61 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
62 | 72 | | |
63 | | - | |
64 | | - | |
| 73 | + | |
| 74 | + | |
65 | 75 | | |
66 | 76 | | |
67 | 77 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
50 | 57 | | |
51 | | - | |
| 58 | + | |
52 | 59 | | |
53 | 60 | | |
54 | 61 | | |
55 | | - | |
| 62 | + | |
56 | 63 | | |
57 | 64 | | |
58 | | - | |
| 65 | + | |
59 | 66 | | |
60 | 67 | | |
0 commit comments