2021-12-09 21:07:52 +01:00
|
|
|
setup() {
|
|
|
|
load 'helpers'
|
|
|
|
|
|
|
|
common_setup
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "task: #Pull" {
|
|
|
|
cd "$TESTDIR"/tasks/pull
|
2021-12-16 04:57:44 +01:00
|
|
|
"$DAGGER" --europa up ./pull.cue
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "task: #Pull with auth" {
|
2021-12-23 03:24:59 +01:00
|
|
|
cd "$TESTDIR"
|
|
|
|
"$DAGGER" --europa up ./tasks/pull/pull_auth.cue
|
2021-12-13 17:48:32 +01:00
|
|
|
}
|
|
|
|
|
2021-12-21 02:31:04 +01:00
|
|
|
@test "task: #Push" {
|
2021-12-23 03:24:59 +01:00
|
|
|
cd "$TESTDIR"
|
|
|
|
"$DAGGER" --europa up ./tasks/push/push.cue
|
2021-12-21 02:31:04 +01:00
|
|
|
}
|
|
|
|
|
2021-12-13 17:48:32 +01:00
|
|
|
@test "task: #ReadFile" {
|
|
|
|
cd "$TESTDIR"/tasks/readfile
|
2021-12-16 21:42:28 +01:00
|
|
|
"$DAGGER" --europa up
|
2021-12-15 00:32:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@test "task: #WriteFile" {
|
2021-12-15 21:09:20 +01:00
|
|
|
cd "$TESTDIR"/tasks/writefile
|
2021-12-16 21:42:28 +01:00
|
|
|
"$DAGGER" --europa up ./writefile.cue
|
2021-12-15 00:32:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@test "task: #WriteFile failure: different contents" {
|
2021-12-15 21:09:20 +01:00
|
|
|
cd "$TESTDIR"/tasks/writefile
|
2021-12-16 21:42:28 +01:00
|
|
|
run "$DAGGER" --europa up ./writefile_failure_diff_contents.cue
|
2021-12-15 00:32:31 +01:00
|
|
|
assert_failure
|
2021-12-15 21:35:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@test "task: #Exec" {
|
|
|
|
cd "$TESTDIR"/tasks/exec
|
|
|
|
"$DAGGER" --europa up ./args.cue
|
|
|
|
"$DAGGER" --europa up ./env.cue
|
|
|
|
"$DAGGER" --europa up ./hosts.cue
|
|
|
|
|
2021-12-21 14:33:25 +01:00
|
|
|
"$DAGGER" --europa up ./mount_cache.cue
|
2021-12-15 21:35:05 +01:00
|
|
|
"$DAGGER" --europa up ./mount_fs.cue
|
|
|
|
TESTSECRET="hello world" "$DAGGER" --europa up ./mount_secret.cue
|
|
|
|
"$DAGGER" --europa up ./mount_tmp.cue
|
2021-12-17 15:39:32 +01:00
|
|
|
"$DAGGER" --europa up ./mount_service.cue
|
2021-12-15 21:35:05 +01:00
|
|
|
|
|
|
|
"$DAGGER" --europa up ./user.cue
|
|
|
|
"$DAGGER" --europa up ./workdir.cue
|
2021-12-16 04:57:44 +01:00
|
|
|
}
|
2021-12-17 23:58:52 +01:00
|
|
|
|
|
|
|
@test "task: #Copy" {
|
|
|
|
cd "$TESTDIR"/tasks/copy
|
|
|
|
"$DAGGER" --europa up ./copy_exec.cue
|
|
|
|
"$DAGGER" --europa up ./copy_file.cue
|
2021-12-17 20:29:15 +01:00
|
|
|
|
2021-12-17 23:58:52 +01:00
|
|
|
run "$DAGGER" --europa up ./copy_exec_invalid.cue
|
|
|
|
assert_failure
|
|
|
|
}
|
2021-12-17 20:29:15 +01:00
|
|
|
|
|
|
|
@test "task: #Mkdir" {
|
2021-12-17 22:17:06 +01:00
|
|
|
# Make directory
|
2021-12-17 20:29:15 +01:00
|
|
|
cd "$TESTDIR"/tasks/mkdir
|
|
|
|
"$DAGGER" --europa up ./mkdir.cue
|
|
|
|
|
2021-12-17 22:17:06 +01:00
|
|
|
# Create parents
|
2021-12-17 20:29:15 +01:00
|
|
|
cd "$TESTDIR"/tasks/mkdir
|
|
|
|
"$DAGGER" --europa up ./mkdir_parents.cue
|
|
|
|
|
2021-12-17 22:17:06 +01:00
|
|
|
# Disable parents creation
|
2021-12-17 20:29:15 +01:00
|
|
|
cd "$TESTDIR"/tasks/mkdir
|
|
|
|
run "$DAGGER" --europa up ./mkdir_failure_disable_parents.cue
|
|
|
|
assert_failure
|
2021-12-20 19:52:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@test "task: #Build" {
|
|
|
|
cd "$TESTDIR"/tasks/build
|
|
|
|
|
|
|
|
"$DAGGER" --europa up ./dockerfile.cue
|
|
|
|
"$DAGGER" --europa up ./inlined_dockerfile.cue
|
|
|
|
"$DAGGER" --europa up ./dockerfile_path.cue
|
|
|
|
"$DAGGER" --europa up ./build_args.cue
|
|
|
|
"$DAGGER" --europa up ./image_config.cue
|
|
|
|
"$DAGGER" --europa up ./labels.cue
|
|
|
|
"$DAGGER" --europa up ./platform.cue
|
2021-12-21 14:16:33 +01:00
|
|
|
|
2021-12-23 03:24:59 +01:00
|
|
|
cd "$TESTDIR"
|
|
|
|
"$DAGGER" --europa up ./tasks/build/build_auth.cue
|
2021-12-20 19:52:22 +01:00
|
|
|
}
|
2021-12-21 17:16:33 +01:00
|
|
|
@test "task: #Scratch" {
|
|
|
|
cd "$TESTDIR"/tasks/scratch
|
|
|
|
"$DAGGER" --europa up ./scratch.cue -l debug
|
|
|
|
}
|
|
|
|
|
2021-12-24 01:18:28 +01:00
|
|
|
@test "task: #Subdir" {
|
|
|
|
cd "$TESTDIR"/tasks/subdir
|
|
|
|
"$DAGGER" --europa up ./subdir_simple.cue
|
|
|
|
|
|
|
|
run "$DAGGER" --europa up ./subdir_invalid_path.cue
|
|
|
|
assert_failure
|
|
|
|
|
|
|
|
run "$DAGGER" --europa up ./subdir_invalid_exec.cue
|
|
|
|
assert_failure
|
|
|
|
}
|
|
|
|
|
2021-12-20 20:47:42 +01:00
|
|
|
@test "task: #GitPull" {
|
2021-12-22 23:29:22 +01:00
|
|
|
cd "$TESTDIR"
|
2021-12-23 15:38:12 +01:00
|
|
|
"$DAGGER" --europa up ./tasks/gitpull/exists.cue
|
|
|
|
"$DAGGER" --europa up ./tasks/gitpull/git_dir.cue
|
|
|
|
"$DAGGER" --europa up ./tasks/gitpull/private_repo.cue
|
2021-12-22 19:58:35 +01:00
|
|
|
|
2021-12-23 15:38:12 +01:00
|
|
|
run "$DAGGER" --europa up ./tasks/gitpull/invalid.cue
|
2021-12-22 19:58:35 +01:00
|
|
|
assert_failure
|
2021-12-23 15:38:12 +01:00
|
|
|
run "$DAGGER" --europa up ./tasks/gitpull/bad_remote.cue
|
2021-12-22 19:58:35 +01:00
|
|
|
assert_failure
|
2021-12-23 15:38:12 +01:00
|
|
|
run "$DAGGER" --europa up ./tasks/gitpull/bad_ref.cue
|
2021-12-22 19:58:35 +01:00
|
|
|
assert_failure
|
2021-12-23 00:56:45 +01:00
|
|
|
}
|
2021-12-20 22:08:05 +01:00
|
|
|
|
2021-12-23 00:56:45 +01:00
|
|
|
@test "task: #HTTPFetch" {
|
|
|
|
cd "$TESTDIR"
|
|
|
|
"$DAGGER" --europa up ./tasks/httpfetch/exist.cue
|
|
|
|
run "$DAGGER" --europa up ./tasks/httpfetch/not_exist.cue
|
|
|
|
assert_failure
|
2021-12-20 20:47:42 +01:00
|
|
|
}
|
2021-12-23 17:27:22 +01:00
|
|
|
|
|
|
|
@test "task: #LoadSecret" {
|
|
|
|
cd "$TESTDIR"/tasks/loadsecret
|
|
|
|
|
|
|
|
"$DAGGER" --europa up ./loadsecret.cue
|
|
|
|
}
|