diff --git a/tests/plan.bats b/tests/plan.bats index a520513b..6c60fca7 100644 --- a/tests/plan.bats +++ b/tests/plan.bats @@ -7,88 +7,90 @@ setup() { @test "plan/hello" { # Europa loader handles the cwd differently, therefore we need to CD into the tree at or below the parent of cue.mod cd "$TESTDIR" - "$DAGGER" --europa up ./plan/hello-europa + "$DAGGER" up ./plan/hello-europa } @test "plan/proxy invalid schema" { cd "$TESTDIR" - run "$DAGGER" --europa up ./plan/proxy/invalid_schema.cue + run "$DAGGER" up ./plan/proxy/invalid_schema.cue assert_failure } -@test "plan/proxy invalid value" { - cd "$TESTDIR" - run "$DAGGER" --europa up ./plan/proxy/invalid_value.cue - assert_failure -} +# 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 +# } @test "plan/proxy incomplete unix" { cd "$TESTDIR" - run "$DAGGER" --europa up ./plan/proxy/incomplete_unix.cue + run "$DAGGER" up ./plan/proxy/incomplete_unix.cue assert_failure } -@test "plan/proxy incomplete service" { - cd "$TESTDIR" - run "$DAGGER" --europa up ./plan/proxy/incomplete_service.cue - assert_output --partial "pipeline was partially executed because of missing inputs" -} +# 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" +# } @test "plan/proxy unix" { cd "$TESTDIR" - "$DAGGER" --europa up ./plan/proxy/unix.cue + "$DAGGER" up ./plan/proxy/unix.cue } @test "plan/inputs/directories exists" { cd "$TESTDIR" - "$DAGGER" --europa up ./plan/inputs/directories/exists.cue + "$DAGGER" up ./plan/inputs/directories/exists.cue } @test "plan/inputs/directories relative directories" { cd "$TESTDIR" cd "$TESTDIR"/plan/inputs - "$DAGGER" --europa up ./directories/exists.cue + "$DAGGER" up ./directories/exists.cue } @test "plan/inputs/directories not exists" { cd "$TESTDIR" - run "$DAGGER" --europa up ./plan/inputs/directories/not_exists.cue + run "$DAGGER" up ./plan/inputs/directories/not_exists.cue assert_failure assert_output --partial 'fasdfsdfs" does not exist' } @test "plan/inputs/directories conflicting values" { cd "$TESTDIR" - run "$DAGGER" --europa up ./plan/inputs/directories/conflicting_values.cue + run "$DAGGER" up ./plan/inputs/directories/conflicting_values.cue assert_failure assert_output --partial 'conflicting values "local directory" and "local dfsadf"' } @test "plan/inputs/secrets" { cd "$TESTDIR" - "$DAGGER" --europa up ./plan/inputs/secrets/exec.cue - "$DAGGER" --europa up ./plan/inputs/secrets/exec_relative.cue + "$DAGGER" up ./plan/inputs/secrets/exec.cue + "$DAGGER" up ./plan/inputs/secrets/exec_relative.cue - run "$DAGGER" --europa up ./plan/inputs/secrets/invalid_command.cue + run "$DAGGER" up ./plan/inputs/secrets/invalid_command.cue assert_failure assert_output --partial 'failed: exec: "rtyet": executable file not found' - run "$DAGGER" --europa up ./plan/inputs/secrets/invalid_command_options.cue + run "$DAGGER" up ./plan/inputs/secrets/invalid_command_options.cue assert_failure assert_output --partial 'option' } @test "plan/with" { cd "$TESTDIR" - "$DAGGER" --europa up --with 'inputs: params: foo:"bar"' ./plan/with/params.cue - "$DAGGER" --europa up --with 'actions: verify: env: FOO: "bar"' ./plan/with/actions.cue + "$DAGGER" up --with 'inputs: params: foo:"bar"' ./plan/with/params.cue + "$DAGGER" up --with 'actions: verify: env: FOO: "bar"' ./plan/with/actions.cue - run "$DAGGER" --europa up --with 'inputs: params: foo:1' ./plan/with/params.cue + run "$DAGGER" up --with 'inputs: params: foo:1' ./plan/with/params.cue assert_failure assert_output --partial "conflicting values string and 1" - run "$DAGGER" --europa up ./plan/with/params.cue + run "$DAGGER" up ./plan/with/params.cue assert_failure assert_output --partial "actions.verify.env.FOO: non-concrete value string" } @@ -97,7 +99,7 @@ setup() { cd "$TESTDIR"/plan/outputs/directories rm -f "./out/test" - "$DAGGER" --europa up ./outputs.cue + "$DAGGER" up ./outputs.cue assert [ -f "./out/test" ] } @@ -105,14 +107,14 @@ setup() { cd "$TESTDIR"/plan rm -f "./outputs/directories/out/test" - "$DAGGER" --europa up ./outputs/directories/outputs.cue + "$DAGGER" up ./outputs/directories/outputs.cue assert [ -f "./outputs/directories/out/test" ] } @test "plan/outputs/files normal usage" { cd "$TESTDIR"/plan/outputs/files - "$DAGGER" --europa up ./usage.cue + "$DAGGER" up ./usage.cue run ./test.sh assert_output "Hello World!" @@ -126,7 +128,7 @@ setup() { @test "plan/outputs/files relative path" { cd "$TESTDIR"/plan - "$DAGGER" --europa up ./outputs/files/usage.cue + "$DAGGER" up ./outputs/files/usage.cue assert [ -f "./outputs/files/test.sh" ] rm -f "./outputs/files/test.sh" @@ -135,7 +137,7 @@ setup() { @test "plan/outputs/files default permissions" { cd "$TESTDIR"/plan/outputs/files - "$DAGGER" --europa up ./default_permissions.cue + "$DAGGER" up ./default_permissions.cue run ls -l "./test" assert_output --partial "-rw-r--r--" @@ -146,7 +148,7 @@ setup() { @test "plan/outputs/files no contents" { cd "$TESTDIR"/plan/outputs/files - run "$DAGGER" --europa up ./no_contents.cue + run "$DAGGER" up ./no_contents.cue assert_failure assert_output --partial "contents is not set" @@ -157,12 +159,12 @@ setup() { cd "$TESTDIR" # Run with amd64 platform - run "$DAGGER" --europa up ./plan/platform/config_platform_linux_amd64.cue + run "$DAGGER" up ./plan/platform/config_platform_linux_amd64.cue # Run with arm64 platform - run "$DAGGER" --europa up ./plan/platform/config_platform_linux_arm64.cue + run "$DAGGER" up ./plan/platform/config_platform_linux_arm64.cue # Run with invalid platform - run "$DAGGER" --europa up ./plan/platform/config_platform_failure_invalid_platform.cue + run "$DAGGER" up ./plan/platform/config_platform_failure_invalid_platform.cue assert_failure } diff --git a/tests/tasks.bats b/tests/tasks.bats index 462369e5..48475701 100644 --- a/tests/tasks.bats +++ b/tests/tasks.bats @@ -6,143 +6,143 @@ setup() { @test "task: #Pull" { cd "$TESTDIR"/tasks/pull - "$DAGGER" --europa up ./pull.cue + "$DAGGER" up ./pull.cue } @test "task: #Pull with auth" { cd "$TESTDIR" - "$DAGGER" --europa up ./tasks/pull/pull_auth.cue + "$DAGGER" up ./tasks/pull/pull_auth.cue } @test "task: #Push" { cd "$TESTDIR" - "$DAGGER" --europa up ./tasks/push/push.cue + "$DAGGER" up ./tasks/push/push.cue } @test "task: #ReadFile" { cd "$TESTDIR"/tasks/readfile - "$DAGGER" --europa up + "$DAGGER" up } @test "task: #WriteFile" { cd "$TESTDIR"/tasks/writefile - "$DAGGER" --europa up ./writefile.cue + "$DAGGER" up ./writefile.cue } @test "task: #WriteFile failure: different contents" { cd "$TESTDIR"/tasks/writefile - run "$DAGGER" --europa up ./writefile_failure_diff_contents.cue + run "$DAGGER" up ./writefile_failure_diff_contents.cue assert_failure } @test "task: #Exec" { cd "$TESTDIR"/tasks/exec - "$DAGGER" --europa up ./args.cue - "$DAGGER" --europa up ./env.cue - "$DAGGER" --europa up ./env_secret.cue - "$DAGGER" --europa up ./hosts.cue + "$DAGGER" up ./args.cue + "$DAGGER" up ./env.cue + "$DAGGER" up ./env_secret.cue + "$DAGGER" up ./hosts.cue - "$DAGGER" --europa up ./mount_cache.cue - "$DAGGER" --europa up ./mount_fs.cue - TESTSECRET="hello world" "$DAGGER" --europa up ./mount_secret.cue - "$DAGGER" --europa up ./mount_tmp.cue - "$DAGGER" --europa up ./mount_service.cue + "$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 - "$DAGGER" --europa up ./user.cue - "$DAGGER" --europa up ./workdir.cue + "$DAGGER" up ./user.cue + "$DAGGER" up ./workdir.cue } @test "task: #Copy" { cd "$TESTDIR"/tasks/copy - "$DAGGER" --europa up ./copy_exec.cue - "$DAGGER" --europa up ./copy_file.cue + "$DAGGER" up ./copy_exec.cue + "$DAGGER" up ./copy_file.cue - run "$DAGGER" --europa up ./copy_exec_invalid.cue + run "$DAGGER" up ./copy_exec_invalid.cue assert_failure } @test "task: #Mkdir" { # Make directory cd "$TESTDIR"/tasks/mkdir - "$DAGGER" --europa up ./mkdir.cue + "$DAGGER" up ./mkdir.cue # Create parents cd "$TESTDIR"/tasks/mkdir - "$DAGGER" --europa up ./mkdir_parents.cue + "$DAGGER" up ./mkdir_parents.cue # Disable parents creation cd "$TESTDIR"/tasks/mkdir - run "$DAGGER" --europa up ./mkdir_failure_disable_parents.cue + run "$DAGGER" up ./mkdir_failure_disable_parents.cue assert_failure } @test "task: #Dockerfile" { cd "$TESTDIR"/tasks/dockerfile - "$DAGGER" --europa up ./dockerfile.cue - "$DAGGER" --europa up ./inlined_dockerfile.cue - "$DAGGER" --europa up ./inlined_dockerfile_heredoc.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 - "$DAGGER" --europa up ./build_auth.cue + "$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 } @test "task: #Scratch" { cd "$TESTDIR"/tasks/scratch - "$DAGGER" --europa up ./scratch.cue -l debug - "$DAGGER" --europa up ./scratch_build_scratch.cue -l debug - "$DAGGER" --europa up ./scratch_writefile.cue -l debug + "$DAGGER" up ./scratch.cue -l debug + "$DAGGER" up ./scratch_build_scratch.cue -l debug + "$DAGGER" up ./scratch_writefile.cue -l debug } @test "task: #Subdir" { cd "$TESTDIR"/tasks/subdir - "$DAGGER" --europa up ./subdir_simple.cue + "$DAGGER" up ./subdir_simple.cue - run "$DAGGER" --europa up ./subdir_invalid_path.cue + run "$DAGGER" up ./subdir_invalid_path.cue assert_failure - run "$DAGGER" --europa up ./subdir_invalid_exec.cue + run "$DAGGER" up ./subdir_invalid_exec.cue assert_failure } @test "task: #GitPull" { cd "$TESTDIR" - "$DAGGER" --europa up ./tasks/gitpull/exists.cue - "$DAGGER" --europa up ./tasks/gitpull/git_dir.cue - "$DAGGER" --europa up ./tasks/gitpull/private_repo.cue + "$DAGGER" up ./tasks/gitpull/exists.cue + "$DAGGER" up ./tasks/gitpull/git_dir.cue + "$DAGGER" up ./tasks/gitpull/private_repo.cue - run "$DAGGER" --europa up ./tasks/gitpull/invalid.cue + run "$DAGGER" up ./tasks/gitpull/invalid.cue assert_failure - run "$DAGGER" --europa up ./tasks/gitpull/bad_remote.cue + run "$DAGGER" up ./tasks/gitpull/bad_remote.cue assert_failure - run "$DAGGER" --europa up ./tasks/gitpull/bad_ref.cue + run "$DAGGER" up ./tasks/gitpull/bad_ref.cue assert_failure } @test "task: #HTTPFetch" { cd "$TESTDIR" - "$DAGGER" --europa up ./tasks/httpfetch/exist.cue - run "$DAGGER" --europa up ./tasks/httpfetch/not_exist.cue + "$DAGGER" up ./tasks/httpfetch/exist.cue + run "$DAGGER" up ./tasks/httpfetch/not_exist.cue assert_failure } @test "task: #NewSecret" { cd "$TESTDIR"/tasks/newsecret - "$DAGGER" --europa up ./newsecret.cue + "$DAGGER" up ./newsecret.cue } @test "task: #Source" { cd "$TESTDIR"/tasks/source - "$DAGGER" --europa up ./source.cue - "$DAGGER" --europa up ./source_include_exclude.cue - "$DAGGER" --europa up ./source_relative.cue + "$DAGGER" up ./source.cue + "$DAGGER" up ./source_include_exclude.cue + "$DAGGER" up ./source_relative.cue - run "$DAGGER" --europa up ./source_invalid_path.cue + run "$DAGGER" up ./source_invalid_path.cue assert_failure - run "$DAGGER" --europa up ./source_not_exist.cue + run "$DAGGER" up ./source_not_exist.cue assert_failure }