2021-12-09 21:07:52 +01:00
|
|
|
setup() {
|
|
|
|
load 'helpers'
|
|
|
|
|
|
|
|
common_setup
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "task: #Pull" {
|
|
|
|
cd "$TESTDIR"/tasks/pull
|
2022-02-21 20:15:52 +01:00
|
|
|
"$DAGGER" up ./pull.cue
|
2021-12-16 04:57:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@test "task: #Pull with auth" {
|
2021-12-23 03:24:59 +01:00
|
|
|
cd "$TESTDIR"
|
2022-02-21 20:15:52 +01:00
|
|
|
"$DAGGER" 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"
|
2022-02-21 20:15:52 +01:00
|
|
|
"$DAGGER" 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
|
2022-02-21 20:15:52 +01:00
|
|
|
"$DAGGER" up
|
2021-12-15 00:32:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@test "task: #WriteFile" {
|
2021-12-15 21:09:20 +01:00
|
|
|
cd "$TESTDIR"/tasks/writefile
|
2022-02-21 20:15:52 +01:00
|
|
|
"$DAGGER" 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
|
2022-02-21 20:15:52 +01:00
|
|
|
run "$DAGGER" up ./writefile_failure_diff_contents.cue
|
2022-03-03 16:58:30 +01:00
|
|
|
assert_failure
|
2021-12-15 21:35:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@test "task: #Exec" {
|
|
|
|
cd "$TESTDIR"/tasks/exec
|
2022-02-21 20:15:52 +01:00
|
|
|
"$DAGGER" up ./args.cue
|
|
|
|
"$DAGGER" up ./env.cue
|
|
|
|
"$DAGGER" up ./env_secret.cue
|
|
|
|
"$DAGGER" up ./hosts.cue
|
2021-12-15 21:35:05 +01:00
|
|
|
|
2022-02-21 20:15:52 +01:00
|
|
|
"$DAGGER" up ./mount_cache.cue
|
|
|
|
"$DAGGER" up ./mount_fs.cue
|
|
|
|
TESTSECRET="hello world" "$DAGGER" up ./mount_secret.cue
|
|
|
|
"$DAGGER" up ./mount_tmp.cue
|
|
|
|
"$DAGGER" up ./mount_service.cue
|
2021-12-15 21:35:05 +01:00
|
|
|
|
2022-02-21 20:15:52 +01:00
|
|
|
"$DAGGER" up ./user.cue
|
|
|
|
"$DAGGER" 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
|
2022-02-21 20:15:52 +01:00
|
|
|
"$DAGGER" up ./copy_exec.cue
|
|
|
|
"$DAGGER" up ./copy_file.cue
|
2021-12-17 20:29:15 +01:00
|
|
|
|
2022-02-21 20:15:52 +01:00
|
|
|
run "$DAGGER" up ./copy_exec_invalid.cue
|
2021-12-17 23:58:52 +01:00
|
|
|
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
|
2022-02-21 20:15:52 +01:00
|
|
|
"$DAGGER" up ./mkdir.cue
|
2021-12-17 20:29:15 +01:00
|
|
|
|
2021-12-17 22:17:06 +01:00
|
|
|
# Create parents
|
2021-12-17 20:29:15 +01:00
|
|
|
cd "$TESTDIR"/tasks/mkdir
|
2022-02-21 20:15:52 +01:00
|
|
|
"$DAGGER" up ./mkdir_parents.cue
|
2021-12-17 20:29:15 +01:00
|
|
|
|
2021-12-17 22:17:06 +01:00
|
|
|
# Disable parents creation
|
2021-12-17 20:29:15 +01:00
|
|
|
cd "$TESTDIR"/tasks/mkdir
|
2022-02-21 20:15:52 +01:00
|
|
|
run "$DAGGER" up ./mkdir_failure_disable_parents.cue
|
2021-12-17 20:29:15 +01:00
|
|
|
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
|
|
|
|
2022-02-21 20:15:52 +01:00
|
|
|
"$DAGGER" up ./dockerfile.cue
|
|
|
|
"$DAGGER" up ./inlined_dockerfile.cue
|
|
|
|
"$DAGGER" up ./inlined_dockerfile_heredoc.cue
|
|
|
|
"$DAGGER" up ./dockerfile_path.cue
|
|
|
|
"$DAGGER" up ./build_args.cue
|
|
|
|
"$DAGGER" up ./image_config.cue
|
|
|
|
"$DAGGER" up ./labels.cue
|
|
|
|
"$DAGGER" up ./platform.cue
|
|
|
|
"$DAGGER" 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
|
2022-02-21 20:15:52 +01:00
|
|
|
"$DAGGER" up ./scratch.cue -l debug
|
|
|
|
"$DAGGER" up ./scratch_build_scratch.cue -l debug
|
|
|
|
"$DAGGER" 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
|
2022-02-21 20:15:52 +01:00
|
|
|
"$DAGGER" up ./subdir_simple.cue
|
2021-12-24 01:18:28 +01:00
|
|
|
|
2022-02-21 20:15:52 +01:00
|
|
|
run "$DAGGER" up ./subdir_invalid_path.cue
|
2021-12-24 01:18:28 +01:00
|
|
|
assert_failure
|
2022-03-03 16:58:30 +01:00
|
|
|
|
2022-02-21 20:15:52 +01:00
|
|
|
run "$DAGGER" up ./subdir_invalid_exec.cue
|
2021-12-24 01:18:28 +01:00
|
|
|
assert_failure
|
|
|
|
}
|
|
|
|
|
2021-12-20 20:47:42 +01:00
|
|
|
@test "task: #GitPull" {
|
2021-12-22 23:29:22 +01:00
|
|
|
cd "$TESTDIR"
|
2022-02-21 20:15:52 +01:00
|
|
|
"$DAGGER" up ./tasks/gitpull/exists.cue
|
|
|
|
"$DAGGER" up ./tasks/gitpull/git_dir.cue
|
|
|
|
"$DAGGER" up ./tasks/gitpull/private_repo.cue
|
2021-12-22 19:58:35 +01:00
|
|
|
|
2022-02-21 20:15:52 +01:00
|
|
|
run "$DAGGER" up ./tasks/gitpull/invalid.cue
|
2021-12-22 19:58:35 +01:00
|
|
|
assert_failure
|
2022-02-21 20:15:52 +01:00
|
|
|
run "$DAGGER" up ./tasks/gitpull/bad_remote.cue
|
2021-12-22 19:58:35 +01:00
|
|
|
assert_failure
|
2022-02-21 20:15:52 +01:00
|
|
|
run "$DAGGER" 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"
|
2022-02-21 20:15:52 +01:00
|
|
|
"$DAGGER" up ./tasks/httpfetch/exist.cue
|
|
|
|
run "$DAGGER" up ./tasks/httpfetch/not_exist.cue
|
2021-12-23 00:56:45 +01:00
|
|
|
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-02-21 20:15:52 +01:00
|
|
|
"$DAGGER" up ./newsecret.cue
|
2021-12-23 17:27:22 +01:00
|
|
|
}
|
2021-12-23 20:23:52 +01:00
|
|
|
|
2022-03-03 16:58:30 +01:00
|
|
|
@test "task: #TrimSecret" {
|
|
|
|
cd "$TESTDIR"/tasks/trimsecret
|
|
|
|
|
|
|
|
"$DAGGER" up ./trimsecret.cue
|
|
|
|
}
|
|
|
|
|
2021-12-23 20:23:52 +01:00
|
|
|
@test "task: #Source" {
|
|
|
|
cd "$TESTDIR"/tasks/source
|
2022-02-21 20:15:52 +01:00
|
|
|
"$DAGGER" up ./source.cue
|
|
|
|
"$DAGGER" up ./source_include_exclude.cue
|
|
|
|
"$DAGGER" up ./source_relative.cue
|
2021-12-23 20:23:52 +01:00
|
|
|
|
2022-02-21 20:15:52 +01:00
|
|
|
run "$DAGGER" up ./source_invalid_path.cue
|
2021-12-23 20:23:52 +01:00
|
|
|
assert_failure
|
|
|
|
|
2022-02-21 20:15:52 +01:00
|
|
|
run "$DAGGER" up ./source_not_exist.cue
|
2021-12-23 20:23:52 +01:00
|
|
|
assert_failure
|
|
|
|
}
|