2021-12-09 00:24:16 +01:00
|
|
|
setup() {
|
|
|
|
load 'helpers'
|
|
|
|
|
|
|
|
common_setup
|
|
|
|
}
|
|
|
|
|
2021-12-14 22:29:20 +01:00
|
|
|
@test "plan/hello" {
|
2021-12-09 22:32:26 +01: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 23:59:48 +01:00
|
|
|
cd "$TESTDIR"
|
2021-12-11 00:06:14 +01:00
|
|
|
"$DAGGER" --europa up ./plan/hello-europa
|
|
|
|
}
|
|
|
|
|
2021-12-16 20:30:09 +01:00
|
|
|
@test "plan/proxy invalid schema" {
|
2021-12-11 00:06:14 +01:00
|
|
|
cd "$TESTDIR"
|
2021-12-16 20:30:09 +01:00
|
|
|
run "$DAGGER" --europa up ./plan/proxy/invalid_schema.cue
|
2021-12-14 22:29:20 +01:00
|
|
|
assert_failure
|
|
|
|
}
|
|
|
|
|
2021-12-16 20:30:09 +01:00
|
|
|
@test "plan/proxy invalid value" {
|
2021-12-14 22:29:20 +01:00
|
|
|
cd "$TESTDIR"
|
2021-12-16 20:30:09 +01:00
|
|
|
run "$DAGGER" --europa up ./plan/proxy/invalid_value.cue
|
2021-12-14 22:29:20 +01:00
|
|
|
assert_failure
|
|
|
|
}
|
|
|
|
|
2021-12-16 20:30:09 +01:00
|
|
|
@test "plan/proxy incomplete unix" {
|
2021-12-14 22:29:20 +01:00
|
|
|
cd "$TESTDIR"
|
2021-12-16 20:30:09 +01:00
|
|
|
run "$DAGGER" --europa up ./plan/proxy/incomplete_unix.cue
|
2021-12-14 22:29:20 +01:00
|
|
|
assert_failure
|
|
|
|
}
|
|
|
|
|
2021-12-16 20:30:09 +01:00
|
|
|
@test "plan/proxy incomplete service" {
|
2021-12-14 22:29:20 +01:00
|
|
|
cd "$TESTDIR"
|
2021-12-16 20:30:09 +01:00
|
|
|
run "$DAGGER" --europa up ./plan/proxy/incomplete_service.cue
|
2021-12-14 22:29:20 +01:00
|
|
|
assert_output --partial "pipeline was partially executed because of missing inputs"
|
|
|
|
}
|
|
|
|
|
2021-12-16 20:30:09 +01:00
|
|
|
@test "plan/proxy unix" {
|
2021-12-14 22:29:20 +01:00
|
|
|
cd "$TESTDIR"
|
2021-12-16 20:30:09 +01:00
|
|
|
"$DAGGER" --europa up ./plan/proxy/unix.cue
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "plan/inputs/directories exists" {
|
|
|
|
cd "$TESTDIR"
|
|
|
|
"$DAGGER" --europa up ./plan/inputs/directories/exists.cue
|
2021-12-17 19:24:50 +01:00
|
|
|
}
|
|
|
|
|
2021-12-23 19:09:26 +01:00
|
|
|
@test "plan/inputs/directories relative directories" {
|
|
|
|
cd "$TESTDIR"
|
|
|
|
cd "$TESTDIR"/plan/inputs
|
|
|
|
|
|
|
|
"$DAGGER" --europa up ./directories/exists.cue
|
|
|
|
}
|
|
|
|
|
2021-12-17 21:37:20 +01:00
|
|
|
@test "plan/inputs/directories not exists" {
|
|
|
|
cd "$TESTDIR"
|
|
|
|
run "$DAGGER" --europa up ./plan/inputs/directories/not_exists.cue
|
|
|
|
assert_failure
|
2021-12-23 19:09:26 +01:00
|
|
|
assert_output --partial 'fasdfsdfs" does not exist'
|
2021-12-17 21:37:20 +01:00
|
|
|
}
|
|
|
|
|
2021-12-17 19:24:50 +01:00
|
|
|
@test "plan/inputs/directories conflicting values" {
|
|
|
|
cd "$TESTDIR"
|
|
|
|
run "$DAGGER" --europa up ./plan/inputs/directories/conflicting_values.cue
|
|
|
|
assert_failure
|
2021-12-23 20:23:52 +01:00
|
|
|
assert_output --partial 'conflicting values "local directory" and "local dfsadf"'
|
2021-12-17 22:41:09 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@test "plan/inputs/secrets exec" {
|
|
|
|
cd "$TESTDIR"
|
|
|
|
"$DAGGER" --europa up ./plan/inputs/secrets/exec.cue
|
|
|
|
}
|
|
|
|
|
2021-12-23 19:09:26 +01:00
|
|
|
@test "plan/inputs/secrets exec relative" {
|
|
|
|
cd "$TESTDIR"
|
|
|
|
"$DAGGER" --europa up ./plan/inputs/secrets/exec.cue
|
|
|
|
}
|
|
|
|
|
2021-12-17 22:41:09 +01:00
|
|
|
@test "plan/inputs/secrets invalid command" {
|
|
|
|
cd "$TESTDIR"
|
|
|
|
run "$DAGGER" --europa up ./plan/inputs/secrets/invalid_command.cue
|
|
|
|
assert_failure
|
2021-12-20 18:19:21 +01:00
|
|
|
assert_output --partial 'failed: exec: "rtyet": executable file not found'
|
2021-12-17 22:41:09 +01:00
|
|
|
}
|
2021-12-22 15:03:54 +01:00
|
|
|
|
|
|
|
@test "plan/outputs" {
|
|
|
|
cd "$TESTDIR"/plan/outputs
|
|
|
|
|
|
|
|
rm -f "./out/test"
|
|
|
|
"$DAGGER" --europa up ./outputs.cue
|
|
|
|
assert [ -f "./out/test" ]
|
|
|
|
}
|
2021-12-23 15:28:36 +01:00
|
|
|
|
2021-12-23 19:09:26 +01:00
|
|
|
@test "plan/outputs relative paths" {
|
|
|
|
cd "$TESTDIR"/plan
|
|
|
|
|
|
|
|
rm -f "./outputs/out/test"
|
|
|
|
"$DAGGER" --europa up ./outputs/outputs.cue
|
|
|
|
assert [ -f "./outputs/out/test" ]
|
|
|
|
}
|
|
|
|
|
2021-12-23 15:28:36 +01:00
|
|
|
@test "plan/platform" {
|
|
|
|
cd "$TESTDIR"
|
|
|
|
|
|
|
|
# Run with amd64 platform
|
|
|
|
run "$DAGGER" --europa up ./plan/platform/config_platform_linux_amd64.cue
|
|
|
|
|
|
|
|
# Run with arm64 platform
|
|
|
|
run "$DAGGER" --europa up ./plan/platform/config_platform_linux_arm64.cue
|
|
|
|
|
|
|
|
# Run with invalid platform
|
|
|
|
run "$DAGGER" --europa up ./plan/platform/config_platform_failure_invalid_platform.cue
|
|
|
|
assert_failure
|
|
|
|
}
|