this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

cmd/cue: add a test for `cue mod publish` on a non-tidy module

This succeeds right now, but it shouldn't, and we already have
a TODO in modpublish.go for this reason.
This is important not only by itself as a default sanity check,
but also for the upcoming change to consistently suggest
that the user run 'cue mod fix' when an operation on the current module
fails because it lacks a language.version field.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: I8e0c91c3a526dbe2753e1e51d504146b2d85f1a8
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1195727
Reviewed-by: Paul Jolly <paul@myitcv.io>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>

+51
+51
cmd/cue/cmd/testdata/script/modpublish_non_tidy.txtar
··· 1 + # Test that cue mod publish fails when the module is not tidy 2 + # because one of the required dependencies is missing from module.cue. 3 + 4 + env OLD_CUE_REGISTRY=${CUE_REGISTRY} 5 + memregistry MEMREGISTRY 6 + env CUE_REGISTRY=$MEMREGISTRY+insecure 7 + 8 + # TODO(mvdan): mod publish does not check tidiness right now. 9 + exec cue mod publish v1.0.0 10 + 11 + # Sanity check that we can tidy the module and then publish again. 12 + # Note that the dependency is in the original registry populated from _registry/. 13 + 14 + env CUE_REGISTRY=${OLD_CUE_REGISTRY} 15 + exec cue mod tidy 16 + env CUE_REGISTRY=$MEMREGISTRY+insecure 17 + cmp cue.mod/module.cue cue.mod/module.cue.tidy 18 + 19 + exec cue mod publish v1.0.1 20 + 21 + -- cue.mod/module.cue -- 22 + module: "main.org@v1" 23 + language: version: "v0.9.0" 24 + source: kind: "self" 25 + -- cue.mod/module.cue.tidy -- 26 + module: "main.org@v1" 27 + language: { 28 + version: "v0.9.0" 29 + } 30 + source: { 31 + kind: "self" 32 + } 33 + deps: { 34 + "example.com@v0": { 35 + v: "v0.0.1" 36 + } 37 + } 38 + -- main.cue -- 39 + package main 40 + import "example.com@v0:main" 41 + 42 + main 43 + 44 + -- _registry/example.com_v0.0.1/cue.mod/module.cue -- 45 + module: "example.com@v0" 46 + language: version: "v0.8.0" 47 + 48 + -- _registry/example.com_v0.0.1/top.cue -- 49 + package main 50 + 51 + "example.com@v0": "v0.0.1"