Add do tests

Signed-off-by: Joel Longtine <joel@dagger.io>
This commit is contained in:
Joel Longtine
2022-03-07 16:53:50 -07:00
parent 2a6962ddc8
commit 5afaedc9ab
4 changed files with 196 additions and 0 deletions

View File

@@ -4,6 +4,35 @@ setup() {
common_setup
}
@test "plan/do dynamic tasks - fails to find tasks" {
# Europa loader handles the cwd differently, therefore we need to CD into the tree at or below the parent of cue.mod
cd "$TESTDIR"
run "$DAGGER" "do" -p ./plan/do/dynamic_tasks.cue "test" "b"
# No output because of weirdness with dynamic tasks, which causes it to fail
refute_output
}
@test "plan/do dynamic tasks - fails to run tasks" {
run "$DAGGER" "do" -p ./plan/do/dynamic_tasks.cue "test"
assert_failure
assert_output --partial 'outputs.files.andrea: contents is not set'
}
@test "plan/do don't run unspecified tasks" {
run "$DAGGER" "do" -p ./plan/do/do_not_run_unspecified_tasks.cue "test"
assert_output --partial "actions.test.one.script"
assert_output --partial "actions.test.three.script"
assert_output --partial "actions.test.two.script"
assert_output --partial "actions.image"
assert_output --partial "actions.test.one"
assert_output --partial "actions.test.two"
assert_output --partial "actions.test.three"
assert_output --partial "actions.test.one.export"
assert_output --partial "outputs.files.test"
refute_output --partial "actions.notMe"
}
@test "plan/hello" {
# Europa loader handles the cwd differently, therefore we need to CD into the tree at or below the parent of cue.mod
cd "$TESTDIR"