Skip to content

Commit

Permalink
cmd/cue: use CUE_VERSION_OVERRIDE in script tests to avoid churn
Browse files Browse the repository at this point in the history
Otherwise, every time we bump fallbackVersion, we need to update
all of these tests. Which is easy to do with CUE_UPDATE=1,
but that would still cause unnecessary noise in the git log.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: Ie807f753609e2e57590cba5f17b576bdbc52cb26
Dispatch-Trailer: {"type":"trybot","CL":1178187,"patchset":1,"ref":"refs/changes/87/1178187/1","targetBranch":"master"}
  • Loading branch information
mvdan authored and cueckoo committed Mar 12, 2024
1 parent f6238e5 commit a173ee5
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
3 changes: 2 additions & 1 deletion cmd/cue/cmd/testdata/script/modinit_majorversion.txtar
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
env CUE_VERSION_OVERRIDE=v0.1.2
exec cue mod init foo.com/bar@v1
cmp cue.mod/module.cue want-module.cue
exists cue.mod/usr
Expand All @@ -6,5 +7,5 @@ exists cue.mod/pkg
-- want-module.cue --
module: "foo.com/bar@v1"
language: {
version: "v0.8.0-alpha.5"
version: "v0.1.2"
}
3 changes: 2 additions & 1 deletion cmd/cue/cmd/testdata/script/modinit_noargs.txtar
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# TODO we might want to deprecate or remove the ability to create
# module file with an empty module directive.
env CUE_VERSION_OVERRIDE=v0.1.2
exec cue mod init
cmp cue.mod/module.cue want-module.cue
exists cue.mod/usr
Expand All @@ -8,5 +9,5 @@ exists cue.mod/pkg
-- want-module.cue --
module: ""
language: {
version: "v0.8.0-alpha.5"
version: "v0.1.2"
}
3 changes: 2 additions & 1 deletion cmd/cue/cmd/testdata/script/modinit_nomajorversion.txtar
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
env CUE_VERSION_OVERRIDE=v0.1.2
exec cue mod init foo.com/bar
cmp cue.mod/module.cue want-module.cue
exists cue.mod/usr
Expand All @@ -6,5 +7,5 @@ exists cue.mod/pkg
-- want-module.cue --
module: "foo.com/bar@v0"
language: {
version: "v0.8.0-alpha.5"
version: "v0.1.2"
}
3 changes: 2 additions & 1 deletion cmd/cue/cmd/testdata/script/modtidy_initial.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# dependencies, and that it removes dependencies that
# aren't needed any more.

env CUE_VERSION_OVERRIDE=v0.1.2
exec cue mod tidy
cmp cue.mod/module.cue want-module

Expand All @@ -15,7 +16,7 @@ exec cue mod tidy --check
-- want-module --
module: "main.org@v0"
language: {
version: "v0.8.0-alpha.5"
version: "v0.1.2"
}
deps: {
"bar.com@v0": {
Expand Down
3 changes: 2 additions & 1 deletion cmd/cue/cmd/testdata/script/modtidy_non_root.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
# run in the module's root directory.

cd x/y
env CUE_VERSION_OVERRIDE=v0.1.2
exec cue mod tidy
cd $WORK
cmp cue.mod/module.cue want-module

-- want-module --
module: "main.org@v0"
language: {
version: "v0.8.0-alpha.5"
version: "v0.1.2"
}
-- cue.mod/module.cue --
module: "main.org@v0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# dependencies, and that it removes dependencies that
# aren't needed any more.

env CUE_VERSION_OVERRIDE=v0.1.2
exec cue mod tidy
cmp cue.mod/module.cue want-module

Expand All @@ -12,7 +13,7 @@ cmp stdout want-stdout
-- want-module --
module: "main.org@v0"
language: {
version: "v0.8.0-alpha.5"
version: "v0.1.2"
}
deps: {
"example.com@v0": {
Expand Down

0 comments on commit a173ee5

Please sign in to comment.