115
tests/plan.bats
115
tests/plan.bats
@@ -7,154 +7,77 @@ setup() {
|
||||
@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"
|
||||
"$DAGGER" up ./plan/hello-europa
|
||||
"$DAGGER" "do" -p ./plan/hello-europa test
|
||||
}
|
||||
|
||||
@test "plan/proxy invalid schema" {
|
||||
cd "$TESTDIR"
|
||||
run "$DAGGER" up ./plan/proxy/invalid_schema.cue
|
||||
run "$DAGGER" "do" -p ./plan/proxy/invalid_schema.cue verify
|
||||
assert_failure
|
||||
}
|
||||
|
||||
@test "plan/proxy invalid value" {
|
||||
cd "$TESTDIR"
|
||||
run "$DAGGER" up ./plan/proxy/invalid_value.cue
|
||||
run "$DAGGER" "do" -p ./plan/proxy/invalid_value.cue verify
|
||||
assert_failure
|
||||
}
|
||||
|
||||
@test "plan/proxy incomplete unix" {
|
||||
cd "$TESTDIR"
|
||||
run "$DAGGER" up ./plan/proxy/incomplete_unix.cue
|
||||
run "$DAGGER" "do" -p ./plan/proxy/incomplete_unix.cue verify
|
||||
assert_failure
|
||||
}
|
||||
|
||||
@test "plan/proxy incomplete service" {
|
||||
cd "$TESTDIR"
|
||||
run "$DAGGER" up ./plan/proxy/incomplete_service.cue
|
||||
run "$DAGGER" "do" -p ./plan/proxy/incomplete_service.cue verify
|
||||
assert_output --partial 'mount "docker" is not concrete'
|
||||
}
|
||||
|
||||
@test "plan/proxy unix" {
|
||||
cd "$TESTDIR"
|
||||
"$DAGGER" up ./plan/proxy/unix.cue
|
||||
"$DAGGER" "do" -p ./plan/proxy/unix.cue verify
|
||||
}
|
||||
|
||||
@test "plan/inputs/directories exists" {
|
||||
@test "plan/inputs/directories" {
|
||||
cd "$TESTDIR"
|
||||
"$DAGGER" up ./plan/inputs/directories/exists.cue
|
||||
}
|
||||
"$DAGGER" "do" -p ./plan/inputs/directories/valid exists
|
||||
|
||||
@test "plan/inputs/directories relative directories" {
|
||||
cd "$TESTDIR"
|
||||
cd "$TESTDIR"/plan/inputs
|
||||
|
||||
"$DAGGER" up ./directories/exists.cue
|
||||
}
|
||||
|
||||
@test "plan/inputs/directories not exists" {
|
||||
cd "$TESTDIR"
|
||||
run "$DAGGER" up ./plan/inputs/directories/not_exists.cue
|
||||
run "$DAGGER" "do" -p ./plan/inputs/directories/invalid notExists
|
||||
assert_failure
|
||||
assert_output --partial 'fasdfsdfs" does not exist'
|
||||
}
|
||||
|
||||
@test "plan/inputs/directories conflicting values" {
|
||||
cd "$TESTDIR"
|
||||
run "$DAGGER" up ./plan/inputs/directories/conflicting_values.cue
|
||||
run "$DAGGER" "do" -p ./plan/inputs/directories/valid conflictingValues
|
||||
assert_failure
|
||||
assert_output --partial 'conflicting values "local directory" and "local dfsadf"'
|
||||
}
|
||||
|
||||
@test "plan/inputs/secrets" {
|
||||
cd "$TESTDIR"
|
||||
"$DAGGER" up ./plan/inputs/secrets/exec.cue
|
||||
"$DAGGER" up ./plan/inputs/secrets/exec_relative.cue
|
||||
"$DAGGER" "do" -p ./plan/inputs/secrets test valid
|
||||
"$DAGGER" "do" -p ./plan/inputs/secrets test relative
|
||||
|
||||
run "$DAGGER" up ./plan/inputs/secrets/invalid_command.cue
|
||||
run "$DAGGER" "do" -p ./plan/inputs/secrets test badCommand
|
||||
assert_failure
|
||||
assert_output --partial 'failed: exec: "rtyet": executable file not found'
|
||||
|
||||
run "$DAGGER" up ./plan/inputs/secrets/invalid_command_options.cue
|
||||
run "$DAGGER" "do" -p ./plan/inputs/secrets test badArgs
|
||||
assert_failure
|
||||
assert_output --partial 'option'
|
||||
}
|
||||
|
||||
@test "plan/with" {
|
||||
cd "$TESTDIR"
|
||||
"$DAGGER" up --with 'inputs: params: foo:"bar"' ./plan/with/params.cue
|
||||
"$DAGGER" up --with 'actions: verify: env: FOO: "bar"' ./plan/with/actions.cue
|
||||
"$DAGGER" "do" --with 'inputs: params: foo:"bar"' -p ./plan/with test params
|
||||
"$DAGGER" "do" --with 'actions: test: direct: env: FOO: "bar"' -p ./plan/with test direct
|
||||
|
||||
run "$DAGGER" up --with 'inputs: params: foo:1' ./plan/with/params.cue
|
||||
run "$DAGGER" "do" --with 'inputs: params: foo:1' -p ./plan/with test params
|
||||
assert_failure
|
||||
assert_output --partial "conflicting values string and 1"
|
||||
|
||||
run "$DAGGER" up ./plan/with/params.cue
|
||||
run "$DAGGER" "do" -p ./plan/with test params
|
||||
assert_failure
|
||||
assert_output --partial "actions.verify.env.FOO: non-concrete value string"
|
||||
}
|
||||
|
||||
@test "plan/outputs/directories" {
|
||||
cd "$TESTDIR"/plan/outputs/directories
|
||||
|
||||
"$DAGGER" up ./outputs.cue
|
||||
assert [ -f "./out/test_outputs" ]
|
||||
|
||||
rm -f "./out/test_outputs"
|
||||
}
|
||||
|
||||
@test "plan/outputs/directories relative paths" {
|
||||
cd "$TESTDIR"/plan
|
||||
|
||||
"$DAGGER" up ./outputs/directories/relative.cue
|
||||
assert [ -f "./outputs/directories/out/test_relative" ]
|
||||
|
||||
rm -f "./outputs/directories/out/test_relative"
|
||||
}
|
||||
|
||||
@test "plan/outputs/files normal usage" {
|
||||
cd "$TESTDIR"/plan/outputs/files
|
||||
|
||||
"$DAGGER" up ./usage.cue
|
||||
|
||||
run ./test_usage
|
||||
assert_output "Hello World!"
|
||||
|
||||
run ls -l "./test_usage"
|
||||
assert_output --partial "-rwxr-x---"
|
||||
|
||||
rm -f "./test_usage"
|
||||
}
|
||||
|
||||
@test "plan/outputs/files relative path" {
|
||||
cd "$TESTDIR"/plan
|
||||
|
||||
"$DAGGER" up ./outputs/files/relative.cue
|
||||
assert [ -f "./outputs/files/test_relative" ]
|
||||
|
||||
rm -f "./outputs/files/test_relative"
|
||||
}
|
||||
|
||||
@test "plan/outputs/files default permissions" {
|
||||
cd "$TESTDIR"/plan/outputs/files
|
||||
|
||||
"$DAGGER" up ./default_permissions.cue
|
||||
|
||||
run ls -l "./test_default_permissions"
|
||||
assert_output --partial "-rw-r--r--"
|
||||
|
||||
rm -f "./test_default_permissions"
|
||||
}
|
||||
|
||||
@test "plan/outputs/files no contents" {
|
||||
cd "$TESTDIR"/plan/outputs/files
|
||||
|
||||
run "$DAGGER" up ./no_contents.cue
|
||||
assert_failure
|
||||
assert_output --partial "contents is not set"
|
||||
|
||||
assert [ ! -f "./test_no_contents" ]
|
||||
|
||||
rm -f "./test_no_contents"
|
||||
assert_output --partial "actions.test.params.env.FOO: non-concrete value string"
|
||||
}
|
||||
|
||||
@test "plan/platform" {
|
||||
|
Reference in New Issue
Block a user