diff --git a/tests/compute/ignore/main.cue b/tests/compute/ignore/main.cue index 29eef0f5..b86eecb5 100644 --- a/tests/compute/ignore/main.cue +++ b/tests/compute/ignore/main.cue @@ -1,4 +1,4 @@ -package test +package testing import ( "dagger.io/alpine" diff --git a/tests/ops.bats b/tests/ops.bats index 83fce481..39e23514 100644 --- a/tests/ops.bats +++ b/tests/ops.bats @@ -7,9 +7,10 @@ setup() { @test "op.#Load" { run "$DAGGER" compute "$TESTDIR"/ops/load/valid/component assert_success - assert_line '{"component":{},"test1":"lol","test2":"lol"}' + assert_line '{"TestComponent":{},"TestComponentLoad":"lol","TestNestedLoad":"lol"}' - "$DAGGER" compute "$TESTDIR"/ops/load/valid/script + run "$DAGGER" compute "$TESTDIR"/ops/load/valid/script + assert_success run "$DAGGER" compute "$TESTDIR"/ops/load/invalid/cache assert_failure @@ -17,30 +18,35 @@ setup() { @test "op.#Mount" { # tmpfs - "$DAGGER" compute "$TESTDIR"/ops/mounts/valid/tmpfs + run "$DAGGER" compute "$TESTDIR"/ops/mounts/valid/tmpfs + assert_line '{"TestMountTmpfs":"ok"}' + assert_success # cache - "$DAGGER" compute "$TESTDIR"/ops/mounts/valid/cache + run "$DAGGER" compute "$TESTDIR"/ops/mounts/valid/cache + assert_line '{"TestMountCache":"NOT SURE WHAT TO TEST YET"}' + assert_success # component run "$DAGGER" compute "$TESTDIR"/ops/mounts/valid/component assert_success assert_line '{"test":"hello world"}' - # FIXME https://github.com/blocklayerhq/dagger/issues/46 - # "$DAGGER" compute "$TESTDIR"/ops/mounts/valid/script + # Invalid mount path + run "$DAGGER" compute "$TESTDIR"/ops/mounts/valid/script + assert_failure } @test "op.#Copy" { run "$DAGGER" compute "$TESTDIR"/ops/copy/valid/component assert_success - assert_line '{"component":{},"test1":"lol","test2":"lol"}' + assert_line '{"TestComponent":{},"TestComponentCopy":"lol","TestNestedCopy":"lol"}' - "$DAGGER" compute "$TESTDIR"/ops/copy/valid/script + run "$DAGGER" compute "$TESTDIR"/ops/copy/valid/script + assert_success - # FIXME https://github.com/blocklayerhq/dagger/issues/44 - # run "$DAGGER" compute "$TESTDIR"/ops/copy/invalid/cache - # assert_failure + run "$DAGGER" compute "$TESTDIR"/ops/copy/invalid/cache + assert_failure } @test "op.#Local" { @@ -78,7 +84,8 @@ setup() { @test "op.#PushContainer" { skip_unless_secrets_available "$TESTDIR"/ops/push-container/inputs.yaml - "$DAGGER" compute --input-yaml "$TESTDIR"/ops/push-container/inputs.yaml "$TESTDIR"/ops/push-container + run "$DAGGER" compute --input-yaml "$TESTDIR"/ops/push-container/inputs.yaml "$TESTDIR"/ops/push-container + assert_success } @test "op.#FetchGit" { @@ -151,26 +158,26 @@ setup() { # assert_failure # --exit=123 # script with non-optional prop, not referenced, should be executed - # FIXME https://github.com/blocklayerhq/dagger/issues/70 - # run "$DAGGER" compute "$TESTDIR"/ops/exec/undefined/with_pkg_mandatory - # assert_failure + run "$DAGGER" compute "$TESTDIR"/ops/exec/undefined/with_pkg_mandatory + assert_success } @test "op.#Export" { run "$DAGGER" compute "$TESTDIR"/ops/export/json assert_success - assert_line '{"testMap":{"something":"something"},"testScalar":true}' + assert_line '{"TestExportList":["milk","pumpkin pie","eggs","juice"],"TestExportMap":{"something":"something"},"TestExportScalar":true}' run "$DAGGER" compute "$TESTDIR"/ops/export/string assert_success - assert_line '{"test":"something"}' + assert_line '{"TestExportString":"something"}' run "$DAGGER" compute "$TESTDIR"/ops/export/withvalidation assert_success - assert_line '{"test":"something"}' + assert_line '{"TestExportStringValidation":"something"}' run "$DAGGER" compute "$TESTDIR"/ops/export/concurrency assert_success + assert_line '{"TestExportConcurrency1":"lol1","TestExportConcurrency10":"lol10","TestExportConcurrency2":"lol2","TestExportConcurrency3":"lol3","TestExportConcurrency4":"lol4","TestExportConcurrency5":"lol5","TestExportConcurrency6":"lol6","TestExportConcurrency7":"lol7","TestExportConcurrency8":"lol8","TestExportConcurrency9":"lol9"}' # does not pass additional validation run "$DAGGER" compute "$TESTDIR"/ops/export/invalid/validation @@ -184,31 +191,36 @@ setup() { run "$DAGGER" compute "$TESTDIR"/ops/export/invalid/path assert_failure - run "$DAGGER" compute "$TESTDIR"/ops/export/float assert_success - assert_line '{"test":-123.5}' + assert_line '{"TestExportFloat":-123.5}' run "$DAGGER" compute "$TESTDIR"/ops/export/yaml assert_success - assert_line '{"testMap":{"something":"something"},"testScalar":true}' + assert_line '{"TestExportList":["milk","pumpkin pie","eggs","juice"],"TestExportMap":{"something":"something"},"TestExportScalar":true}' run "$DAGGER" compute "$TESTDIR"/ops/export/bool assert_success - assert_line '{"test":true}' + assert_line '{"TestExportBool":true}' - # FIXME: https://github.com/blocklayerhq/dagger/issues/96 - # run "$DAGGER" compute "$TESTDIR"/ops/export/number - # assert_success - # assert_line '{"test":-123.5}' + run "$DAGGER" compute "$TESTDIR"/ops/export/number + assert_success + assert_line '{"TestExportNumber":-123.5}' } @test "op.#Subdir" { - run "$DAGGER" compute "$TESTDIR"/ops/subdir/simple + run "$DAGGER" compute "$TESTDIR"/ops/subdir/valid/simple assert_success - assert_line '{"hello":"world"}' + assert_line '{"TestSimpleSubdir":"world"}' - run "$DAGGER" compute "$TESTDIR"/ops/subdir/error + run "$DAGGER" compute "$TESTDIR"/ops/subdir/valid/container + assert_success + assert_line '{"TestSubdirMount":"world"}' + + run "$DAGGER" compute "$TESTDIR"/ops/subdir/invalid/exec + assert_failure + + run "$DAGGER" compute "$TESTDIR"/ops/subdir/invalid/path assert_failure } diff --git a/tests/ops/copy/invalid/cache/main.cue b/tests/ops/copy/invalid/cache/main.cue index 3438a216..266abddb 100644 --- a/tests/ops/copy/invalid/cache/main.cue +++ b/tests/ops/copy/invalid/cache/main.cue @@ -2,7 +2,7 @@ package testing import "dagger.io/dagger/op" -test1: { +TestCacheCopyLoadAlpine: { string #up: [ @@ -25,7 +25,7 @@ test1: { ] } -test2: { +TestCacheCopy: { string #up: [ diff --git a/tests/ops/copy/valid/component/main.cue b/tests/ops/copy/valid/component/main.cue index ec793f21..239233fd 100644 --- a/tests/ops/copy/valid/component/main.cue +++ b/tests/ops/copy/valid/component/main.cue @@ -2,7 +2,7 @@ package testing import "dagger.io/dagger/op" -component: #up: [ +TestComponent: #up: [ op.#FetchContainer & { ref: "alpine" }, @@ -13,7 +13,7 @@ component: #up: [ }, ] -test1: { +TestComponentCopy: { string #up: [ @@ -21,7 +21,7 @@ test1: { ref: "busybox" }, op.#Copy & { - from: component + from: TestComponent src: "/id" dest: "/" }, @@ -32,7 +32,7 @@ test1: { ] } -test2: { +TestNestedCopy: { string #up: [ diff --git a/tests/ops/copy/valid/script/main.cue b/tests/ops/copy/valid/script/main.cue index fc21340b..e51539e2 100644 --- a/tests/ops/copy/valid/script/main.cue +++ b/tests/ops/copy/valid/script/main.cue @@ -2,7 +2,7 @@ package testing import "dagger.io/dagger/op" -test: { +TestScriptCopy: { string #up: [ diff --git a/tests/ops/dockerbuild/main.cue b/tests/ops/dockerbuild/main.cue index 27843933..4e966f72 100644 --- a/tests/ops/dockerbuild/main.cue +++ b/tests/ops/dockerbuild/main.cue @@ -1,4 +1,4 @@ -package test +package testing import ( "dagger.io/dagger" diff --git a/tests/ops/export/bool/main.cue b/tests/ops/export/bool/main.cue index 3c7fa51b..604b033a 100644 --- a/tests/ops/export/bool/main.cue +++ b/tests/ops/export/bool/main.cue @@ -2,7 +2,7 @@ package testing import "dagger.io/dagger/op" -test: { +TestExportBool: { bool #up: [ diff --git a/tests/ops/export/concurrency/main.cue b/tests/ops/export/concurrency/main.cue index 97607913..36832bec 100644 --- a/tests/ops/export/concurrency/main.cue +++ b/tests/ops/export/concurrency/main.cue @@ -2,7 +2,7 @@ package testing import "dagger.io/dagger/op" -test1: { +TestExportConcurrency1: { string #up: [ @@ -11,7 +11,7 @@ test1: { }, op.#Exec & { args: ["sh", "-c", """ - echo lol1 > /tmp/out + echo -n lol1 > /tmp/out """] dir: "/" always: true @@ -23,7 +23,7 @@ test1: { ] } -test2: { +TestExportConcurrency2: { string #up: [ @@ -32,7 +32,7 @@ test2: { }, op.#Exec & { args: ["sh", "-c", """ - echo lol2 > /tmp/out + echo -n lol2 > /tmp/out """] dir: "/" always: true @@ -44,7 +44,7 @@ test2: { ] } -test3: { +TestExportConcurrency3: { string #up: [ @@ -53,7 +53,7 @@ test3: { }, op.#Exec & { args: ["sh", "-c", """ - echo lol3 > /tmp/out + echo -n lol3 > /tmp/out """] dir: "/" always: true @@ -65,7 +65,7 @@ test3: { ] } -test4: { +TestExportConcurrency4: { string #up: [ @@ -74,7 +74,7 @@ test4: { }, op.#Exec & { args: ["sh", "-c", """ - echo lol4 > /tmp/out + echo -n lol4 > /tmp/out """] dir: "/" always: true @@ -86,7 +86,7 @@ test4: { ] } -test5: { +TestExportConcurrency5: { string #up: [ @@ -95,7 +95,7 @@ test5: { }, op.#Exec & { args: ["sh", "-c", """ - echo lol5 > /tmp/out + echo -n lol5 > /tmp/out """] always: true }, @@ -106,7 +106,7 @@ test5: { ] } -test6: { +TestExportConcurrency6: { string #up: [ @@ -115,7 +115,7 @@ test6: { }, op.#Exec & { args: ["sh", "-c", """ - echo lol6 > /tmp/out + echo -n lol6 > /tmp/out """] always: true }, @@ -126,7 +126,7 @@ test6: { ] } -test7: { +TestExportConcurrency7: { string #up: [ @@ -135,7 +135,7 @@ test7: { }, op.#Exec & { args: ["sh", "-c", """ - echo lol7 > /tmp/out + echo -n lol7 > /tmp/out """] always: true }, @@ -146,7 +146,7 @@ test7: { ] } -test8: { +TestExportConcurrency8: { string #up: [ @@ -155,7 +155,7 @@ test8: { }, op.#Exec & { args: ["sh", "-c", """ - echo lol8 > /tmp/out + echo -n lol8 > /tmp/out """] dir: "/" always: true @@ -167,7 +167,7 @@ test8: { ] } -test9: { +TestExportConcurrency9: { string #up: [ @@ -176,7 +176,7 @@ test9: { }, op.#Exec & { args: ["sh", "-c", """ - echo lol9 > /tmp/out + echo -n lol9 > /tmp/out """] dir: "/" always: true @@ -188,7 +188,7 @@ test9: { ] } -test10: { +TestExportConcurrency10: { string #up: [ @@ -197,7 +197,7 @@ test10: { }, op.#Exec & { args: ["sh", "-c", """ - echo lol10 > /tmp/out + echo -n lol10 > /tmp/out """] dir: "/" always: true diff --git a/tests/ops/export/float/main.cue b/tests/ops/export/float/main.cue index 3fdcc53b..5382a1eb 100644 --- a/tests/ops/export/float/main.cue +++ b/tests/ops/export/float/main.cue @@ -2,7 +2,7 @@ package testing import "dagger.io/dagger/op" -test: { +TestExportFloat: { float #up: [ diff --git a/tests/ops/export/invalid/format/main.cue b/tests/ops/export/invalid/format/main.cue index e645d9ad..d74428d7 100644 --- a/tests/ops/export/invalid/format/main.cue +++ b/tests/ops/export/invalid/format/main.cue @@ -2,7 +2,7 @@ package testing import "dagger.io/dagger/op" -teststring: { +TestExportInvalidFormat: { string #up: [ diff --git a/tests/ops/export/invalid/path/main.cue b/tests/ops/export/invalid/path/main.cue index 74e6cd50..e8fb78d5 100644 --- a/tests/ops/export/invalid/path/main.cue +++ b/tests/ops/export/invalid/path/main.cue @@ -1,6 +1,6 @@ package testing -teststring: { +TestExportInvalidPath: { string #up: [ diff --git a/tests/ops/export/invalid/validation/main.cue b/tests/ops/export/invalid/validation/main.cue index 1f08b75e..931bd291 100644 --- a/tests/ops/export/invalid/validation/main.cue +++ b/tests/ops/export/invalid/validation/main.cue @@ -2,7 +2,7 @@ package testing import "dagger.io/dagger/op" -test: { +TestExportInvalidValidation: { string =~"^NAAAA.+" @@ -12,7 +12,7 @@ test: { }, op.#Exec & { args: ["sh", "-c", """ - printf something > /tmp/out + echo -n something > /tmp/out """, ] }, diff --git a/tests/ops/export/json/main.cue b/tests/ops/export/json/main.cue index 8f670af7..df3341d6 100644 --- a/tests/ops/export/json/main.cue +++ b/tests/ops/export/json/main.cue @@ -2,7 +2,7 @@ package testing import "dagger.io/dagger/op" -testScalar: { +TestExportScalar: { bool #up: [ @@ -23,7 +23,7 @@ testScalar: { ] } -testMap: #up: [ +TestExportMap: #up: [ op.#FetchContainer & { ref: "alpine" }, @@ -40,28 +40,27 @@ testMap: #up: [ }, ] -// FIXME: lists are currently broken -// testList: { -// [...string] +TestExportList: { + [...string] -// #up: [ -// { -// do: "fetch-container" -// ref: "alpine" -// }, -// { -// do: "exec" -// args: ["sh", "-c", """ -// echo '["milk", "pumpkin pie", "eggs", "juice"]' > /tmp/out -// """, -// ] -// dir: "/" -// }, -// { -// do: "export" -// // Source path in the container -// source: "/tmp/out" -// format: "json" -// }, -// ] -// } + #up: [ + { + do: "fetch-container" + ref: "alpine" + }, + { + do: "exec" + args: ["sh", "-c", """ + echo '["milk", "pumpkin pie", "eggs", "juice"]' > /tmp/out + """, + ] + dir: "/" + }, + { + do: "export" + // Source path in the container + source: "/tmp/out" + format: "json" + }, + ] +} diff --git a/tests/ops/export/number/main.cue b/tests/ops/export/number/main.cue index 1c514aa2..5fa8c376 100644 --- a/tests/ops/export/number/main.cue +++ b/tests/ops/export/number/main.cue @@ -2,7 +2,7 @@ package testing import "dagger.io/dagger/op" -test: { +TestExportNumber: { number #up: [ diff --git a/tests/ops/export/string/main.cue b/tests/ops/export/string/main.cue index e2fbf7eb..b5bc85e8 100644 --- a/tests/ops/export/string/main.cue +++ b/tests/ops/export/string/main.cue @@ -2,7 +2,7 @@ package testing import "dagger.io/dagger/op" -test: { +TestExportString: { string #up: [ diff --git a/tests/ops/export/withvalidation/main.cue b/tests/ops/export/withvalidation/main.cue index 3252c721..6e604137 100644 --- a/tests/ops/export/withvalidation/main.cue +++ b/tests/ops/export/withvalidation/main.cue @@ -2,7 +2,7 @@ package testing import "dagger.io/dagger/op" -test: { +TestExportStringValidation: { string =~"^some.+" diff --git a/tests/ops/export/yaml/main.cue b/tests/ops/export/yaml/main.cue index 88c0d96f..35e6b07c 100644 --- a/tests/ops/export/yaml/main.cue +++ b/tests/ops/export/yaml/main.cue @@ -2,7 +2,7 @@ package testing import "dagger.io/dagger/op" -testScalar: { +TestExportScalar: { bool #up: [ @@ -23,35 +23,34 @@ testScalar: { ] } -// FIXME: lists are currently broken -// testList: { -// [...string] +TestExportList: { + [...string] -// #up: [ -// { -// do: "fetch-container" -// ref: "alpine" -// }, -// { -// do: "exec" -// args: ["sh", "-c", """ -// echo "--- # Shopping list -// [milk, pumpkin pie, eggs, juice]" > /tmp/out -// """, -// ] -// // XXX Blocked by https://github.com/blocklayerhq/dagger/issues/19 -// dir: "/" -// }, -// { -// do: "export" -// // Source path in the container -// source: "/tmp/out" -// format: "yaml" -// }, -// ] -// } + #up: [ + { + do: "fetch-container" + ref: "alpine" + }, + { + do: "exec" + args: ["sh", "-c", """ + echo "--- # Shopping list + [milk, pumpkin pie, eggs, juice]" > /tmp/out + """, + ] + // XXX Blocked by https://github.com/blocklayerhq/dagger/issues/19 + dir: "/" + }, + { + do: "export" + // Source path in the container + source: "/tmp/out" + format: "yaml" + }, + ] +} -testMap: #up: [ +TestExportMap: #up: [ { do: "fetch-container" ref: "alpine" diff --git a/tests/ops/fetch-container/exist/main.cue b/tests/ops/fetch-container/exist/main.cue index 287622c3..58c592fd 100644 --- a/tests/ops/fetch-container/exist/main.cue +++ b/tests/ops/fetch-container/exist/main.cue @@ -2,31 +2,31 @@ package testing import "dagger.io/dagger/op" -busybox1: #up: [ +TestBusybox1: #up: [ op.#FetchContainer & { ref: "busybox" }, ] -busybox2: #up: [ +TestBusybox2: #up: [ op.#FetchContainer & { ref: "busybox:latest" }, ] -busybox3: #up: [ +TestBusybox3: #up: [ op.#FetchContainer & { ref: "busybox:1.33-musl" }, ] -busybox4: #up: [ +TestBusybox4: #up: [ op.#FetchContainer & { ref: "busybox@sha256:e2af53705b841ace3ab3a44998663d4251d33ee8a9acaf71b66df4ae01c3bbe7" }, ] -busybox5: #up: [ +TestBusybox5: #up: [ op.#FetchContainer & { ref: "busybox:1.33-musl@sha256:e2af53705b841ace3ab3a44998663d4251d33ee8a9acaf71b66df4ae01c3bbe7" }, diff --git a/tests/ops/load/valid/component/main.cue b/tests/ops/load/valid/component/main.cue index ff1395cc..05e9d75e 100644 --- a/tests/ops/load/valid/component/main.cue +++ b/tests/ops/load/valid/component/main.cue @@ -2,7 +2,7 @@ package testing import "dagger.io/dagger/op" -component: #up: [ +TestComponent: #up: [ op.#FetchContainer & { ref: "alpine" }, @@ -13,12 +13,12 @@ component: #up: [ }, ] -test1: { +TestComponentLoad: { string #up: [ op.#Load & { - from: component + from: TestComponent }, op.#Export & { source: "/id" @@ -27,7 +27,7 @@ test1: { ] } -test2: { +TestNestedLoad: { string #up: [ diff --git a/tests/ops/mounts/valid/cache/main.cue b/tests/ops/mounts/valid/cache/main.cue index 6e1c583f..b551a6d1 100644 --- a/tests/ops/mounts/valid/cache/main.cue +++ b/tests/ops/mounts/valid/cache/main.cue @@ -2,7 +2,7 @@ package testing import "dagger.io/dagger/op" -test: { +TestMountCache: { string #up: [ @@ -11,7 +11,7 @@ test: { }, op.#Exec & { args: ["sh", "-c", """ - echo "NOT SURE WHAT TO TEST YET" > /out + echo -n "NOT SURE WHAT TO TEST YET" > /out """] dir: "/" mount: something: "cache" diff --git a/tests/ops/mounts/valid/script/main.cue b/tests/ops/mounts/valid/script/main.cue index c996543f..2ccc40bb 100644 --- a/tests/ops/mounts/valid/script/main.cue +++ b/tests/ops/mounts/valid/script/main.cue @@ -2,7 +2,7 @@ package testing import "dagger.io/dagger/op" -test: { +TestInvalidMountPath: { string #up: [ @@ -18,7 +18,7 @@ test: { ls -lA /lol > /out """] mount: something: { - input: [{ + from: [{ do: "fetch-container" ref: "alpine" }] diff --git a/tests/ops/mounts/valid/tmpfs/main.cue b/tests/ops/mounts/valid/tmpfs/main.cue index 3b47332d..7980a56d 100644 --- a/tests/ops/mounts/valid/tmpfs/main.cue +++ b/tests/ops/mounts/valid/tmpfs/main.cue @@ -2,7 +2,7 @@ package testing import "dagger.io/dagger/op" -test: { +TestMountTmpfs: { string #up: [ @@ -15,8 +15,8 @@ test: { }, op.#Exec & { args: ["sh", "-c", """ - echo ok > /out - echo ok > /tmpdir/out + echo -n ok > /out + echo -n ok > /tmpdir/out """] mount: "/tmpdir": "tmpfs" }, diff --git a/tests/ops/push-container/main.cue b/tests/ops/push-container/main.cue index d73da547..e3930270 100644 --- a/tests/ops/push-container/main.cue +++ b/tests/ops/push-container/main.cue @@ -1,4 +1,4 @@ -package main +package testing import ( "dagger.io/dagger/op" diff --git a/tests/ops/subdir/error/main.cue b/tests/ops/subdir/invalid/exec/main.cue similarity index 90% rename from tests/ops/subdir/error/main.cue rename to tests/ops/subdir/invalid/exec/main.cue index 9fb09742..19442466 100644 --- a/tests/ops/subdir/error/main.cue +++ b/tests/ops/subdir/invalid/exec/main.cue @@ -1,8 +1,8 @@ -package main +package testing import "dagger.io/dagger/op" -hello: { +TestInvalidExecSubdir: { string #up: [ diff --git a/tests/ops/subdir/invalid/path/main.cue b/tests/ops/subdir/invalid/path/main.cue new file mode 100644 index 00000000..4b61a118 --- /dev/null +++ b/tests/ops/subdir/invalid/path/main.cue @@ -0,0 +1,26 @@ +package testing + +import "dagger.io/dagger/op" + +TestInvalidPathSubdir: { + string + + #up: [ + op.#FetchContainer & { + ref: "alpine" + }, + op.#Exec & { + args: ["mkdir", "-p", "/tmp/foo"] + }, + op.#Exec & { + args: ["sh", "-c", "echo -n world > /tmp/foo/hello"] + }, + op.#Subdir & { + dir: "/directorynotfound" + }, + op.#Export & { + source: "./hello" + format: "string" + }, + ] +} diff --git a/tests/ops/subdir/valid/container/main.cue b/tests/ops/subdir/valid/container/main.cue new file mode 100644 index 00000000..13219f2d --- /dev/null +++ b/tests/ops/subdir/valid/container/main.cue @@ -0,0 +1,44 @@ +package testing + +import "dagger.io/dagger/op" + +#TestContainer: #up: [ + op.#FetchContainer & { + ref: "alpine" + }, + op.#Exec & { + args: ["mkdir", "-p", "/tmp/foo"] + }, + op.#Exec & { + args: ["sh", "-c", "echo -n world > /tmp/foo/hello"] + }, + op.#Subdir & { + dir: "/tmp/foo" + }, +] + +TestSubdirMount: { + string + + #up: [ + op.#FetchContainer & { + ref: "alpine" + }, + + // Check number of file in /source (should contains only hello) + op.#Exec & { + args: ["sh", "-c", "test $(ls /source | wc -l) = 1"] + mount: "/source": from: #TestContainer + }, + + op.#Exec & { + args: ["sh", "-c", "cat /source/hello > /out"] + mount: "/source": from: #TestContainer + }, + + op.#Export & { + source: "/out" + format: "string" + }, + ] +} diff --git a/tests/ops/subdir/simple/main.cue b/tests/ops/subdir/valid/simple/main.cue similarity index 90% rename from tests/ops/subdir/simple/main.cue rename to tests/ops/subdir/valid/simple/main.cue index 0fde946f..639eed63 100644 --- a/tests/ops/subdir/simple/main.cue +++ b/tests/ops/subdir/valid/simple/main.cue @@ -1,8 +1,8 @@ -package main +package testing import "dagger.io/dagger/op" -hello: { +TestSimpleSubdir: { string #up: [