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
|
2022-02-05 00:28:20 +01:00
|
|
|
"$DAGGER" --europa up ./env_secret.cue
|
2021-12-15 21:35:05 +01:00
|
|
|
"$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
|
|
|
}
|
|
|
|
|
2022-01-12 22:00:39 +01:00
|
|
|
@test "task: #Dockerfile" {
|
|
|
|
cd "$TESTDIR"/tasks/dockerfile
|
2021-12-20 19:52:22 +01:00
|
|
|
|
|
|
|
"$DAGGER" --europa up ./dockerfile.cue
|
|
|
|
"$DAGGER" --europa up ./inlined_dockerfile.cue
|
2022-01-13 23:35:37 +01:00
|
|
|
"$DAGGER" --europa up ./inlined_dockerfile_heredoc.cue
|
2021-12-20 19:52:22 +01:00
|
|
|
"$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
|
2022-01-13 19:31:08 +01:00
|
|
|
"$DAGGER" --europa up ./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
|
2022-01-08 00:21:06 +01:00
|
|
|
"$DAGGER" --europa up ./scratch_build_scratch.cue -l debug
|
|
|
|
"$DAGGER" --europa up ./scratch_writefile.cue -l debug
|
2021-12-21 17:16:33 +01:00
|
|
|
}
|
|
|
|
|
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
|
|
|
|
2022-01-07 20:52:16 +01:00
|
|
|
@test "task: #NewSecret" {
|
|
|
|
cd "$TESTDIR"/tasks/newsecret
|
2021-12-23 17:27:22 +01:00
|
|
|
|
2022-01-07 20:52:16 +01:00
|
|
|
"$DAGGER" --europa up ./newsecret.cue
|
2021-12-23 17:27:22 +01:00
|
|
|
}
|
2021-12-23 20:23:52 +01:00
|
|
|
|
|
|
|
@test "task: #Source" {
|
|
|
|
cd "$TESTDIR"/tasks/source
|
|
|
|
"$DAGGER" --europa up ./source.cue
|
|
|
|
"$DAGGER" --europa up ./source_include_exclude.cue
|
2022-01-28 22:53:43 +01:00
|
|
|
"$DAGGER" --europa up ./source_relative.cue
|
2021-12-23 20:23:52 +01:00
|
|
|
|
|
|
|
run "$DAGGER" --europa up ./source_invalid_path.cue
|
|
|
|
assert_failure
|
|
|
|
|
|
|
|
run "$DAGGER" --europa up ./source_not_exist.cue
|
|
|
|
assert_failure
|
|
|
|
}
|