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"
|
2022-02-21 20:15:52 +01:00
|
|
|
"$DAGGER" up ./plan/hello-europa
|
2021-12-11 00:06:14 +01:00
|
|
|
}
|
|
|
|
|
2021-12-16 20:30:09 +01:00
|
|
|
@test "plan/proxy invalid schema" {
|
2021-12-11 00:06:14 +01:00
|
|
|
cd "$TESTDIR"
|
2022-02-21 20:15:52 +01:00
|
|
|
run "$DAGGER" up ./plan/proxy/invalid_schema.cue
|
2021-12-14 22:29:20 +01:00
|
|
|
assert_failure
|
|
|
|
}
|
|
|
|
|
2022-02-21 20:15:52 +01:00
|
|
|
# TODO/FIXME: this test is broken, it's not asserting that the proxy is not running
|
|
|
|
# @test "plan/proxy invalid value" {
|
|
|
|
# cd "$TESTDIR"
|
|
|
|
# run "$DAGGER" up ./plan/proxy/invalid_value.cue
|
|
|
|
# assert_failure
|
|
|
|
# }
|
2021-12-14 22:29:20 +01:00
|
|
|
|
2021-12-16 20:30:09 +01:00
|
|
|
@test "plan/proxy incomplete unix" {
|
2021-12-14 22:29:20 +01:00
|
|
|
cd "$TESTDIR"
|
2022-02-21 20:15:52 +01:00
|
|
|
run "$DAGGER" up ./plan/proxy/incomplete_unix.cue
|
2021-12-14 22:29:20 +01:00
|
|
|
assert_failure
|
|
|
|
}
|
|
|
|
|
2022-02-21 20:15:52 +01:00
|
|
|
# TODO/FIXME: this test is broken, it's not asserting that the proxy is not running
|
|
|
|
# @test "plan/proxy incomplete service" {
|
|
|
|
# cd "$TESTDIR"
|
|
|
|
# run "$DAGGER" up ./plan/proxy/incomplete_service.cue
|
|
|
|
# assert_output --partial "pipeline was partially executed because of missing inputs"
|
|
|
|
# }
|
2021-12-14 22:29:20 +01:00
|
|
|
|
2021-12-16 20:30:09 +01:00
|
|
|
@test "plan/proxy unix" {
|
2021-12-14 22:29:20 +01:00
|
|
|
cd "$TESTDIR"
|
2022-02-21 20:15:52 +01:00
|
|
|
"$DAGGER" up ./plan/proxy/unix.cue
|
2021-12-16 20:30:09 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@test "plan/inputs/directories exists" {
|
|
|
|
cd "$TESTDIR"
|
2022-02-21 20:15:52 +01:00
|
|
|
"$DAGGER" 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
|
|
|
|
|
2022-02-21 20:15:52 +01:00
|
|
|
"$DAGGER" up ./directories/exists.cue
|
2021-12-23 19:09:26 +01:00
|
|
|
}
|
|
|
|
|
2021-12-17 21:37:20 +01:00
|
|
|
@test "plan/inputs/directories not exists" {
|
|
|
|
cd "$TESTDIR"
|
2022-02-21 20:15:52 +01:00
|
|
|
run "$DAGGER" up ./plan/inputs/directories/not_exists.cue
|
2021-12-17 21:37:20 +01:00
|
|
|
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"
|
2022-02-21 20:15:52 +01:00
|
|
|
run "$DAGGER" up ./plan/inputs/directories/conflicting_values.cue
|
2021-12-17 19:24:50 +01:00
|
|
|
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
|
|
|
}
|
|
|
|
|
2022-01-11 22:39:18 +01:00
|
|
|
@test "plan/inputs/secrets" {
|
2021-12-17 22:41:09 +01:00
|
|
|
cd "$TESTDIR"
|
2022-02-21 20:15:52 +01:00
|
|
|
"$DAGGER" up ./plan/inputs/secrets/exec.cue
|
|
|
|
"$DAGGER" up ./plan/inputs/secrets/exec_relative.cue
|
2022-01-31 01:08:16 +01:00
|
|
|
|
2022-02-21 20:15:52 +01:00
|
|
|
run "$DAGGER" up ./plan/inputs/secrets/invalid_command.cue
|
2021-12-17 22:41:09 +01:00
|
|
|
assert_failure
|
2021-12-20 18:19:21 +01:00
|
|
|
assert_output --partial 'failed: exec: "rtyet": executable file not found'
|
2022-01-31 01:08:16 +01:00
|
|
|
|
2022-02-21 20:15:52 +01:00
|
|
|
run "$DAGGER" up ./plan/inputs/secrets/invalid_command_options.cue
|
2022-01-11 22:39:18 +01:00
|
|
|
assert_failure
|
2022-01-11 23:28:43 +01:00
|
|
|
assert_output --partial 'option'
|
2021-12-17 22:41:09 +01:00
|
|
|
}
|
2021-12-22 15:03:54 +01:00
|
|
|
|
2022-01-04 20:20:01 +01:00
|
|
|
@test "plan/with" {
|
2022-01-04 18:25:32 +01:00
|
|
|
cd "$TESTDIR"
|
2022-02-21 20:15:52 +01:00
|
|
|
"$DAGGER" up --with 'inputs: params: foo:"bar"' ./plan/with/params.cue
|
|
|
|
"$DAGGER" up --with 'actions: verify: env: FOO: "bar"' ./plan/with/actions.cue
|
2022-01-31 01:08:16 +01:00
|
|
|
|
2022-02-21 20:15:52 +01:00
|
|
|
run "$DAGGER" up --with 'inputs: params: foo:1' ./plan/with/params.cue
|
2022-01-04 19:32:26 +01:00
|
|
|
assert_failure
|
|
|
|
assert_output --partial "conflicting values string and 1"
|
2022-01-31 01:08:16 +01:00
|
|
|
|
2022-02-21 20:15:52 +01:00
|
|
|
run "$DAGGER" up ./plan/with/params.cue
|
2022-01-04 19:32:26 +01:00
|
|
|
assert_failure
|
|
|
|
assert_output --partial "actions.verify.env.FOO: non-concrete value string"
|
2022-01-04 18:25:32 +01:00
|
|
|
}
|
|
|
|
|
2022-01-31 01:08:16 +01:00
|
|
|
@test "plan/outputs/directories" {
|
|
|
|
cd "$TESTDIR"/plan/outputs/directories
|
2021-12-22 15:03:54 +01:00
|
|
|
|
|
|
|
rm -f "./out/test"
|
2022-02-21 20:15:52 +01:00
|
|
|
"$DAGGER" up ./outputs.cue
|
2021-12-22 15:03:54 +01:00
|
|
|
assert [ -f "./out/test" ]
|
|
|
|
}
|
2021-12-23 15:28:36 +01:00
|
|
|
|
2022-01-31 01:08:16 +01:00
|
|
|
@test "plan/outputs/directories relative paths" {
|
|
|
|
cd "$TESTDIR"/plan
|
|
|
|
|
|
|
|
rm -f "./outputs/directories/out/test"
|
2022-02-21 20:15:52 +01:00
|
|
|
"$DAGGER" up ./outputs/directories/outputs.cue
|
2022-01-31 01:08:16 +01:00
|
|
|
assert [ -f "./outputs/directories/out/test" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "plan/outputs/files normal usage" {
|
|
|
|
cd "$TESTDIR"/plan/outputs/files
|
|
|
|
|
2022-02-21 20:15:52 +01:00
|
|
|
"$DAGGER" up ./usage.cue
|
2022-01-31 01:08:16 +01:00
|
|
|
|
|
|
|
run ./test.sh
|
|
|
|
assert_output "Hello World!"
|
|
|
|
|
|
|
|
run ls -l "./test.sh"
|
|
|
|
assert_output --partial "-rwxr-x---"
|
|
|
|
|
|
|
|
rm -f "./test.sh"
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "plan/outputs/files relative path" {
|
2021-12-23 19:09:26 +01:00
|
|
|
cd "$TESTDIR"/plan
|
|
|
|
|
2022-02-21 20:15:52 +01:00
|
|
|
"$DAGGER" up ./outputs/files/usage.cue
|
2022-01-31 01:08:16 +01:00
|
|
|
assert [ -f "./outputs/files/test.sh" ]
|
|
|
|
|
|
|
|
rm -f "./outputs/files/test.sh"
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "plan/outputs/files default permissions" {
|
|
|
|
cd "$TESTDIR"/plan/outputs/files
|
|
|
|
|
2022-02-21 20:15:52 +01:00
|
|
|
"$DAGGER" up ./default_permissions.cue
|
2022-01-31 01:08:16 +01:00
|
|
|
|
|
|
|
run ls -l "./test"
|
|
|
|
assert_output --partial "-rw-r--r--"
|
|
|
|
|
|
|
|
rm -f "./test"
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "plan/outputs/files no contents" {
|
|
|
|
cd "$TESTDIR"/plan/outputs/files
|
|
|
|
|
2022-02-21 20:15:52 +01:00
|
|
|
run "$DAGGER" up ./no_contents.cue
|
2022-01-31 01:08:16 +01:00
|
|
|
assert_failure
|
|
|
|
assert_output --partial "contents is not set"
|
|
|
|
|
|
|
|
assert [ ! -f "./test" ]
|
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 20:15:52 +01: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 20:15:52 +01: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 20:15:52 +01:00
|
|
|
run "$DAGGER" up ./plan/platform/config_platform_failure_invalid_platform.cue
|
2021-12-23 15:28:36 +01:00
|
|
|
assert_failure
|
2022-01-31 01:08:16 +01:00
|
|
|
}
|