2021-12-08 16:24:16 -07:00
|
|
|
setup() {
|
|
|
|
load 'helpers'
|
|
|
|
|
|
|
|
common_setup
|
|
|
|
}
|
|
|
|
|
2021-12-14 14:29:20 -07:00
|
|
|
@test "plan/hello" {
|
2021-12-09 14:32:26 -07:00
|
|
|
# Europa loader handles the cwd differently, therefore we need to CD into the tree at or below the parent of cue.mod
|
2021-12-09 15:59:48 -07:00
|
|
|
cd "$TESTDIR"
|
2022-02-22 14:04:54 -07:00
|
|
|
"$DAGGER" "do" -p ./plan/hello-europa test
|
2021-12-10 16:06:14 -07:00
|
|
|
}
|
|
|
|
|
2021-12-16 12:30:09 -07:00
|
|
|
@test "plan/proxy invalid schema" {
|
2021-12-10 16:06:14 -07:00
|
|
|
cd "$TESTDIR"
|
2022-02-22 14:04:54 -07:00
|
|
|
run "$DAGGER" "do" -p ./plan/proxy/invalid_schema.cue verify
|
2021-12-14 14:29:20 -07:00
|
|
|
assert_failure
|
|
|
|
}
|
|
|
|
|
2022-02-22 13:21:32 -07:00
|
|
|
@test "plan/proxy invalid value" {
|
|
|
|
cd "$TESTDIR"
|
2022-02-22 14:04:54 -07:00
|
|
|
run "$DAGGER" "do" -p ./plan/proxy/invalid_value.cue verify
|
2022-02-22 13:21:32 -07:00
|
|
|
assert_failure
|
|
|
|
}
|
2021-12-14 14:29:20 -07:00
|
|
|
|
2021-12-16 12:30:09 -07:00
|
|
|
@test "plan/proxy incomplete unix" {
|
2021-12-14 14:29:20 -07:00
|
|
|
cd "$TESTDIR"
|
2022-02-22 14:04:54 -07:00
|
|
|
run "$DAGGER" "do" -p ./plan/proxy/incomplete_unix.cue verify
|
2021-12-14 14:29:20 -07:00
|
|
|
assert_failure
|
|
|
|
}
|
|
|
|
|
2022-02-22 13:21:32 -07:00
|
|
|
@test "plan/proxy incomplete service" {
|
|
|
|
cd "$TESTDIR"
|
2022-02-22 14:04:54 -07:00
|
|
|
run "$DAGGER" "do" -p ./plan/proxy/incomplete_service.cue verify
|
2022-02-22 13:21:32 -07:00
|
|
|
assert_output --partial 'mount "docker" is not concrete'
|
|
|
|
}
|
2021-12-14 14:29:20 -07:00
|
|
|
|
2021-12-16 12:30:09 -07:00
|
|
|
@test "plan/proxy unix" {
|
2021-12-14 14:29:20 -07:00
|
|
|
cd "$TESTDIR"
|
2022-02-22 14:04:54 -07:00
|
|
|
"$DAGGER" "do" -p ./plan/proxy/unix.cue verify
|
2021-12-16 12:30:09 -07:00
|
|
|
}
|
|
|
|
|
2022-02-22 14:04:54 -07:00
|
|
|
@test "plan/inputs/directories" {
|
2021-12-16 12:30:09 -07:00
|
|
|
cd "$TESTDIR"
|
2022-02-22 14:04:54 -07:00
|
|
|
"$DAGGER" "do" -p ./plan/inputs/directories/valid exists
|
2021-12-23 19:09:26 +01:00
|
|
|
|
2022-02-22 14:04:54 -07:00
|
|
|
run "$DAGGER" "do" -p ./plan/inputs/directories/invalid notExists
|
2021-12-17 13:37:20 -07:00
|
|
|
assert_failure
|
2021-12-23 19:09:26 +01:00
|
|
|
assert_output --partial 'fasdfsdfs" does not exist'
|
2021-12-17 13:37:20 -07:00
|
|
|
|
2022-02-22 14:04:54 -07:00
|
|
|
run "$DAGGER" "do" -p ./plan/inputs/directories/valid conflictingValues
|
2021-12-17 11:24:50 -07:00
|
|
|
assert_failure
|
2021-12-23 20:23:52 +01:00
|
|
|
assert_output --partial 'conflicting values "local directory" and "local dfsadf"'
|
2021-12-17 14:41:09 -07:00
|
|
|
}
|
|
|
|
|
2022-01-11 14:39:18 -07:00
|
|
|
@test "plan/inputs/secrets" {
|
2021-12-17 14:41:09 -07:00
|
|
|
cd "$TESTDIR"
|
2022-02-22 14:04:54 -07:00
|
|
|
"$DAGGER" "do" -p ./plan/inputs/secrets test valid
|
|
|
|
"$DAGGER" "do" -p ./plan/inputs/secrets test relative
|
2022-01-30 23:08:16 -01:00
|
|
|
|
2022-02-22 14:04:54 -07:00
|
|
|
run "$DAGGER" "do" -p ./plan/inputs/secrets test badCommand
|
2021-12-17 14:41:09 -07:00
|
|
|
assert_failure
|
2021-12-20 10:19:21 -07:00
|
|
|
assert_output --partial 'failed: exec: "rtyet": executable file not found'
|
2022-01-30 23:08:16 -01:00
|
|
|
|
2022-02-22 14:04:54 -07:00
|
|
|
run "$DAGGER" "do" -p ./plan/inputs/secrets test badArgs
|
2022-01-11 14:39:18 -07:00
|
|
|
assert_failure
|
2022-01-11 15:28:43 -07:00
|
|
|
assert_output --partial 'option'
|
2021-12-17 14:41:09 -07:00
|
|
|
}
|
2021-12-22 15:03:54 +01:00
|
|
|
|
2022-01-04 12:20:01 -07:00
|
|
|
@test "plan/with" {
|
2022-01-04 10:25:32 -07:00
|
|
|
cd "$TESTDIR"
|
2022-02-22 14:04:54 -07:00
|
|
|
"$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
|
2022-01-30 23:08:16 -01:00
|
|
|
|
2022-02-22 14:04:54 -07:00
|
|
|
run "$DAGGER" "do" --with 'inputs: params: foo:1' -p ./plan/with test params
|
2022-01-04 11:32:26 -07:00
|
|
|
assert_failure
|
|
|
|
assert_output --partial "conflicting values string and 1"
|
2022-01-30 23:08:16 -01:00
|
|
|
|
2022-02-22 14:04:54 -07:00
|
|
|
run "$DAGGER" "do" -p ./plan/with test params
|
2022-01-04 11:32:26 -07:00
|
|
|
assert_failure
|
2022-02-22 14:04:54 -07:00
|
|
|
assert_output --partial "actions.test.params.env.FOO: non-concrete value string"
|
2021-12-23 19:09:26 +01:00
|
|
|
}
|
|
|
|
|
2021-12-23 15:28:36 +01:00
|
|
|
@test "plan/platform" {
|
|
|
|
cd "$TESTDIR"
|
|
|
|
|
|
|
|
# Run with amd64 platform
|
2022-02-21 12:15:52 -07:00
|
|
|
run "$DAGGER" up ./plan/platform/config_platform_linux_amd64.cue
|
2021-12-23 15:28:36 +01:00
|
|
|
|
|
|
|
# Run with arm64 platform
|
2022-02-21 12:15:52 -07:00
|
|
|
run "$DAGGER" up ./plan/platform/config_platform_linux_arm64.cue
|
2021-12-23 15:28:36 +01:00
|
|
|
|
|
|
|
# Run with invalid platform
|
2022-02-21 12:15:52 -07:00
|
|
|
run "$DAGGER" up ./plan/platform/config_platform_failure_invalid_platform.cue
|
2021-12-23 15:28:36 +01:00
|
|
|
assert_failure
|
2022-01-30 23:08:16 -01:00
|
|
|
}
|