Commit 9b097c5
committed
test(manifest): stub the JVM fixture deps (v1.x)
The maven-compat smoke fixture declared commons-io, junit and hamcrest
as real artifacts from Maven Central purely to get a graph shape: an
external prod dep, a test-scope dep and its transitive. No fixture code
imports them, so they were never compiled against or executed - but they
still aged into GHSA-78wr-2p64-hpwj, a Dependabot alert, and a version
bump.
gradle-compat already solved this: make-localrepo.sh generated a tiny
file-based Maven repo of empty-jar stubs at test time. That generator
moves up a directory to test/make-stub-repo.sh, gains the ability to
give a stub its own dependency, and now serves all three fixtures.
maven-compat resolves demo.ext:tool (prod), demo.ext:harness (test) and
its transitive demo.ext:harness-core through a <repository> whose URL
smoke-test.sh passes as -Dstub.repo.url; sbt-compat resolves
demo.ext:tool and demo.ext:harness the same way.
The suites also stop using the developer's home caches.
compat-cache.sh resolves one cache root under the temp dir, overridable
by SOCKET_COMPAT_CACHE, and each tool is pointed at it: Maven by
-Dmaven.repo.local, Gradle by -g, sbt by -Dsbt.ivy.home and
COURSIER_CACHE. The root is stable so each tool's own closure is
downloaded once, but the stub artifacts are evicted before every run, so
a run can never pass on a stale copy of the thing under test. Nothing is
read from or written to ~/.m2, ~/.gradle or ~/.ivy2, and records.tsv no
longer embeds a path under the developer's home.
Assertions prove exactly what they proved before, still matching on
groupId:artifactId with no version written in any test, and still keying
on the .jar suffix rather than any path. The transitive check is now
unconditional: with a stub graph it is deterministic, so its absence is
a defect rather than a junit-version detail.
The internal reactor module's lookup now pins the field count as well as
the prefix. 'demo:lib:' is a prefix of the typed 'demo:lib:jar:1.0' as
well as the bare 'demo:lib:1.0', so on the prefix alone a regression
that stopped emitting the bare id would still have passed a check whose
message claims bare-id coverage.
maven-compat's first assertion block moves out of its heredoc into
assert-records.py, so the unit suite can run those assertions over
synthetic records without Maven or a JDK. Nothing in CI runs the compat
fixtures, so that unit test is the only automated cover the assertions
have.
Each build tool still fetches its own closure from Central - Maven's
plugins pull commons-io themselves - so this is not a fully offline
fixture. It declares no third-party dependency of its own.
The fixture-generated paths also gain .gitignore entries, which this
branch of the tree never had - which is how 256 files of Gradle cache
came to be committed here in the first place. .gradle-home/ stays
ignored rather than being dropped as it was on main, because
smoke-test-workspaces.sh still keeps its Gradle user home inside the
fixture directory on this line.1 parent a0f78d3 commit 9b097c5
19 files changed
Lines changed: 446 additions & 134 deletions
File tree
- src/commands/manifest/scripts/test
- gradle-compat
- project
- maven-compat
- project
- app
- sbt-compat
- project
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | 8 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
Lines changed: 0 additions & 31 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
21 | 23 | | |
22 | | - | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 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 | + | |
| 74 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
0 commit comments