test: implemented tests for output list
Signed-off-by: Sam Alba <sam.alba@gmail.com>
This commit is contained in:
parent
270d8b4775
commit
44a919e7f8
@ -320,3 +320,35 @@ setup() {
|
||||
run bash -c "echo \"$outAll\" | grep cfg.strSet | grep string | grep pipo"
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "dagger output list" {
|
||||
"$DAGGER" init
|
||||
|
||||
dagger_new_with_plan list "$TESTDIR"/cli/output/list
|
||||
|
||||
run "$DAGGER" output list -e "list"
|
||||
assert_failure
|
||||
|
||||
"$DAGGER" up -e "list"
|
||||
|
||||
out="$("$DAGGER" output list -e "list")"
|
||||
outAll="$("$DAGGER" output list --all -e "list")"
|
||||
|
||||
run bash -c "echo \"$out\" | grep cfgInline.url | grep 'http://this.is.a.test/' | grep 'test url description'"
|
||||
assert_success
|
||||
|
||||
run bash -c "echo \"$out\" | grep cfg.url | grep 'http://this.is.a.test/' | grep 'test url description'"
|
||||
assert_success
|
||||
|
||||
run bash -c "echo \"$out\" | grep cfg2.url | grep 'http://this.is.a.test/' | grep 'test url description'"
|
||||
assert_success
|
||||
|
||||
run bash -c "echo \"$out\" | grep cfg.str"
|
||||
assert_failure
|
||||
|
||||
run bash -c "echo \"$outAll\" | grep cfg.str"
|
||||
assert_success
|
||||
|
||||
run bash -c "echo \"$outAll\" | grep cfg2.url"
|
||||
assert_success
|
||||
}
|
||||
|
19
tests/cli/output/list/main.cue
Normal file
19
tests/cli/output/list/main.cue
Normal file
@ -0,0 +1,19 @@
|
||||
package main
|
||||
|
||||
#A: {
|
||||
// a string
|
||||
str: string @dagger(output)
|
||||
strSet: "pipo" @dagger(input)
|
||||
strDef: *"yolo" | string @dagger(input)
|
||||
|
||||
// test url description
|
||||
url: "http://this.is.a.test/" @dagger(output)
|
||||
url2: url
|
||||
}
|
||||
|
||||
cfgInline: {
|
||||
#A
|
||||
}
|
||||
|
||||
cfg: #A
|
||||
cfg2: cfg
|
Reference in New Issue
Block a user