Skip to content

Commit

Permalink
internal/e2e: start using cue mod tidy
Browse files Browse the repository at this point in the history
For the gcloud_upload and github_app_public tests this is trivial,
as `cue mod tidy` generates the same module.cue we were templating.

For github_app_private, the dependency does not exist in the registry,
so `cue mod tidy` fails to find the module or list its versions.
Since the error now comes from tidy rather than `cue export`,
the error message is slightly different.

Signed-off-by: Daniel Martí <[email protected]>
Change-Id: Idb1bc0f92a712cbdacd6242c5a83870bb094f485
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1176203
Unity-Result: CUE porcuepine <[email protected]>
Reviewed-by: Roger Peppe <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
  • Loading branch information
mvdan committed Jan 31, 2024
1 parent 9ceec10 commit 34db9eb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 29 deletions.
12 changes: 3 additions & 9 deletions internal/e2e/testdata/script/gcloud_upload.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ exec cue mod publish ${VERSION}

cd ../depend

env-fill cue.mod/module.cue out_foo.cue
env-fill out_foo.cue
exec cue mod init depend.localhost
exec cue mod tidy
exec cue export
cmp stdout export.golden

Expand All @@ -28,14 +30,6 @@ package publish

foo: "foo value"

-- depend/cue.mod/module.cue --
module: "depend.localhost"

deps: {
"${MODVER}": {
v: "${VERSION}"
}
}
-- depend/out_foo.cue --
package depend

Expand Down
15 changes: 4 additions & 11 deletions internal/e2e/testdata/script/github_app_private.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,16 @@ exec git push origin main cue-${VERSION}
cd ../depend

# Double check that cmd/cue cannot download the dependency either.
env-fill cue.mod/module.cue out_foo.cue
! exec cue export
stderr 'cannot find package.*module not found'
env-fill out_foo.cue
exec cue mod init depend.localhost
! exec cue mod tidy
stderr 'failed to resolve.*app_private.*cannot find module'

-- publish/foo.cue --
package publish

foo: "foo value"

-- depend/cue.mod/module.cue --
module: "depend.localhost"

deps: {
"${MODVER}": {
v: "${VERSION}"
}
}
-- depend/out_foo.cue --
package depend

Expand Down
12 changes: 3 additions & 9 deletions internal/e2e/testdata/script/github_app_public.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ cue-mod-wait

cd ../depend

env-fill cue.mod/module.cue out_foo.cue
env-fill out_foo.cue
exec cue mod init depend.localhost
exec cue mod tidy
exec cue export
cmp stdout export.golden

Expand All @@ -35,14 +37,6 @@ package publish

foo: "foo value"

-- depend/cue.mod/module.cue --
module: "depend.localhost"

deps: {
"${MODVER}": {
v: "${VERSION}"
}
}
-- depend/out_foo.cue --
package depend

Expand Down

0 comments on commit 34db9eb

Please sign in to comment.