test: implemented tests for output list

Signed-off-by: Sam Alba <sam.alba@gmail.com>
This commit is contained in:
Sam Alba 2021-05-31 15:56:58 +02:00
parent 270d8b4775
commit 44a919e7f8
2 changed files with 51 additions and 0 deletions

View File

@ -320,3 +320,35 @@ setup() {
run bash -c "echo \"$outAll\" | grep cfg.strSet | grep string | grep pipo" run bash -c "echo \"$outAll\" | grep cfg.strSet | grep string | grep pipo"
assert_success 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
}

View 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