Skip to content

Commit

Permalink
internal/e2e: test that we can't replace published versions
Browse files Browse the repository at this point in the history
We were pretty sure that registry.cue.works already forbade this,
but we didn't have a proper end-to-end test for it yet.

Signed-off-by: Daniel Martí <[email protected]>
Change-Id: If17d595480771be0c5678edeb36ef97af986d172
Dispatch-Trailer: {"type":"trybot","CL":1178252,"patchset":1,"ref":"refs/changes/52/1178252/1","targetBranch":"master"}
  • Loading branch information
mvdan authored and cueckoo committed Mar 13, 2024
1 parent 5859fcd commit 3b7505b
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions internal/e2e/testdata/script/github_app_public.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,30 @@ cmp stdout export.golden
# TODO(mvdan): Use another registry token without access to this private repo
# and check that they can list and fetch, but not publish, any versions.

# Trying to publish the same version again with the same contents should succeed.
cd ../publish
exec cue mod publish ${VERSION}

# Trying to publish the same version again with different contents should fail.
# TODO: Note that the error does say the repository has enabled tag immutability,
# but that error message comes from Google Cloud, not from our registry service,
# so it's not a stable string. We should give the user a short and stable error,
# and test for it here with a regular expression.
cd ../publish-different
exec cue mod init ${MODVER}
! exec cue mod publish ${VERSION}
stderr 'cannot tag.*400 Bad Request'

-- publish/foo.cue --
package publish

foo: "foo value"

-- publish-different/foo.cue --
package publish

foo: "different foo value"

-- depend/out_foo.cue --
package depend

Expand Down

0 comments on commit 3b7505b

Please sign in to comment.