diff --git a/tests/compute/input/default/main.cue b/tests/compute/input/default/main.cue deleted file mode 100644 index fef29dac..00000000 --- a/tests/compute/input/default/main.cue +++ /dev/null @@ -1,26 +0,0 @@ -package testing - -import "alpha.dagger.io/dagger/op" - -X1=in: string | *"default input" - -test: { - string - - #up: [ - op.#FetchContainer & { - ref: "alpine" - }, - op.#Exec & { - args: ["sh", "-c", """ - echo -n "received: \(X1)" > /out - """] - // XXX Blocked by https://github.com/blocklayerhq/dagger/issues/19 - dir: "/" - }, - op.#Export & { - source: "/out" - format: "string" - }, - ] -} diff --git a/tests/compute/input/simple/main.cue b/tests/compute/input/simple/main.cue deleted file mode 100644 index 26ef7266..00000000 --- a/tests/compute/input/simple/main.cue +++ /dev/null @@ -1,26 +0,0 @@ -package testing - -import "alpha.dagger.io/dagger/op" - -X1=in: string - -test: { - string - - #up: [ - op.#FetchContainer & { - ref: "alpine" - }, - op.#Exec & { - args: ["sh", "-c", """ - echo -n "received: \(X1)" > /out - """] - // XXX Blocked by https://github.com/blocklayerhq/dagger/issues/19 - dir: "/" - }, - op.#Export & { - source: "/out" - format: "string" - }, - ] -} diff --git a/tests/compute/success/overload/wrapped/cue.mod/module.cue b/tests/compute/success/overload/wrapped/cue.mod/module.cue deleted file mode 100644 index f8af9cef..00000000 --- a/tests/compute/success/overload/wrapped/cue.mod/module.cue +++ /dev/null @@ -1 +0,0 @@ -module: "" diff --git a/tests/compute/success/overload/wrapped/cue.mod/pkg/.gitignore b/tests/compute/success/overload/wrapped/cue.mod/pkg/.gitignore deleted file mode 100644 index a572e9ee..00000000 --- a/tests/compute/success/overload/wrapped/cue.mod/pkg/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# dagger universe -alpha.dagger.io diff --git a/tests/compute/success/simple/cue.mod/module.cue b/tests/compute/success/simple/cue.mod/module.cue deleted file mode 100644 index f8af9cef..00000000 --- a/tests/compute/success/simple/cue.mod/module.cue +++ /dev/null @@ -1 +0,0 @@ -module: "" diff --git a/tests/compute/success/simple/cue.mod/pkg/.gitignore b/tests/compute/success/simple/cue.mod/pkg/.gitignore deleted file mode 100644 index a572e9ee..00000000 --- a/tests/compute/success/simple/cue.mod/pkg/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# dagger universe -alpha.dagger.io diff --git a/tests/core.bats b/tests/core.bats index 04e5c88d..b0aba9bb 100644 --- a/tests/core.bats +++ b/tests/core.bats @@ -46,98 +46,68 @@ setup() { } -@test "compute: simple" { - run "$DAGGER" compute "$TESTDIR"/compute/invalid/string +@test "core: simple" { + run "$DAGGER" compute "$TESTDIR"/core/compute/invalid/string assert_failure - run "$DAGGER" compute "$TESTDIR"/compute/invalid/bool + run "$DAGGER" compute "$TESTDIR"/core/compute/invalid/bool assert_failure - run "$DAGGER" compute "$TESTDIR"/compute/invalid/int + run "$DAGGER" compute "$TESTDIR"/core/compute/invalid/int assert_failure - run "$DAGGER" compute "$TESTDIR"/compute/invalid/struct + run "$DAGGER" compute "$TESTDIR"/core/compute/invalid/struct assert_failure - run "$DAGGER" compute "$TESTDIR"/compute/success/noop + run "$DAGGER" compute "$TESTDIR"/core/compute/success/noop assert_success assert_line '{"empty":{}}' - run "$DAGGER" compute "$TESTDIR"/compute/success/simple + run "$DAGGER" compute "$TESTDIR"/core/compute/success/simple assert_success assert_line '{}' - run "$DAGGER" compute "$TESTDIR"/compute/success/overload/flat + run "$DAGGER" compute "$TESTDIR"/core/compute/success/overload/flat assert_success - run "$DAGGER" compute "$TESTDIR"/compute/success/overload/wrapped + run "$DAGGER" compute "$TESTDIR"/core/compute/success/overload/wrapped assert_success - run "$DAGGER" compute "$TESTDIR"/compute/success/exec-nocache + run "$DAGGER" compute "$TESTDIR"/core/compute/success/exec-nocache assert_success } -@test "compute: dependencies" { - run "$DAGGER" compute "$TESTDIR"/compute/dependencies/simple +@test "core: dependencies" { + run "$DAGGER" compute "$TESTDIR"/core/dependencies/simple assert_success assert_line '{"A":{"result":"from A"},"B":{"result":"dependency from A"}}' - run "$DAGGER" compute "$TESTDIR"/compute/dependencies/interpolation + run "$DAGGER" compute "$TESTDIR"/core/dependencies/interpolation assert_success assert_line '{"A":{"result":"from A"},"B":{"result":"dependency from A"}}' - run "$DAGGER" compute "$TESTDIR"/compute/dependencies/unmarshal + run "$DAGGER" compute "$TESTDIR"/core/dependencies/unmarshal assert_success assert_line '{"A":"{\"hello\": \"world\"}\n","B":{"result":"unmarshalled.hello=world"},"unmarshalled":{"hello":"world"}}' } -@test "compute: inputs" { - run "$DAGGER" compute "$TESTDIR"/compute/input/simple - assert_success - assert_line '{}' - - run "$DAGGER" compute --input-string 'in=foobar' "$TESTDIR"/compute/input/simple - assert_success - assert_line '{"in":"foobar","test":"received: foobar"}' - - run "$DAGGER" compute "$TESTDIR"/compute/input/default - assert_success - assert_line '{"in":"default input","test":"received: default input"}' - - run "$DAGGER" compute --input-string 'in=foobar' "$TESTDIR"/compute/input/default - assert_success - assert_line '{"in":"foobar","test":"received: foobar"}' - - run "$DAGGER" compute --input-string=foobar "$TESTDIR"/compute/input/default - assert_failure - assert_output --partial 'failed to parse input: input-string' - - run "$DAGGER" compute --input-dir=foobar "$TESTDIR"/compute/input/default - assert_failure - assert_output --partial 'failed to parse input: input-dir' - - run "$DAGGER" compute --input-git=foobar "$TESTDIR"/compute/input/default - assert_failure - assert_output --partial 'failed to parse input: input-git' -} - -@test "compute: secrets" { +@test "core: secrets" { # secrets used as environment variables must fail - run "$DAGGER" compute "$TESTDIR"/compute/secrets/invalid/env + run "$DAGGER" compute "$TESTDIR"/core/secrets/invalid/env assert_failure assert_line --partial "conflicting values" # strings passed as secrets must fail - run "$DAGGER" compute "$TESTDIR"/compute/secrets/invalid/string + run "$DAGGER" compute "$TESTDIR"/core/secrets/invalid/string assert_failure # Setting a text input for a secret value should fail - run "$DAGGER" compute --input-string 'mySecret=SecretValue' "$TESTDIR"/compute/secrets/simple + run "$DAGGER" compute --input-string 'mySecret=SecretValue' "$TESTDIR"/core/secrets/simple assert_failure # Now test with an actual secret and make sure it works "$DAGGER" init - dagger_new_with_plan secrets "$TESTDIR"/compute/secrets/simple + dagger_new_with_plan secrets "$TESTDIR"/core/secrets/simple "$DAGGER" input secret mySecret SecretValue run "$DAGGER" up assert_success @@ -176,6 +146,6 @@ setup() { "$DAGGER" -e test-arm up --no-cache } -@test "compute: exclude" { - "$DAGGER" up --project "$TESTDIR"/compute/exclude +@test "core: exclude" { + "$DAGGER" up --project "$TESTDIR"/core/exclude } diff --git a/tests/compute/dependencies/interpolation/cue.mod/module.cue b/tests/core/compute/invalid/bool/cue.mod/module.cue similarity index 100% rename from tests/compute/dependencies/interpolation/cue.mod/module.cue rename to tests/core/compute/invalid/bool/cue.mod/module.cue diff --git a/tests/compute/dependencies/interpolation/cue.mod/pkg/.gitignore b/tests/core/compute/invalid/bool/cue.mod/pkg/.gitignore similarity index 100% rename from tests/compute/dependencies/interpolation/cue.mod/pkg/.gitignore rename to tests/core/compute/invalid/bool/cue.mod/pkg/.gitignore diff --git a/tests/compute/invalid/bool/main.cue b/tests/core/compute/invalid/bool/main.cue similarity index 100% rename from tests/compute/invalid/bool/main.cue rename to tests/core/compute/invalid/bool/main.cue diff --git a/tests/compute/dependencies/simple/cue.mod/module.cue b/tests/core/compute/invalid/int/cue.mod/module.cue similarity index 100% rename from tests/compute/dependencies/simple/cue.mod/module.cue rename to tests/core/compute/invalid/int/cue.mod/module.cue diff --git a/tests/compute/dependencies/simple/cue.mod/pkg/.gitignore b/tests/core/compute/invalid/int/cue.mod/pkg/.gitignore similarity index 100% rename from tests/compute/dependencies/simple/cue.mod/pkg/.gitignore rename to tests/core/compute/invalid/int/cue.mod/pkg/.gitignore diff --git a/tests/compute/invalid/int/main.cue b/tests/core/compute/invalid/int/main.cue similarity index 100% rename from tests/compute/invalid/int/main.cue rename to tests/core/compute/invalid/int/main.cue diff --git a/tests/compute/dependencies/unmarshal/cue.mod/module.cue b/tests/core/compute/invalid/string/cue.mod/module.cue similarity index 100% rename from tests/compute/dependencies/unmarshal/cue.mod/module.cue rename to tests/core/compute/invalid/string/cue.mod/module.cue diff --git a/tests/compute/dependencies/unmarshal/cue.mod/pkg/.gitignore b/tests/core/compute/invalid/string/cue.mod/pkg/.gitignore similarity index 100% rename from tests/compute/dependencies/unmarshal/cue.mod/pkg/.gitignore rename to tests/core/compute/invalid/string/cue.mod/pkg/.gitignore diff --git a/tests/compute/invalid/string/main.cue b/tests/core/compute/invalid/string/main.cue similarity index 100% rename from tests/compute/invalid/string/main.cue rename to tests/core/compute/invalid/string/main.cue diff --git a/tests/compute/exclude/.dagger/env/default/plan/cue.mod/module.cue b/tests/core/compute/invalid/struct/cue.mod/module.cue similarity index 100% rename from tests/compute/exclude/.dagger/env/default/plan/cue.mod/module.cue rename to tests/core/compute/invalid/struct/cue.mod/module.cue diff --git a/tests/compute/exclude/.dagger/env/default/plan/cue.mod/pkg/.gitignore b/tests/core/compute/invalid/struct/cue.mod/pkg/.gitignore similarity index 100% rename from tests/compute/exclude/.dagger/env/default/plan/cue.mod/pkg/.gitignore rename to tests/core/compute/invalid/struct/cue.mod/pkg/.gitignore diff --git a/tests/compute/invalid/struct/main.cue b/tests/core/compute/invalid/struct/main.cue similarity index 100% rename from tests/compute/invalid/struct/main.cue rename to tests/core/compute/invalid/struct/main.cue diff --git a/tests/compute/input/default/cue.mod/module.cue b/tests/core/compute/success/exec-nocache/cue.mod/module.cue similarity index 100% rename from tests/compute/input/default/cue.mod/module.cue rename to tests/core/compute/success/exec-nocache/cue.mod/module.cue diff --git a/tests/compute/input/default/cue.mod/pkg/.gitignore b/tests/core/compute/success/exec-nocache/cue.mod/pkg/.gitignore similarity index 100% rename from tests/compute/input/default/cue.mod/pkg/.gitignore rename to tests/core/compute/success/exec-nocache/cue.mod/pkg/.gitignore diff --git a/tests/compute/success/exec-nocache/main.cue b/tests/core/compute/success/exec-nocache/main.cue similarity index 100% rename from tests/compute/success/exec-nocache/main.cue rename to tests/core/compute/success/exec-nocache/main.cue diff --git a/tests/compute/input/simple/cue.mod/module.cue b/tests/core/compute/success/noop/cue.mod/module.cue similarity index 100% rename from tests/compute/input/simple/cue.mod/module.cue rename to tests/core/compute/success/noop/cue.mod/module.cue diff --git a/tests/compute/input/simple/cue.mod/pkg/.gitignore b/tests/core/compute/success/noop/cue.mod/pkg/.gitignore similarity index 100% rename from tests/compute/input/simple/cue.mod/pkg/.gitignore rename to tests/core/compute/success/noop/cue.mod/pkg/.gitignore diff --git a/tests/compute/success/noop/main.cue b/tests/core/compute/success/noop/main.cue similarity index 100% rename from tests/compute/success/noop/main.cue rename to tests/core/compute/success/noop/main.cue diff --git a/tests/compute/invalid/bool/cue.mod/module.cue b/tests/core/compute/success/overload/flat/cue.mod/module.cue similarity index 100% rename from tests/compute/invalid/bool/cue.mod/module.cue rename to tests/core/compute/success/overload/flat/cue.mod/module.cue diff --git a/tests/compute/invalid/bool/cue.mod/pkg/.gitignore b/tests/core/compute/success/overload/flat/cue.mod/pkg/.gitignore similarity index 100% rename from tests/compute/invalid/bool/cue.mod/pkg/.gitignore rename to tests/core/compute/success/overload/flat/cue.mod/pkg/.gitignore diff --git a/tests/compute/success/overload/flat/main.cue b/tests/core/compute/success/overload/flat/main.cue similarity index 100% rename from tests/compute/success/overload/flat/main.cue rename to tests/core/compute/success/overload/flat/main.cue diff --git a/tests/compute/invalid/int/cue.mod/module.cue b/tests/core/compute/success/overload/wrapped/cue.mod/module.cue similarity index 100% rename from tests/compute/invalid/int/cue.mod/module.cue rename to tests/core/compute/success/overload/wrapped/cue.mod/module.cue diff --git a/tests/compute/invalid/int/cue.mod/pkg/.gitignore b/tests/core/compute/success/overload/wrapped/cue.mod/pkg/.gitignore similarity index 100% rename from tests/compute/invalid/int/cue.mod/pkg/.gitignore rename to tests/core/compute/success/overload/wrapped/cue.mod/pkg/.gitignore diff --git a/tests/compute/success/overload/wrapped/main.cue b/tests/core/compute/success/overload/wrapped/main.cue similarity index 100% rename from tests/compute/success/overload/wrapped/main.cue rename to tests/core/compute/success/overload/wrapped/main.cue diff --git a/tests/compute/invalid/string/cue.mod/module.cue b/tests/core/compute/success/simple/cue.mod/module.cue similarity index 100% rename from tests/compute/invalid/string/cue.mod/module.cue rename to tests/core/compute/success/simple/cue.mod/module.cue diff --git a/tests/compute/invalid/string/cue.mod/pkg/.gitignore b/tests/core/compute/success/simple/cue.mod/pkg/.gitignore similarity index 100% rename from tests/compute/invalid/string/cue.mod/pkg/.gitignore rename to tests/core/compute/success/simple/cue.mod/pkg/.gitignore diff --git a/tests/compute/success/simple/main.cue b/tests/core/compute/success/simple/main.cue similarity index 100% rename from tests/compute/success/simple/main.cue rename to tests/core/compute/success/simple/main.cue diff --git a/tests/compute/invalid/struct/cue.mod/module.cue b/tests/core/dependencies/interpolation/cue.mod/module.cue similarity index 100% rename from tests/compute/invalid/struct/cue.mod/module.cue rename to tests/core/dependencies/interpolation/cue.mod/module.cue diff --git a/tests/compute/invalid/struct/cue.mod/pkg/.gitignore b/tests/core/dependencies/interpolation/cue.mod/pkg/.gitignore similarity index 100% rename from tests/compute/invalid/struct/cue.mod/pkg/.gitignore rename to tests/core/dependencies/interpolation/cue.mod/pkg/.gitignore diff --git a/tests/compute/dependencies/interpolation/main.cue b/tests/core/dependencies/interpolation/main.cue similarity index 100% rename from tests/compute/dependencies/interpolation/main.cue rename to tests/core/dependencies/interpolation/main.cue diff --git a/tests/compute/secrets/invalid/env/cue.mod/module.cue b/tests/core/dependencies/simple/cue.mod/module.cue similarity index 100% rename from tests/compute/secrets/invalid/env/cue.mod/module.cue rename to tests/core/dependencies/simple/cue.mod/module.cue diff --git a/tests/compute/secrets/invalid/env/cue.mod/pkg/.gitignore b/tests/core/dependencies/simple/cue.mod/pkg/.gitignore similarity index 100% rename from tests/compute/secrets/invalid/env/cue.mod/pkg/.gitignore rename to tests/core/dependencies/simple/cue.mod/pkg/.gitignore diff --git a/tests/compute/dependencies/simple/main.cue b/tests/core/dependencies/simple/main.cue similarity index 100% rename from tests/compute/dependencies/simple/main.cue rename to tests/core/dependencies/simple/main.cue diff --git a/tests/compute/secrets/invalid/string/cue.mod/module.cue b/tests/core/dependencies/unmarshal/cue.mod/module.cue similarity index 100% rename from tests/compute/secrets/invalid/string/cue.mod/module.cue rename to tests/core/dependencies/unmarshal/cue.mod/module.cue diff --git a/tests/compute/secrets/invalid/string/cue.mod/pkg/.gitignore b/tests/core/dependencies/unmarshal/cue.mod/pkg/.gitignore similarity index 100% rename from tests/compute/secrets/invalid/string/cue.mod/pkg/.gitignore rename to tests/core/dependencies/unmarshal/cue.mod/pkg/.gitignore diff --git a/tests/compute/dependencies/unmarshal/main.cue b/tests/core/dependencies/unmarshal/main.cue similarity index 100% rename from tests/compute/dependencies/unmarshal/main.cue rename to tests/core/dependencies/unmarshal/main.cue diff --git a/tests/compute/exclude/.dagger/env/default/.gitignore b/tests/core/exclude/.dagger/env/default/.gitignore similarity index 100% rename from tests/compute/exclude/.dagger/env/default/.gitignore rename to tests/core/exclude/.dagger/env/default/.gitignore diff --git a/tests/compute/secrets/simple/cue.mod/module.cue b/tests/core/exclude/.dagger/env/default/plan/cue.mod/module.cue similarity index 100% rename from tests/compute/secrets/simple/cue.mod/module.cue rename to tests/core/exclude/.dagger/env/default/plan/cue.mod/module.cue diff --git a/tests/compute/secrets/simple/cue.mod/pkg/.gitignore b/tests/core/exclude/.dagger/env/default/plan/cue.mod/pkg/.gitignore similarity index 100% rename from tests/compute/secrets/simple/cue.mod/pkg/.gitignore rename to tests/core/exclude/.dagger/env/default/plan/cue.mod/pkg/.gitignore diff --git a/tests/compute/exclude/.dagger/env/default/plan/main.cue b/tests/core/exclude/.dagger/env/default/plan/main.cue similarity index 100% rename from tests/compute/exclude/.dagger/env/default/plan/main.cue rename to tests/core/exclude/.dagger/env/default/plan/main.cue diff --git a/tests/compute/exclude/.dagger/env/default/values.yaml b/tests/core/exclude/.dagger/env/default/values.yaml similarity index 100% rename from tests/compute/exclude/.dagger/env/default/values.yaml rename to tests/core/exclude/.dagger/env/default/values.yaml diff --git a/tests/compute/exclude/testdata/a.txt b/tests/core/exclude/testdata/a.txt similarity index 100% rename from tests/compute/exclude/testdata/a.txt rename to tests/core/exclude/testdata/a.txt diff --git a/tests/compute/exclude/testdata/b.txt b/tests/core/exclude/testdata/b.txt similarity index 100% rename from tests/compute/exclude/testdata/b.txt rename to tests/core/exclude/testdata/b.txt diff --git a/tests/compute/exclude/testdata/foo/bar.txt b/tests/core/exclude/testdata/foo/bar.txt similarity index 100% rename from tests/compute/exclude/testdata/foo/bar.txt rename to tests/core/exclude/testdata/foo/bar.txt diff --git a/tests/compute/exclude/testdata/foo/cow.json b/tests/core/exclude/testdata/foo/cow.json similarity index 100% rename from tests/compute/exclude/testdata/foo/cow.json rename to tests/core/exclude/testdata/foo/cow.json diff --git a/tests/compute/success/exec-nocache/cue.mod/module.cue b/tests/core/secrets/invalid/env/cue.mod/module.cue similarity index 100% rename from tests/compute/success/exec-nocache/cue.mod/module.cue rename to tests/core/secrets/invalid/env/cue.mod/module.cue diff --git a/tests/compute/success/exec-nocache/cue.mod/pkg/.gitignore b/tests/core/secrets/invalid/env/cue.mod/pkg/.gitignore similarity index 100% rename from tests/compute/success/exec-nocache/cue.mod/pkg/.gitignore rename to tests/core/secrets/invalid/env/cue.mod/pkg/.gitignore diff --git a/tests/compute/secrets/invalid/env/env.cue b/tests/core/secrets/invalid/env/env.cue similarity index 100% rename from tests/compute/secrets/invalid/env/env.cue rename to tests/core/secrets/invalid/env/env.cue diff --git a/tests/compute/success/noop/cue.mod/module.cue b/tests/core/secrets/invalid/string/cue.mod/module.cue similarity index 100% rename from tests/compute/success/noop/cue.mod/module.cue rename to tests/core/secrets/invalid/string/cue.mod/module.cue diff --git a/tests/compute/success/noop/cue.mod/pkg/.gitignore b/tests/core/secrets/invalid/string/cue.mod/pkg/.gitignore similarity index 100% rename from tests/compute/success/noop/cue.mod/pkg/.gitignore rename to tests/core/secrets/invalid/string/cue.mod/pkg/.gitignore diff --git a/tests/compute/secrets/invalid/string/string.cue b/tests/core/secrets/invalid/string/string.cue similarity index 100% rename from tests/compute/secrets/invalid/string/string.cue rename to tests/core/secrets/invalid/string/string.cue diff --git a/tests/compute/success/overload/flat/cue.mod/module.cue b/tests/core/secrets/simple/cue.mod/module.cue similarity index 100% rename from tests/compute/success/overload/flat/cue.mod/module.cue rename to tests/core/secrets/simple/cue.mod/module.cue diff --git a/tests/compute/success/overload/flat/cue.mod/pkg/.gitignore b/tests/core/secrets/simple/cue.mod/pkg/.gitignore similarity index 100% rename from tests/compute/success/overload/flat/cue.mod/pkg/.gitignore rename to tests/core/secrets/simple/cue.mod/pkg/.gitignore diff --git a/tests/compute/secrets/simple/simple.cue b/tests/core/secrets/simple/simple.cue similarity index 100% rename from tests/compute/secrets/simple/simple.cue rename to tests/core/secrets/simple/simple.cue