diff --git a/tests/ops/copy/invalid/cache/main.cue b/tests/ops/copy/invalid/cache/main.cue index 9f15e987..3438a216 100644 --- a/tests/ops/copy/invalid/cache/main.cue +++ b/tests/ops/copy/invalid/cache/main.cue @@ -1,21 +1,24 @@ package testing +import "dagger.io/dagger/op" + test1: { string #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "busybox" }, - { - do: "copy" - from: [{do: "fetch-container", ref: "alpine"}] + op.#Copy & { + from: [ + op.#FetchContainer & { + ref: "alpine" + }, + ] src: "/etc/issue" dest: "/" }, - { - do: "export" + op.#Export & { source: "/issue" format: "string" }, @@ -26,18 +29,19 @@ test2: { string #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "busybox" }, - { - do: "copy" - from: [{do: "fetch-container", ref: "busybox"}] + op.#Copy & { + from: [ + op.#FetchContainer & { + ref: "busybox" + }, + ] src: "/etc/issue" dest: "/" }, - { - do: "export" + op.#Export & { source: "/issue" format: "string" }, diff --git a/tests/ops/copy/valid/component/main.cue b/tests/ops/copy/valid/component/main.cue index 99e0139f..ec793f21 100644 --- a/tests/ops/copy/valid/component/main.cue +++ b/tests/ops/copy/valid/component/main.cue @@ -1,32 +1,31 @@ package testing -component: #up: [{ - do: "fetch-container" - ref: "alpine" -}, { - do: "exec" - args: ["sh", "-c", """ - printf lol > /id - """] - dir: "/" -}] +import "dagger.io/dagger/op" + +component: #up: [ + op.#FetchContainer & { + ref: "alpine" + }, + op.#Exec & { + args: ["sh", "-c", """ + printf lol > /id + """] + }, +] test1: { string #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "busybox" }, - { - do: "copy" + op.#Copy & { from: component src: "/id" dest: "/" }, - { - do: "export" + op.#Export & { source: "/id" format: "string" }, @@ -37,27 +36,24 @@ test2: { string #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "busybox" }, - { - do: "copy" - from: #up: [{ - do: "fetch-container" - ref: "alpine" - }, { - do: "exec" - args: ["sh", "-c", """ - printf lol > /id - """] - dir: "/" - }] + op.#Copy & { + from: #up: [ + op.#FetchContainer & { + ref: "alpine" + }, + op.#Exec & { + args: ["sh", "-c", """ + printf lol > /id + """] + }, + ] src: "/id" dest: "/" }, - { - do: "export" + op.#Export & { source: "/id" format: "string" }, diff --git a/tests/ops/copy/valid/script/main.cue b/tests/ops/copy/valid/script/main.cue index 0f6bb202..fc21340b 100644 --- a/tests/ops/copy/valid/script/main.cue +++ b/tests/ops/copy/valid/script/main.cue @@ -1,21 +1,24 @@ package testing +import "dagger.io/dagger/op" + test: { string #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "busybox" }, - { - do: "copy" - from: [{do: "fetch-container", ref: "alpine"}] + op.#Copy & { + from: [ + op.#FetchContainer & { + ref: "alpine" + }, + ] src: "/etc/issue" dest: "/" }, - { - do: "export" + op.#Export & { source: "/issue" format: "string" }, diff --git a/tests/ops/exec/always/main.cue b/tests/ops/exec/always/main.cue index 208717ef..dad2f1b4 100644 --- a/tests/ops/exec/always/main.cue +++ b/tests/ops/exec/always/main.cue @@ -1,12 +1,12 @@ package testing +import "dagger.io/dagger/op" + #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "alpine" }, - { - do: "exec" + op.#Exec & { args: ["echo", "always output"] always: true }, diff --git a/tests/ops/exec/dir/doesnotexist/main.cue b/tests/ops/exec/dir/doesnotexist/main.cue index d8198555..adcb9f80 100644 --- a/tests/ops/exec/dir/doesnotexist/main.cue +++ b/tests/ops/exec/dir/doesnotexist/main.cue @@ -1,12 +1,12 @@ package testing +import "dagger.io/dagger/op" + #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "alpine" }, - { - do: "exec" + op.#Exec & { args: ["sh", "-c", """ echo "pwd is: $(pwd)" [ "$(pwd)" == "/thisisnonexistent" ] || exit 1 diff --git a/tests/ops/exec/dir/exist/main.cue b/tests/ops/exec/dir/exist/main.cue index 2049c10f..28e74fa2 100644 --- a/tests/ops/exec/dir/exist/main.cue +++ b/tests/ops/exec/dir/exist/main.cue @@ -1,12 +1,12 @@ package testing +import "dagger.io/dagger/op" + #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "alpine" }, - { - do: "exec" + op.#Exec & { args: ["sh", "-c", """ echo "pwd is: $(pwd)" [ "$(pwd)" == "/etc" ] || exit 1 diff --git a/tests/ops/exec/env/invalid/main.cue b/tests/ops/exec/env/invalid/main.cue index 1e1950f1..e9c5a331 100644 --- a/tests/ops/exec/env/invalid/main.cue +++ b/tests/ops/exec/env/invalid/main.cue @@ -1,12 +1,12 @@ package testing +import "dagger.io/dagger/op" + #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "alpine" }, - { - do: "exec" + op.#Exec & { args: ["sh", "-c", #""" echo "$foo" """#] diff --git a/tests/ops/exec/env/overlay/main.cue b/tests/ops/exec/env/overlay/main.cue index d3c8c3c4..35e8bfc3 100644 --- a/tests/ops/exec/env/overlay/main.cue +++ b/tests/ops/exec/env/overlay/main.cue @@ -1,14 +1,14 @@ package testing +import "dagger.io/dagger/op" + bar: string #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "alpine" }, - { - do: "exec" + op.#Exec & { args: ["sh", "-c", """ echo "foo: $foo" [ "$foo" == "overlay environment" ] || exit 1 diff --git a/tests/ops/exec/env/valid/main.cue b/tests/ops/exec/env/valid/main.cue index 6b0cd61e..b378e4c1 100644 --- a/tests/ops/exec/env/valid/main.cue +++ b/tests/ops/exec/env/valid/main.cue @@ -1,12 +1,13 @@ package testing +import "dagger.io/dagger/op" + #up: [ - { + op.#FetchContainer & { do: "fetch-container" ref: "alpine" }, - { - do: "exec" + op.#Exec & { args: ["sh", "-c", """ [ "$foo" == "output environment" ] || exit 1 """] diff --git a/tests/ops/exec/error/main.cue b/tests/ops/exec/error/main.cue index 72cf9469..8347c5ae 100644 --- a/tests/ops/exec/error/main.cue +++ b/tests/ops/exec/error/main.cue @@ -1,12 +1,12 @@ package testing +import "dagger.io/dagger/op" + #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "alpine" }, - { - do: "exec" + op.#Exec & { args: ["erroringout"] }, ] diff --git a/tests/ops/exec/exit_code/main.cue b/tests/ops/exec/exit_code/main.cue index 385392eb..d83a1e77 100644 --- a/tests/ops/exec/exit_code/main.cue +++ b/tests/ops/exec/exit_code/main.cue @@ -1,14 +1,12 @@ package testing +import "dagger.io/dagger/op" + #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "alpine" }, - { - do: "exec" + op.#Exec & { args: ["sh", "-c", "exit 123"] - // XXX Blocked by https://github.com/blocklayerhq/dagger/issues/19 - dir: "/" }, ] diff --git a/tests/ops/exec/invalid/main.cue b/tests/ops/exec/invalid/main.cue index 577e3544..e1feea27 100644 --- a/tests/ops/exec/invalid/main.cue +++ b/tests/ops/exec/invalid/main.cue @@ -1,11 +1,11 @@ package testing +import "dagger.io/dagger/op" + #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "alpine" }, - { - do: "exec" + op.#Exec & { }, ] diff --git a/tests/ops/exec/simple/main.cue b/tests/ops/exec/simple/main.cue index 5166e3d2..4ec86863 100644 --- a/tests/ops/exec/simple/main.cue +++ b/tests/ops/exec/simple/main.cue @@ -1,12 +1,12 @@ package testing +import "dagger.io/dagger/op" + #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "alpine" }, - { - do: "exec" + op.#Exec & { args: ["echo", "simple output"] }, ] diff --git a/tests/ops/exec/undefined/non_concrete_not_referenced/main.cue b/tests/ops/exec/undefined/non_concrete_not_referenced/main.cue index d0aa3d65..85b6a817 100644 --- a/tests/ops/exec/undefined/non_concrete_not_referenced/main.cue +++ b/tests/ops/exec/undefined/non_concrete_not_referenced/main.cue @@ -1,15 +1,15 @@ package testing +import "dagger.io/dagger/op" + hello: "world" bar: string #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "alpine" }, - { - do: "exec" + op.#Exec & { dir: "/" args: ["sh", "-c", """ echo \(hello) diff --git a/tests/ops/exec/undefined/non_concrete_referenced/main.cue b/tests/ops/exec/undefined/non_concrete_referenced/main.cue index 93c40120..3a1e8796 100644 --- a/tests/ops/exec/undefined/non_concrete_referenced/main.cue +++ b/tests/ops/exec/undefined/non_concrete_referenced/main.cue @@ -1,15 +1,15 @@ package testing +import "dagger.io/dagger/op" + hello: "world" bar: string #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "alpine" }, - { - do: "exec" + op.#Exec & { dir: "/" args: ["sh", "-c", """ echo \(bar) diff --git a/tests/ops/exec/undefined/with_pkg_def/main.cue b/tests/ops/exec/undefined/with_pkg_def/main.cue index dfb1d73e..cd8a98b5 100644 --- a/tests/ops/exec/undefined/with_pkg_def/main.cue +++ b/tests/ops/exec/undefined/with_pkg_def/main.cue @@ -1,12 +1,12 @@ package testing import ( + "dagger.io/dagger/op" "dagger.io/def" ) #up: [ - { - do: "load", + op.#Load & { from: def }, ] diff --git a/tests/ops/exec/undefined/with_pkg_mandatory/main.cue b/tests/ops/exec/undefined/with_pkg_mandatory/main.cue index c6c6e400..e6673db4 100644 --- a/tests/ops/exec/undefined/with_pkg_mandatory/main.cue +++ b/tests/ops/exec/undefined/with_pkg_mandatory/main.cue @@ -2,11 +2,11 @@ package testing import ( "dagger.io/nonoptional" + "dagger.io/dagger/op" ) #up: [ - { - do: "load", + op.#Load & { from: nonoptional }, ] diff --git a/tests/ops/exec/undefined/with_pkg_optional/main.cue b/tests/ops/exec/undefined/with_pkg_optional/main.cue index 349fdeb5..59569918 100644 --- a/tests/ops/exec/undefined/with_pkg_optional/main.cue +++ b/tests/ops/exec/undefined/with_pkg_optional/main.cue @@ -2,11 +2,11 @@ package testing import ( "dagger.io/optional" + "dagger.io/dagger/op" ) #up: [ - { - do: "load", + op.#Load & { from: optional }, ] diff --git a/tests/ops/export/bool/main.cue b/tests/ops/export/bool/main.cue index f30e94bf..3c7fa51b 100644 --- a/tests/ops/export/bool/main.cue +++ b/tests/ops/export/bool/main.cue @@ -1,23 +1,22 @@ package testing +import "dagger.io/dagger/op" + test: { bool #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "alpine" }, - { - do: "exec" + op.#Exec & { args: ["sh", "-c", """ printf "true" > /tmp/out """, ] dir: "/" }, - { - do: "export" + op.#Export & { // Source path in the container source: "/tmp/out" format: "json" diff --git a/tests/ops/export/concurrency/main.cue b/tests/ops/export/concurrency/main.cue index a581cdc5..97607913 100644 --- a/tests/ops/export/concurrency/main.cue +++ b/tests/ops/export/concurrency/main.cue @@ -1,23 +1,22 @@ package testing +import "dagger.io/dagger/op" + test1: { string #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "alpine" }, - { - do: "exec" + op.#Exec & { args: ["sh", "-c", """ echo lol1 > /tmp/out """] dir: "/" always: true }, - { - do: "export" + op.#Export & { source: "/tmp/out" format: "string" }, @@ -28,20 +27,17 @@ test2: { string #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "alpine" }, - { - do: "exec" + op.#Exec & { args: ["sh", "-c", """ echo lol2 > /tmp/out """] dir: "/" always: true }, - { - do: "export" + op.#Export & { source: "/tmp/out" format: "string" }, @@ -52,20 +48,17 @@ test3: { string #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "alpine" }, - { - do: "exec" + op.#Exec & { args: ["sh", "-c", """ echo lol3 > /tmp/out """] dir: "/" always: true }, - { - do: "export" + op.#Export & { source: "/tmp/out" format: "string" }, @@ -76,20 +69,17 @@ test4: { string #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "alpine" }, - { - do: "exec" + op.#Exec & { args: ["sh", "-c", """ echo lol4 > /tmp/out """] dir: "/" always: true }, - { - do: "export" + op.#Export & { source: "/tmp/out" format: "string" }, @@ -100,20 +90,16 @@ test5: { string #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "alpine" }, - { - do: "exec" + op.#Exec & { args: ["sh", "-c", """ echo lol5 > /tmp/out """] - dir: "/" always: true }, - { - do: "export" + op.#Export & { source: "/tmp/out" format: "string" }, @@ -124,20 +110,16 @@ test6: { string #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "alpine" }, - { - do: "exec" + op.#Exec & { args: ["sh", "-c", """ echo lol6 > /tmp/out """] - dir: "/" always: true }, - { - do: "export" + op.#Export & { source: "/tmp/out" format: "string" }, @@ -148,20 +130,16 @@ test7: { string #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "alpine" }, - { - do: "exec" + op.#Exec & { args: ["sh", "-c", """ echo lol7 > /tmp/out """] - dir: "/" always: true }, - { - do: "export" + op.#Export & { source: "/tmp/out" format: "string" }, @@ -172,20 +150,17 @@ test8: { string #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "alpine" }, - { - do: "exec" + op.#Exec & { args: ["sh", "-c", """ echo lol8 > /tmp/out """] dir: "/" always: true }, - { - do: "export" + op.#Export & { source: "/tmp/out" format: "string" }, @@ -196,20 +171,17 @@ test9: { string #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "alpine" }, - { - do: "exec" + op.#Exec & { args: ["sh", "-c", """ echo lol9 > /tmp/out """] dir: "/" always: true }, - { - do: "export" + op.#Export & { source: "/tmp/out" format: "string" }, @@ -220,20 +192,17 @@ test10: { string #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "alpine" }, - { - do: "exec" + op.#Exec & { args: ["sh", "-c", """ echo lol10 > /tmp/out """] dir: "/" always: true }, - { - do: "export" + op.#Export & { source: "/tmp/out" format: "string" }, diff --git a/tests/ops/export/float/main.cue b/tests/ops/export/float/main.cue index b3bc2825..3fdcc53b 100644 --- a/tests/ops/export/float/main.cue +++ b/tests/ops/export/float/main.cue @@ -1,22 +1,21 @@ package testing +import "dagger.io/dagger/op" + test: { float #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "alpine" }, - { - do: "exec" + op.#Exec & { args: ["sh", "-c", """ echo -123.5 > /tmp/out """, ] }, - { - do: "export" + op.#Export & { // Source path in the container source: "/tmp/out" format: "json" diff --git a/tests/ops/export/invalid/format/main.cue b/tests/ops/export/invalid/format/main.cue index abbc2259..e645d9ad 100644 --- a/tests/ops/export/invalid/format/main.cue +++ b/tests/ops/export/invalid/format/main.cue @@ -1,22 +1,21 @@ package testing +import "dagger.io/dagger/op" + teststring: { string #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "alpine" }, - { - do: "exec" + op.#Exec & { args: ["sh", "-c", """ echo something > /tmp/out """, ] }, - { - do: "export" + op.#Export & { // Source path in the container source: "/tmp/out" format: "lalalalal" diff --git a/tests/ops/export/invalid/path/main.cue b/tests/ops/export/invalid/path/main.cue index 25934352..74e6cd50 100644 --- a/tests/ops/export/invalid/path/main.cue +++ b/tests/ops/export/invalid/path/main.cue @@ -4,12 +4,10 @@ teststring: { string #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "alpine" }, - { - do: "export" + op.#Export & { // Source path in the container source: "/tmp/lalala" format: "string" diff --git a/tests/ops/export/invalid/validation/main.cue b/tests/ops/export/invalid/validation/main.cue index 8de9c3f1..1f08b75e 100644 --- a/tests/ops/export/invalid/validation/main.cue +++ b/tests/ops/export/invalid/validation/main.cue @@ -1,23 +1,22 @@ package testing +import "dagger.io/dagger/op" + test: { string =~"^NAAAA.+" #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "alpine" }, - { - do: "exec" + op.#Exec & { args: ["sh", "-c", """ printf something > /tmp/out """, ] }, - { - do: "export" + op.#Export & { // Source path in the container source: "/tmp/out" format: "string" diff --git a/tests/ops/export/json/main.cue b/tests/ops/export/json/main.cue index 5bedf20e..8f670af7 100644 --- a/tests/ops/export/json/main.cue +++ b/tests/ops/export/json/main.cue @@ -1,23 +1,21 @@ package testing +import "dagger.io/dagger/op" + testScalar: { bool #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "alpine" }, - { - do: "exec" + op.#Exec & { args: ["sh", "-c", """ echo true > /tmp/out """, ] - dir: "/" }, - { - do: "export" + op.#Export & { // Source path in the container source: "/tmp/out" format: "json" @@ -26,20 +24,16 @@ testScalar: { } testMap: #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "alpine" }, - { - do: "exec" + op.#Exec & { args: ["sh", "-c", """ echo '{"something": "something"}' > /tmp/out """, ] - dir: "/" }, - { - do: "export" + op.#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 11fd0c65..1c514aa2 100644 --- a/tests/ops/export/number/main.cue +++ b/tests/ops/export/number/main.cue @@ -1,22 +1,21 @@ package testing +import "dagger.io/dagger/op" + test: { number #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "alpine" }, - { - do: "exec" + op.#Exec & { args: ["sh", "-c", """ echo -123.5 > /tmp/out """, ] }, - { - do: "export" + op.#Export & { // Source path in the container source: "/tmp/out" format: "json" diff --git a/tests/ops/export/string/main.cue b/tests/ops/export/string/main.cue index 65917c83..e2fbf7eb 100644 --- a/tests/ops/export/string/main.cue +++ b/tests/ops/export/string/main.cue @@ -1,22 +1,21 @@ package testing +import "dagger.io/dagger/op" + test: { string #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "alpine" }, - { - do: "exec" + op.#Exec & { args: ["sh", "-c", """ printf something > /tmp/out """, ] }, - { - do: "export" + op.#Export & { // Source path in the container source: "/tmp/out" format: "string" diff --git a/tests/ops/export/withvalidation/main.cue b/tests/ops/export/withvalidation/main.cue index e6ddd93f..3252c721 100644 --- a/tests/ops/export/withvalidation/main.cue +++ b/tests/ops/export/withvalidation/main.cue @@ -1,23 +1,22 @@ package testing +import "dagger.io/dagger/op" + test: { string =~"^some.+" #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "alpine" }, - { - do: "exec" + op.#Exec & { args: ["sh", "-c", """ printf something > /tmp/out """, ] }, - { - do: "export" + op.#Export & { // Source path in the container source: "/tmp/out" format: "string" diff --git a/tests/ops/export/yaml/main.cue b/tests/ops/export/yaml/main.cue index d6a7de34..88c0d96f 100644 --- a/tests/ops/export/yaml/main.cue +++ b/tests/ops/export/yaml/main.cue @@ -1,24 +1,21 @@ package testing +import "dagger.io/dagger/op" + testScalar: { bool #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "alpine" }, - { - do: "exec" + op.#Exec & { args: ["sh", "-c", """ echo true > /tmp/out """, ] - // XXX Blocked by https://github.com/blocklayerhq/dagger/issues/19 - dir: "/" }, - { - do: "export" + op.#Export & { // Source path in the container source: "/tmp/out" format: "yaml" diff --git a/tests/ops/fetch-container/exist/main.cue b/tests/ops/fetch-container/exist/main.cue index c6b44ad4..287622c3 100644 --- a/tests/ops/fetch-container/exist/main.cue +++ b/tests/ops/fetch-container/exist/main.cue @@ -1,36 +1,33 @@ package testing +import "dagger.io/dagger/op" + busybox1: #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "busybox" }, ] busybox2: #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "busybox:latest" }, ] busybox3: #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "busybox:1.33-musl" }, ] busybox4: #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "busybox@sha256:e2af53705b841ace3ab3a44998663d4251d33ee8a9acaf71b66df4ae01c3bbe7" }, ] busybox5: #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "busybox:1.33-musl@sha256:e2af53705b841ace3ab3a44998663d4251d33ee8a9acaf71b66df4ae01c3bbe7" }, ] diff --git a/tests/ops/fetch-container/invalid/main.cue b/tests/ops/fetch-container/invalid/main.cue index 9a41348e..0de73875 100644 --- a/tests/ops/fetch-container/invalid/main.cue +++ b/tests/ops/fetch-container/invalid/main.cue @@ -1,7 +1,8 @@ package testing +import "dagger.io/dagger/op" + #up: [ - { - do: "fetch-container" + op.#FetchContainer & { }, ] diff --git a/tests/ops/fetch-container/nonexistent/digest/main.cue b/tests/ops/fetch-container/nonexistent/digest/main.cue index 6974d5da..e41a0af6 100644 --- a/tests/ops/fetch-container/nonexistent/digest/main.cue +++ b/tests/ops/fetch-container/nonexistent/digest/main.cue @@ -1,8 +1,9 @@ package testing +import "dagger.io/dagger/op" + #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "alpine@sha256:c6c7524e2111f22a9f7577211232d89a9e68cf5b9ed4a41ba77957c9771380a5" }, ] diff --git a/tests/ops/fetch-container/nonexistent/image-with-valid-digest/main.cue b/tests/ops/fetch-container/nonexistent/image-with-valid-digest/main.cue index a69d6fdc..7eaa1468 100644 --- a/tests/ops/fetch-container/nonexistent/image-with-valid-digest/main.cue +++ b/tests/ops/fetch-container/nonexistent/image-with-valid-digest/main.cue @@ -1,10 +1,11 @@ package testing +import "dagger.io/dagger/op" + // XXX WATCHOUT // Once buildkit has pulled that digest, it will stay cached and happily succeed WHATEVER the image name then is #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "busyboxaaa@sha256:e2af53705b841ace3ab3a44998663d4251d33ee8a9acaf71b66df4ae01c3bbe7" }, ] diff --git a/tests/ops/fetch-container/nonexistent/image/main.cue b/tests/ops/fetch-container/nonexistent/image/main.cue index c85f89ce..d32c238a 100644 --- a/tests/ops/fetch-container/nonexistent/image/main.cue +++ b/tests/ops/fetch-container/nonexistent/image/main.cue @@ -1,8 +1,9 @@ package testing +import "dagger.io/dagger/op" + #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "doesnotexist" }, ] diff --git a/tests/ops/fetch-container/nonexistent/tag/main.cue b/tests/ops/fetch-container/nonexistent/tag/main.cue index a22f1b17..cc24916a 100644 --- a/tests/ops/fetch-container/nonexistent/tag/main.cue +++ b/tests/ops/fetch-container/nonexistent/tag/main.cue @@ -1,8 +1,9 @@ package testing +import "dagger.io/dagger/op" + #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "alpine:doesnotexist" }, ] diff --git a/tests/ops/fetch-git/exist/main.cue b/tests/ops/fetch-git/exist/main.cue index 86fb6506..dc8cf641 100644 --- a/tests/ops/fetch-git/exist/main.cue +++ b/tests/ops/fetch-git/exist/main.cue @@ -1,8 +1,9 @@ package testing +import "dagger.io/dagger/op" + #up: [ - { - do: "fetch-git" + op.#FetchGit & { remote: "https://github.com/blocklayerhq/acme-clothing.git" ref: "master" }, diff --git a/tests/ops/fetch-git/invalid/main.cue b/tests/ops/fetch-git/invalid/main.cue index 4157da11..dac913c6 100644 --- a/tests/ops/fetch-git/invalid/main.cue +++ b/tests/ops/fetch-git/invalid/main.cue @@ -1,7 +1,8 @@ package testing +import "dagger.io/dagger/op" + #up: [ - { - do: "fetch-git" + op.#FetchGit & { }, ] diff --git a/tests/ops/fetch-git/nonexistent/bork/main.cue b/tests/ops/fetch-git/nonexistent/bork/main.cue index d59b3090..9d8cab55 100644 --- a/tests/ops/fetch-git/nonexistent/bork/main.cue +++ b/tests/ops/fetch-git/nonexistent/bork/main.cue @@ -1,8 +1,9 @@ package testing +import "dagger.io/dagger/op" + #up: [ - { - do: "fetch-git" + op.#FetchGit & { remote: "pork://pork" ref: "master" }, diff --git a/tests/ops/fetch-git/nonexistent/ref/main.cue b/tests/ops/fetch-git/nonexistent/ref/main.cue index 9b3a9cfd..618075ac 100644 --- a/tests/ops/fetch-git/nonexistent/ref/main.cue +++ b/tests/ops/fetch-git/nonexistent/ref/main.cue @@ -1,8 +1,9 @@ package testing +import "dagger.io/dagger/op" + #up: [ - { - do: "fetch-git" + op.#FetchGit & { remote: "https://github.com/blocklayerhq/acme-clothing.git" ref: "lalalalal" }, diff --git a/tests/ops/fetch-git/nonexistent/remote/main.cue b/tests/ops/fetch-git/nonexistent/remote/main.cue index 87d32a10..4193c76f 100644 --- a/tests/ops/fetch-git/nonexistent/remote/main.cue +++ b/tests/ops/fetch-git/nonexistent/remote/main.cue @@ -1,8 +1,9 @@ package testing +import "dagger.io/dagger/op" + #up: [ - { - do: "fetch-git" + op.#FetchGit & { remote: "https://github.com/blocklayerhq/lalalala.git" ref: "master" }, diff --git a/tests/ops/load/invalid/cache/main.cue b/tests/ops/load/invalid/cache/main.cue index f13957d7..5191fa53 100644 --- a/tests/ops/load/invalid/cache/main.cue +++ b/tests/ops/load/invalid/cache/main.cue @@ -1,15 +1,19 @@ package testing +import "dagger.io/dagger/op" + test1: { string #up: [ - { - do: "load" - from: [{do: "fetch-container", ref: "alpine"}] + op.#Load & { + from: [ + op.#FetchContainer & { + ref: "alpine" + }, + ] }, - { - do: "export" + op.#Export & { source: "/etc/issue" format: "string" }, @@ -20,12 +24,14 @@ test2: { string #up: [ - { - do: "load" - from: [{do: "fetch-container", ref: "busybox"}] + op.#Load & { + from: [ + op.#FetchContainer & { + ref: "busybox" + }, + ] }, - { - do: "export" + op.#Export & { source: "/etc/issue" format: "string" }, diff --git a/tests/ops/load/valid/component/main.cue b/tests/ops/load/valid/component/main.cue index a9fa7341..ff1395cc 100644 --- a/tests/ops/load/valid/component/main.cue +++ b/tests/ops/load/valid/component/main.cue @@ -1,26 +1,26 @@ package testing -component: #up: [{ - do: "fetch-container" - ref: "alpine" -}, { - do: "exec" - args: ["sh", "-c", """ - printf lol > /id - """] - dir: "/" -}] +import "dagger.io/dagger/op" + +component: #up: [ + op.#FetchContainer & { + ref: "alpine" + }, + op.#Exec & { + args: ["sh", "-c", """ + printf lol > /id + """] + }, +] test1: { string #up: [ - { - do: "load" + op.#Load & { from: component }, - { - do: "export" + op.#Export & { source: "/id" format: "string" }, @@ -31,21 +31,19 @@ test2: { string #up: [ - { - do: "load" - from: #up: [{ - do: "fetch-container" - ref: "alpine" - }, { - do: "exec" - args: ["sh", "-c", """ - printf lol > /id - """] - dir: "/" - }] + op.#Load & { + from: #up: [ + op.#FetchContainer & { + ref: "alpine" + }, + op.#Exec & { + args: ["sh", "-c", """ + printf lol > /id + """] + }, + ] }, - { - do: "export" + op.#Export & { source: "/id" format: "string" }, diff --git a/tests/ops/load/valid/script/main.cue b/tests/ops/load/valid/script/main.cue index d009ab66..d4184b09 100644 --- a/tests/ops/load/valid/script/main.cue +++ b/tests/ops/load/valid/script/main.cue @@ -1,15 +1,19 @@ package testing +import "dagger.io/dagger/op" + test: { string #up: [ - { - do: "load" - from: [{do: "fetch-container", ref: "alpine"}] + op.#Load & { + from: [ + op.#FetchContainer & { + ref: "alpine" + }, + ] }, - { - do: "export" + op.#Export & { source: "/etc/issue" format: "string" }, diff --git a/tests/ops/mounts/valid/cache/main.cue b/tests/ops/mounts/valid/cache/main.cue index 7a66a40a..6e1c583f 100644 --- a/tests/ops/mounts/valid/cache/main.cue +++ b/tests/ops/mounts/valid/cache/main.cue @@ -1,23 +1,22 @@ package testing +import "dagger.io/dagger/op" + test: { string #up: [ - { - do: "load" + op.#Load & { from: [{do: "fetch-container", ref: "alpine"}] }, - { - do: "exec" + op.#Exec & { args: ["sh", "-c", """ echo "NOT SURE WHAT TO TEST YET" > /out """] dir: "/" mount: something: "cache" }, - { - do: "export" + op.#Export & { source: "/out" format: "string" }, diff --git a/tests/ops/mounts/valid/component/main.cue b/tests/ops/mounts/valid/component/main.cue index d6290440..836673aa 100644 --- a/tests/ops/mounts/valid/component/main.cue +++ b/tests/ops/mounts/valid/component/main.cue @@ -1,33 +1,34 @@ package testing +import "dagger.io/dagger/op" + test: { string #up: [ - { - do: "load" - from: [{do: "fetch-container", ref: "alpine"}] + op.#Load & { + from: [ + op.#FetchContainer & { + ref: "alpine" + }, + ] }, - { - do: "exec" + op.#Exec & { args: ["sh", "-c", """ cat /mnt/test/lol > /out """] mount: "/mnt/test": from: #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "alpine" }, - { - do: "exec" + op.#Exec & { args: ["sh", "-c", """ echo -n "hello world" > /lol """] }, ] }, - { - do: "export" + op.#Export & { source: "/out" format: "string" }, diff --git a/tests/ops/mounts/valid/script/main.cue b/tests/ops/mounts/valid/script/main.cue index 00567b0f..c996543f 100644 --- a/tests/ops/mounts/valid/script/main.cue +++ b/tests/ops/mounts/valid/script/main.cue @@ -1,19 +1,22 @@ package testing +import "dagger.io/dagger/op" + test: { string #up: [ - { - do: "load" - from: [{do: "fetch-container", ref: "alpine"}] + op.#Load & { + from: [ + op.#FetchContainer & { + ref: "alpine" + }, + ] }, - { - do: "exec" + op.#Exec & { args: ["sh", "-c", """ ls -lA /lol > /out """] - dir: "/" mount: something: { input: [{ do: "fetch-container" @@ -22,8 +25,7 @@ test: { path: "/lol" } }, - { - do: "export" + op.#Export & { source: "/out" format: "string" }, diff --git a/tests/ops/mounts/valid/tmpfs/main.cue b/tests/ops/mounts/valid/tmpfs/main.cue index 75258d18..3b47332d 100644 --- a/tests/ops/mounts/valid/tmpfs/main.cue +++ b/tests/ops/mounts/valid/tmpfs/main.cue @@ -1,32 +1,33 @@ package testing +import "dagger.io/dagger/op" + test: { string #up: [ - { - do: "load" - from: [{do: "fetch-container", ref: "alpine"}] + op.#Load & { + from: [ + op.#FetchContainer & { + ref: "alpine" + }, + ] }, - { - do: "exec" + op.#Exec & { args: ["sh", "-c", """ echo ok > /out echo ok > /tmpdir/out """] - dir: "/" mount: "/tmpdir": "tmpfs" }, - { - do: "exec" + op.#Exec & { args: ["sh", "-c", """ [ -f /out ] || exit 1 # content of /cache/tmp must not exist in this layer [ ! -f /tmpdir/out ] || exit 1 """] }, - { - do: "export" + op.#Export & { source: "/out" format: "string" }, diff --git a/tests/ops/subdir/simple/main.cue b/tests/ops/subdir/simple/main.cue index 1598e7af..1cb98ffb 100644 --- a/tests/ops/subdir/simple/main.cue +++ b/tests/ops/subdir/simple/main.cue @@ -1,27 +1,24 @@ package main +import "dagger.io/dagger/op" + hello: { string #up: [ - { - do: "fetch-container" + op.#FetchContainer & { ref: "alpine" }, - { - do: "exec" + op.#Exec & { args: ["mkdir", "-p", "/tmp/foo"] }, - { - do: "exec" + op.#Exec & { args: ["sh", "-c", "echo -n world > /tmp/foo/hello"] }, - { - do: "subdir" + op.#Subdir & { dir: "/tmp/foo" }, - { - do: "export" + op.#Export & { source: "/hello" format: "string" },