2021-12-09 21:07:52 +01:00
|
|
|
setup() {
|
|
|
|
load 'helpers'
|
|
|
|
|
|
|
|
common_setup
|
2022-03-09 19:45:46 +01:00
|
|
|
cd "$TESTDIR" || exit
|
2021-12-09 21:07:52 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@test "task: #Pull" {
|
2022-03-09 19:45:46 +01:00
|
|
|
"$DAGGER" "do" -p ./tasks/pull/pull.cue pull
|
|
|
|
"$DAGGER" "do" -p ./tasks/pull/pull_auth.cue pull
|
2021-12-13 17:48:32 +01:00
|
|
|
}
|
|
|
|
|
2021-12-21 02:31:04 +01:00
|
|
|
@test "task: #Push" {
|
2022-03-09 19:45:46 +01:00
|
|
|
"$DAGGER" "do" -p ./tasks/push/push.cue pullContent
|
2021-12-21 02:31:04 +01:00
|
|
|
}
|
|
|
|
|
2021-12-13 17:48:32 +01:00
|
|
|
@test "task: #ReadFile" {
|
2022-03-09 19:45:46 +01:00
|
|
|
"$DAGGER" "do" -p ./tasks/readfile/readfile.cue readfile
|
2021-12-15 00:32:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@test "task: #WriteFile" {
|
2022-03-09 19:45:46 +01:00
|
|
|
"$DAGGER" "do" -p ./tasks/writefile/writefile.cue readfile
|
|
|
|
run "$DAGGER" "do" -p ./tasks/writefile/writefile_failure_diff_contents.cue readfile
|
2022-03-03 16:58:30 +01:00
|
|
|
assert_failure
|
2021-12-15 21:35:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@test "task: #Exec" {
|
2022-03-09 19:45:46 +01:00
|
|
|
cd ./tasks/exec
|
|
|
|
"$DAGGER" "do" -p ./args.cue verify
|
|
|
|
"$DAGGER" "do" -p ./env.cue verify
|
|
|
|
"$DAGGER" "do" -p ./env_secret.cue verify
|
|
|
|
"$DAGGER" "do" -p ./hosts.cue verify
|
2021-12-15 21:35:05 +01:00
|
|
|
|
2022-03-09 19:45:46 +01:00
|
|
|
"$DAGGER" "do" -p ./mount_cache.cue test
|
|
|
|
"$DAGGER" "do" -p ./mount_fs.cue test
|
|
|
|
TESTSECRET="hello world" "$DAGGER" "do" -p ./mount_secret.cue test
|
|
|
|
"$DAGGER" "do" -p ./mount_tmp.cue verify
|
|
|
|
"$DAGGER" "do" -p ./mount_service.cue verify
|
2021-12-15 21:35:05 +01:00
|
|
|
|
2022-03-09 19:45:46 +01:00
|
|
|
"$DAGGER" "do" -p ./user.cue test
|
|
|
|
"$DAGGER" "do" -p ./workdir.cue verify
|
2021-12-16 04:57:44 +01:00
|
|
|
}
|
2021-12-17 23:58:52 +01:00
|
|
|
|
|
|
|
@test "task: #Copy" {
|
2022-03-09 19:45:46 +01:00
|
|
|
"$DAGGER" "do" -p ./tasks/copy/copy_exec.cue test
|
|
|
|
"$DAGGER" "do" -p ./tasks/copy/copy_file.cue test
|
2021-12-17 20:29:15 +01:00
|
|
|
|
2022-03-09 19:45:46 +01:00
|
|
|
run "$DAGGER" "do" -p ./tasks/copy/copy_exec_invalid.cue test
|
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
|
2022-03-09 19:45:46 +01:00
|
|
|
"$DAGGER" "do" -p ./tasks/mkdir/mkdir.cue readChecker
|
2021-12-17 20:29:15 +01:00
|
|
|
|
2021-12-17 22:17:06 +01:00
|
|
|
# Create parents
|
2022-03-09 19:45:46 +01:00
|
|
|
"$DAGGER" "do" -p ./tasks/mkdir/mkdir_parents.cue readChecker
|
2021-12-17 20:29:15 +01:00
|
|
|
|
2021-12-17 22:17:06 +01:00
|
|
|
# Disable parents creation
|
2022-03-09 19:45:46 +01:00
|
|
|
run "$DAGGER" "do" -p ./tasks/mkdir/mkdir_failure_disable_parents.cue readChecker
|
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
|
2022-03-09 19:45:46 +01:00
|
|
|
"$DAGGER" "do" -p ./dockerfile.cue
|
|
|
|
"$DAGGER" "do" -p ./inlined_dockerfile.cue verify
|
|
|
|
"$DAGGER" "do" -p ./inlined_dockerfile_heredoc.cue verify
|
|
|
|
"$DAGGER" "do" -p ./dockerfile_path.cue verify
|
|
|
|
"$DAGGER" "do" -p ./build_args.cue build
|
|
|
|
"$DAGGER" "do" -p ./image_config.cue build
|
|
|
|
"$DAGGER" "do" -p ./labels.cue build
|
|
|
|
"$DAGGER" "do" -p ./platform.cue build
|
|
|
|
"$DAGGER" "do" -p ./build_auth.cue build
|
2021-12-20 19:52:22 +01:00
|
|
|
}
|
2022-03-09 19:45:46 +01:00
|
|
|
|
2021-12-21 17:16:33 +01:00
|
|
|
@test "task: #Scratch" {
|
2022-03-09 19:45:46 +01:00
|
|
|
"$DAGGER" "do" -p ./tasks/scratch/scratch.cue exec
|
|
|
|
"$DAGGER" "do" -p ./tasks/scratch/scratch_build_scratch.cue build
|
|
|
|
"$DAGGER" "do" -p ./tasks/scratch/scratch_writefile.cue readfile
|
2021-12-21 17:16:33 +01:00
|
|
|
}
|
|
|
|
|
2021-12-24 01:18:28 +01:00
|
|
|
@test "task: #Subdir" {
|
2022-03-09 19:45:46 +01:00
|
|
|
"$DAGGER" "do" -p ./tasks/subdir/subdir_simple.cue verify
|
2021-12-24 01:18:28 +01:00
|
|
|
|
2022-03-09 19:45:46 +01:00
|
|
|
run "$DAGGER" "do" -p ./tasks/subdir/subdir_invalid_path.cue verify
|
2021-12-24 01:18:28 +01:00
|
|
|
assert_failure
|
2022-03-03 16:58:30 +01:00
|
|
|
|
2022-03-09 19:45:46 +01:00
|
|
|
run "$DAGGER" "do" -p ./tasks/subdir/subdir_invalid_exec.cue verify
|
2021-12-24 01:18:28 +01:00
|
|
|
assert_failure
|
|
|
|
}
|
|
|
|
|
2021-12-20 20:47:42 +01:00
|
|
|
@test "task: #GitPull" {
|
2022-03-09 19:45:46 +01:00
|
|
|
"$DAGGER" "do" -p ./tasks/gitpull/exists.cue gitPull
|
|
|
|
"$DAGGER" "do" -p ./tasks/gitpull/git_dir.cue verify
|
|
|
|
"$DAGGER" "do" -p ./tasks/gitpull/private_repo.cue testContent
|
2021-12-22 19:58:35 +01:00
|
|
|
|
2022-03-09 19:45:46 +01:00
|
|
|
run "$DAGGER" "do" -p ./tasks/gitpull/invalid.cue invalid
|
2021-12-22 19:58:35 +01:00
|
|
|
assert_failure
|
2022-03-09 19:45:46 +01:00
|
|
|
run "$DAGGER" "do" -p ./tasks/gitpull/bad_remote.cue badremote
|
2021-12-22 19:58:35 +01:00
|
|
|
assert_failure
|
2022-03-09 19:45:46 +01:00
|
|
|
run "$DAGGER" "do" -p ./tasks/gitpull/bad_ref.cue badref
|
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" {
|
2022-03-09 19:45:46 +01:00
|
|
|
"$DAGGER" "do" -p ./tasks/httpfetch/exist.cue fetch
|
|
|
|
run "$DAGGER" "do" -p ./tasks/httpfetch/not_exist.cue fetch
|
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" {
|
2022-03-09 19:45:46 +01:00
|
|
|
"$DAGGER" "do" -p ./tasks/newsecret/newsecret.cue verify
|
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" {
|
2022-03-09 19:45:46 +01:00
|
|
|
"$DAGGER" "do" -p ./tasks/trimsecret/trimsecret.cue verify
|
2022-03-03 16:58:30 +01:00
|
|
|
}
|
|
|
|
|
2021-12-23 20:23:52 +01:00
|
|
|
@test "task: #Source" {
|
2022-03-09 19:45:46 +01:00
|
|
|
"$DAGGER" "do" -p ./tasks/source/source.cue test
|
|
|
|
"$DAGGER" "do" -p ./tasks/source/source_include_exclude.cue test
|
|
|
|
"$DAGGER" "do" -p ./tasks/source/source_relative.cue verifyHello
|
2021-12-23 20:23:52 +01:00
|
|
|
|
2022-03-09 19:45:46 +01:00
|
|
|
run "$DAGGER" "do" -p ./tasks/source/source_invalid_path.cue source
|
2021-12-23 20:23:52 +01:00
|
|
|
assert_failure
|
|
|
|
|
2022-03-09 19:45:46 +01:00
|
|
|
run "$DAGGER" "do" -p ./tasks/source/source_not_exist.cue source
|
2021-12-23 20:23:52 +01:00
|
|
|
assert_failure
|
|
|
|
}
|