-
Notifications
You must be signed in to change notification settings - Fork 294
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/cue: check the structure of CUE_CACHE_DIR after downloading modules
This acts as a nice regression test and visualization, and we will see the impact of future changes like https://cuelang.org/issue/3139. Note that ./mod/modcache already covers the presence of specific cache files via its Go unit tests, but this added testscript check is a nice complement which covers all files and shows the entire structure. For #3139. Signed-off-by: Daniel Martí <[email protected]> Change-Id: I2ffa32f7ccb44b52c0bfad1bfe56f93a450d5a70 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1195517 Unity-Result: CUE porcuepine <[email protected]> Reviewed-by: Paul Jolly <[email protected]> TryBot-Result: CUEcueckoo <[email protected]>
- Loading branch information
Showing
2 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,12 @@ cmp stdout want-stdout | |
|
||
# Check that the tidy check succeeds | ||
exec cue mod tidy --check | ||
|
||
# Check what the structure of CUE_CACHE_DIR looks like after fetching modules. | ||
find-files ${CUE_CACHE_DIR} | ||
cmp stdout cue-cache-dir.files | ||
# Unused dependencies should not have their entire source downloaded or extracted. | ||
! stdout 'unused\.com.*\.zip$' | ||
-- want-module -- | ||
module: "main.org@v0" | ||
language: { | ||
|
@@ -54,6 +60,29 @@ import "example.com@v0:main" | |
|
||
main | ||
|
||
-- cue-cache-dir.files -- | ||
.tmp/cache/[email protected]/bar/x.cue | ||
.tmp/cache/[email protected]/cue.mod/module.cue | ||
.tmp/cache/[email protected]/baz.cue | ||
.tmp/cache/[email protected]/cue.mod/module.cue | ||
.tmp/cache/cache/download/bar.com/@v/v0.5.0.lock | ||
.tmp/cache/cache/download/bar.com/@v/v0.5.0.mod | ||
.tmp/cache/cache/download/bar.com/@v/v0.5.0.zip | ||
.tmp/cache/cache/download/baz.org/@v/v0.10.1.lock | ||
.tmp/cache/cache/download/baz.org/@v/v0.10.1.mod | ||
.tmp/cache/cache/download/baz.org/@v/v0.10.1.zip | ||
.tmp/cache/cache/download/example.com/@v/v0.0.1.lock | ||
.tmp/cache/cache/download/example.com/@v/v0.0.1.mod | ||
.tmp/cache/cache/download/example.com/@v/v0.0.1.zip | ||
.tmp/cache/cache/download/foo.com/bar/hello/@v/v0.2.3.lock | ||
.tmp/cache/cache/download/foo.com/bar/hello/@v/v0.2.3.mod | ||
.tmp/cache/cache/download/foo.com/bar/hello/@v/v0.2.3.zip | ||
.tmp/cache/cache/download/unused.com/@v/v0.2.4.lock | ||
.tmp/cache/cache/download/unused.com/@v/v0.2.4.mod | ||
.tmp/cache/[email protected]/cue.mod/module.cue | ||
.tmp/cache/[email protected]/top.cue | ||
.tmp/cache/foo.com/bar/[email protected]/cue.mod/module.cue | ||
.tmp/cache/foo.com/bar/[email protected]/x.cue | ||
-- _registry/example.com_v0.0.1/cue.mod/module.cue -- | ||
module: "example.com@v0" | ||
language: version: "v0.8.0" | ||
|