tests: ops: use proper imports

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
Andrea Luzzardi 2021-04-14 16:44:34 -07:00
parent 381db37ca3
commit 1f640d3e25
48 changed files with 325 additions and 357 deletions

View File

@ -1,21 +1,24 @@
package testing package testing
import "dagger.io/dagger/op"
test1: { test1: {
string string
#up: [ #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "busybox" ref: "busybox"
}, },
{ op.#Copy & {
do: "copy" from: [
from: [{do: "fetch-container", ref: "alpine"}] op.#FetchContainer & {
ref: "alpine"
},
]
src: "/etc/issue" src: "/etc/issue"
dest: "/" dest: "/"
}, },
{ op.#Export & {
do: "export"
source: "/issue" source: "/issue"
format: "string" format: "string"
}, },
@ -26,18 +29,19 @@ test2: {
string string
#up: [ #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "busybox" ref: "busybox"
}, },
{ op.#Copy & {
do: "copy" from: [
from: [{do: "fetch-container", ref: "busybox"}] op.#FetchContainer & {
ref: "busybox"
},
]
src: "/etc/issue" src: "/etc/issue"
dest: "/" dest: "/"
}, },
{ op.#Export & {
do: "export"
source: "/issue" source: "/issue"
format: "string" format: "string"
}, },

View File

@ -1,32 +1,31 @@
package testing package testing
component: #up: [{ import "dagger.io/dagger/op"
do: "fetch-container"
component: #up: [
op.#FetchContainer & {
ref: "alpine" ref: "alpine"
}, { },
do: "exec" op.#Exec & {
args: ["sh", "-c", """ args: ["sh", "-c", """
printf lol > /id printf lol > /id
"""] """]
dir: "/" },
}] ]
test1: { test1: {
string string
#up: [ #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "busybox" ref: "busybox"
}, },
{ op.#Copy & {
do: "copy"
from: component from: component
src: "/id" src: "/id"
dest: "/" dest: "/"
}, },
{ op.#Export & {
do: "export"
source: "/id" source: "/id"
format: "string" format: "string"
}, },
@ -37,27 +36,24 @@ test2: {
string string
#up: [ #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "busybox" ref: "busybox"
}, },
{ op.#Copy & {
do: "copy" from: #up: [
from: #up: [{ op.#FetchContainer & {
do: "fetch-container"
ref: "alpine" ref: "alpine"
}, { },
do: "exec" op.#Exec & {
args: ["sh", "-c", """ args: ["sh", "-c", """
printf lol > /id printf lol > /id
"""] """]
dir: "/" },
}] ]
src: "/id" src: "/id"
dest: "/" dest: "/"
}, },
{ op.#Export & {
do: "export"
source: "/id" source: "/id"
format: "string" format: "string"
}, },

View File

@ -1,21 +1,24 @@
package testing package testing
import "dagger.io/dagger/op"
test: { test: {
string string
#up: [ #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "busybox" ref: "busybox"
}, },
{ op.#Copy & {
do: "copy" from: [
from: [{do: "fetch-container", ref: "alpine"}] op.#FetchContainer & {
ref: "alpine"
},
]
src: "/etc/issue" src: "/etc/issue"
dest: "/" dest: "/"
}, },
{ op.#Export & {
do: "export"
source: "/issue" source: "/issue"
format: "string" format: "string"
}, },

View File

@ -1,12 +1,12 @@
package testing package testing
import "dagger.io/dagger/op"
#up: [ #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "alpine" ref: "alpine"
}, },
{ op.#Exec & {
do: "exec"
args: ["echo", "always output"] args: ["echo", "always output"]
always: true always: true
}, },

View File

@ -1,12 +1,12 @@
package testing package testing
import "dagger.io/dagger/op"
#up: [ #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "alpine" ref: "alpine"
}, },
{ op.#Exec & {
do: "exec"
args: ["sh", "-c", """ args: ["sh", "-c", """
echo "pwd is: $(pwd)" echo "pwd is: $(pwd)"
[ "$(pwd)" == "/thisisnonexistent" ] || exit 1 [ "$(pwd)" == "/thisisnonexistent" ] || exit 1

View File

@ -1,12 +1,12 @@
package testing package testing
import "dagger.io/dagger/op"
#up: [ #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "alpine" ref: "alpine"
}, },
{ op.#Exec & {
do: "exec"
args: ["sh", "-c", """ args: ["sh", "-c", """
echo "pwd is: $(pwd)" echo "pwd is: $(pwd)"
[ "$(pwd)" == "/etc" ] || exit 1 [ "$(pwd)" == "/etc" ] || exit 1

View File

@ -1,12 +1,12 @@
package testing package testing
import "dagger.io/dagger/op"
#up: [ #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "alpine" ref: "alpine"
}, },
{ op.#Exec & {
do: "exec"
args: ["sh", "-c", #""" args: ["sh", "-c", #"""
echo "$foo" echo "$foo"
"""#] """#]

View File

@ -1,14 +1,14 @@
package testing package testing
import "dagger.io/dagger/op"
bar: string bar: string
#up: [ #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "alpine" ref: "alpine"
}, },
{ op.#Exec & {
do: "exec"
args: ["sh", "-c", """ args: ["sh", "-c", """
echo "foo: $foo" echo "foo: $foo"
[ "$foo" == "overlay environment" ] || exit 1 [ "$foo" == "overlay environment" ] || exit 1

View File

@ -1,12 +1,13 @@
package testing package testing
import "dagger.io/dagger/op"
#up: [ #up: [
{ op.#FetchContainer & {
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"
}, },
{ op.#Exec & {
do: "exec"
args: ["sh", "-c", """ args: ["sh", "-c", """
[ "$foo" == "output environment" ] || exit 1 [ "$foo" == "output environment" ] || exit 1
"""] """]

View File

@ -1,12 +1,12 @@
package testing package testing
import "dagger.io/dagger/op"
#up: [ #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "alpine" ref: "alpine"
}, },
{ op.#Exec & {
do: "exec"
args: ["erroringout"] args: ["erroringout"]
}, },
] ]

View File

@ -1,14 +1,12 @@
package testing package testing
import "dagger.io/dagger/op"
#up: [ #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "alpine" ref: "alpine"
}, },
{ op.#Exec & {
do: "exec"
args: ["sh", "-c", "exit 123"] args: ["sh", "-c", "exit 123"]
// XXX Blocked by https://github.com/blocklayerhq/dagger/issues/19
dir: "/"
}, },
] ]

View File

@ -1,11 +1,11 @@
package testing package testing
import "dagger.io/dagger/op"
#up: [ #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "alpine" ref: "alpine"
}, },
{ op.#Exec & {
do: "exec"
}, },
] ]

View File

@ -1,12 +1,12 @@
package testing package testing
import "dagger.io/dagger/op"
#up: [ #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "alpine" ref: "alpine"
}, },
{ op.#Exec & {
do: "exec"
args: ["echo", "simple output"] args: ["echo", "simple output"]
}, },
] ]

View File

@ -1,15 +1,15 @@
package testing package testing
import "dagger.io/dagger/op"
hello: "world" hello: "world"
bar: string bar: string
#up: [ #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "alpine" ref: "alpine"
}, },
{ op.#Exec & {
do: "exec"
dir: "/" dir: "/"
args: ["sh", "-c", """ args: ["sh", "-c", """
echo \(hello) echo \(hello)

View File

@ -1,15 +1,15 @@
package testing package testing
import "dagger.io/dagger/op"
hello: "world" hello: "world"
bar: string bar: string
#up: [ #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "alpine" ref: "alpine"
}, },
{ op.#Exec & {
do: "exec"
dir: "/" dir: "/"
args: ["sh", "-c", """ args: ["sh", "-c", """
echo \(bar) echo \(bar)

View File

@ -1,12 +1,12 @@
package testing package testing
import ( import (
"dagger.io/dagger/op"
"dagger.io/def" "dagger.io/def"
) )
#up: [ #up: [
{ op.#Load & {
do: "load",
from: def from: def
}, },
] ]

View File

@ -2,11 +2,11 @@ package testing
import ( import (
"dagger.io/nonoptional" "dagger.io/nonoptional"
"dagger.io/dagger/op"
) )
#up: [ #up: [
{ op.#Load & {
do: "load",
from: nonoptional from: nonoptional
}, },
] ]

View File

@ -2,11 +2,11 @@ package testing
import ( import (
"dagger.io/optional" "dagger.io/optional"
"dagger.io/dagger/op"
) )
#up: [ #up: [
{ op.#Load & {
do: "load",
from: optional from: optional
}, },
] ]

View File

@ -1,23 +1,22 @@
package testing package testing
import "dagger.io/dagger/op"
test: { test: {
bool bool
#up: [ #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "alpine" ref: "alpine"
}, },
{ op.#Exec & {
do: "exec"
args: ["sh", "-c", """ args: ["sh", "-c", """
printf "true" > /tmp/out printf "true" > /tmp/out
""", """,
] ]
dir: "/" dir: "/"
}, },
{ op.#Export & {
do: "export"
// Source path in the container // Source path in the container
source: "/tmp/out" source: "/tmp/out"
format: "json" format: "json"

View File

@ -1,23 +1,22 @@
package testing package testing
import "dagger.io/dagger/op"
test1: { test1: {
string string
#up: [ #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "alpine" ref: "alpine"
}, },
{ op.#Exec & {
do: "exec"
args: ["sh", "-c", """ args: ["sh", "-c", """
echo lol1 > /tmp/out echo lol1 > /tmp/out
"""] """]
dir: "/" dir: "/"
always: true always: true
}, },
{ op.#Export & {
do: "export"
source: "/tmp/out" source: "/tmp/out"
format: "string" format: "string"
}, },
@ -28,20 +27,17 @@ test2: {
string string
#up: [ #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "alpine" ref: "alpine"
}, },
{ op.#Exec & {
do: "exec"
args: ["sh", "-c", """ args: ["sh", "-c", """
echo lol2 > /tmp/out echo lol2 > /tmp/out
"""] """]
dir: "/" dir: "/"
always: true always: true
}, },
{ op.#Export & {
do: "export"
source: "/tmp/out" source: "/tmp/out"
format: "string" format: "string"
}, },
@ -52,20 +48,17 @@ test3: {
string string
#up: [ #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "alpine" ref: "alpine"
}, },
{ op.#Exec & {
do: "exec"
args: ["sh", "-c", """ args: ["sh", "-c", """
echo lol3 > /tmp/out echo lol3 > /tmp/out
"""] """]
dir: "/" dir: "/"
always: true always: true
}, },
{ op.#Export & {
do: "export"
source: "/tmp/out" source: "/tmp/out"
format: "string" format: "string"
}, },
@ -76,20 +69,17 @@ test4: {
string string
#up: [ #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "alpine" ref: "alpine"
}, },
{ op.#Exec & {
do: "exec"
args: ["sh", "-c", """ args: ["sh", "-c", """
echo lol4 > /tmp/out echo lol4 > /tmp/out
"""] """]
dir: "/" dir: "/"
always: true always: true
}, },
{ op.#Export & {
do: "export"
source: "/tmp/out" source: "/tmp/out"
format: "string" format: "string"
}, },
@ -100,20 +90,16 @@ test5: {
string string
#up: [ #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "alpine" ref: "alpine"
}, },
{ op.#Exec & {
do: "exec"
args: ["sh", "-c", """ args: ["sh", "-c", """
echo lol5 > /tmp/out echo lol5 > /tmp/out
"""] """]
dir: "/"
always: true always: true
}, },
{ op.#Export & {
do: "export"
source: "/tmp/out" source: "/tmp/out"
format: "string" format: "string"
}, },
@ -124,20 +110,16 @@ test6: {
string string
#up: [ #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "alpine" ref: "alpine"
}, },
{ op.#Exec & {
do: "exec"
args: ["sh", "-c", """ args: ["sh", "-c", """
echo lol6 > /tmp/out echo lol6 > /tmp/out
"""] """]
dir: "/"
always: true always: true
}, },
{ op.#Export & {
do: "export"
source: "/tmp/out" source: "/tmp/out"
format: "string" format: "string"
}, },
@ -148,20 +130,16 @@ test7: {
string string
#up: [ #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "alpine" ref: "alpine"
}, },
{ op.#Exec & {
do: "exec"
args: ["sh", "-c", """ args: ["sh", "-c", """
echo lol7 > /tmp/out echo lol7 > /tmp/out
"""] """]
dir: "/"
always: true always: true
}, },
{ op.#Export & {
do: "export"
source: "/tmp/out" source: "/tmp/out"
format: "string" format: "string"
}, },
@ -172,20 +150,17 @@ test8: {
string string
#up: [ #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "alpine" ref: "alpine"
}, },
{ op.#Exec & {
do: "exec"
args: ["sh", "-c", """ args: ["sh", "-c", """
echo lol8 > /tmp/out echo lol8 > /tmp/out
"""] """]
dir: "/" dir: "/"
always: true always: true
}, },
{ op.#Export & {
do: "export"
source: "/tmp/out" source: "/tmp/out"
format: "string" format: "string"
}, },
@ -196,20 +171,17 @@ test9: {
string string
#up: [ #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "alpine" ref: "alpine"
}, },
{ op.#Exec & {
do: "exec"
args: ["sh", "-c", """ args: ["sh", "-c", """
echo lol9 > /tmp/out echo lol9 > /tmp/out
"""] """]
dir: "/" dir: "/"
always: true always: true
}, },
{ op.#Export & {
do: "export"
source: "/tmp/out" source: "/tmp/out"
format: "string" format: "string"
}, },
@ -220,20 +192,17 @@ test10: {
string string
#up: [ #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "alpine" ref: "alpine"
}, },
{ op.#Exec & {
do: "exec"
args: ["sh", "-c", """ args: ["sh", "-c", """
echo lol10 > /tmp/out echo lol10 > /tmp/out
"""] """]
dir: "/" dir: "/"
always: true always: true
}, },
{ op.#Export & {
do: "export"
source: "/tmp/out" source: "/tmp/out"
format: "string" format: "string"
}, },

View File

@ -1,22 +1,21 @@
package testing package testing
import "dagger.io/dagger/op"
test: { test: {
float float
#up: [ #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "alpine" ref: "alpine"
}, },
{ op.#Exec & {
do: "exec"
args: ["sh", "-c", """ args: ["sh", "-c", """
echo -123.5 > /tmp/out echo -123.5 > /tmp/out
""", """,
] ]
}, },
{ op.#Export & {
do: "export"
// Source path in the container // Source path in the container
source: "/tmp/out" source: "/tmp/out"
format: "json" format: "json"

View File

@ -1,22 +1,21 @@
package testing package testing
import "dagger.io/dagger/op"
teststring: { teststring: {
string string
#up: [ #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "alpine" ref: "alpine"
}, },
{ op.#Exec & {
do: "exec"
args: ["sh", "-c", """ args: ["sh", "-c", """
echo something > /tmp/out echo something > /tmp/out
""", """,
] ]
}, },
{ op.#Export & {
do: "export"
// Source path in the container // Source path in the container
source: "/tmp/out" source: "/tmp/out"
format: "lalalalal" format: "lalalalal"

View File

@ -4,12 +4,10 @@ teststring: {
string string
#up: [ #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "alpine" ref: "alpine"
}, },
{ op.#Export & {
do: "export"
// Source path in the container // Source path in the container
source: "/tmp/lalala" source: "/tmp/lalala"
format: "string" format: "string"

View File

@ -1,23 +1,22 @@
package testing package testing
import "dagger.io/dagger/op"
test: { test: {
string string
=~"^NAAAA.+" =~"^NAAAA.+"
#up: [ #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "alpine" ref: "alpine"
}, },
{ op.#Exec & {
do: "exec"
args: ["sh", "-c", """ args: ["sh", "-c", """
printf something > /tmp/out printf something > /tmp/out
""", """,
] ]
}, },
{ op.#Export & {
do: "export"
// Source path in the container // Source path in the container
source: "/tmp/out" source: "/tmp/out"
format: "string" format: "string"

View File

@ -1,23 +1,21 @@
package testing package testing
import "dagger.io/dagger/op"
testScalar: { testScalar: {
bool bool
#up: [ #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "alpine" ref: "alpine"
}, },
{ op.#Exec & {
do: "exec"
args: ["sh", "-c", """ args: ["sh", "-c", """
echo true > /tmp/out echo true > /tmp/out
""", """,
] ]
dir: "/"
}, },
{ op.#Export & {
do: "export"
// Source path in the container // Source path in the container
source: "/tmp/out" source: "/tmp/out"
format: "json" format: "json"
@ -26,20 +24,16 @@ testScalar: {
} }
testMap: #up: [ testMap: #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "alpine" ref: "alpine"
}, },
{ op.#Exec & {
do: "exec"
args: ["sh", "-c", """ args: ["sh", "-c", """
echo '{"something": "something"}' > /tmp/out echo '{"something": "something"}' > /tmp/out
""", """,
] ]
dir: "/"
}, },
{ op.#Export & {
do: "export"
// Source path in the container // Source path in the container
source: "/tmp/out" source: "/tmp/out"
format: "json" format: "json"

View File

@ -1,22 +1,21 @@
package testing package testing
import "dagger.io/dagger/op"
test: { test: {
number number
#up: [ #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "alpine" ref: "alpine"
}, },
{ op.#Exec & {
do: "exec"
args: ["sh", "-c", """ args: ["sh", "-c", """
echo -123.5 > /tmp/out echo -123.5 > /tmp/out
""", """,
] ]
}, },
{ op.#Export & {
do: "export"
// Source path in the container // Source path in the container
source: "/tmp/out" source: "/tmp/out"
format: "json" format: "json"

View File

@ -1,22 +1,21 @@
package testing package testing
import "dagger.io/dagger/op"
test: { test: {
string string
#up: [ #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "alpine" ref: "alpine"
}, },
{ op.#Exec & {
do: "exec"
args: ["sh", "-c", """ args: ["sh", "-c", """
printf something > /tmp/out printf something > /tmp/out
""", """,
] ]
}, },
{ op.#Export & {
do: "export"
// Source path in the container // Source path in the container
source: "/tmp/out" source: "/tmp/out"
format: "string" format: "string"

View File

@ -1,23 +1,22 @@
package testing package testing
import "dagger.io/dagger/op"
test: { test: {
string string
=~"^some.+" =~"^some.+"
#up: [ #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "alpine" ref: "alpine"
}, },
{ op.#Exec & {
do: "exec"
args: ["sh", "-c", """ args: ["sh", "-c", """
printf something > /tmp/out printf something > /tmp/out
""", """,
] ]
}, },
{ op.#Export & {
do: "export"
// Source path in the container // Source path in the container
source: "/tmp/out" source: "/tmp/out"
format: "string" format: "string"

View File

@ -1,24 +1,21 @@
package testing package testing
import "dagger.io/dagger/op"
testScalar: { testScalar: {
bool bool
#up: [ #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "alpine" ref: "alpine"
}, },
{ op.#Exec & {
do: "exec"
args: ["sh", "-c", """ args: ["sh", "-c", """
echo true > /tmp/out echo true > /tmp/out
""", """,
] ]
// XXX Blocked by https://github.com/blocklayerhq/dagger/issues/19
dir: "/"
}, },
{ op.#Export & {
do: "export"
// Source path in the container // Source path in the container
source: "/tmp/out" source: "/tmp/out"
format: "yaml" format: "yaml"

View File

@ -1,36 +1,33 @@
package testing package testing
import "dagger.io/dagger/op"
busybox1: #up: [ busybox1: #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "busybox" ref: "busybox"
}, },
] ]
busybox2: #up: [ busybox2: #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "busybox:latest" ref: "busybox:latest"
}, },
] ]
busybox3: #up: [ busybox3: #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "busybox:1.33-musl" ref: "busybox:1.33-musl"
}, },
] ]
busybox4: #up: [ busybox4: #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "busybox@sha256:e2af53705b841ace3ab3a44998663d4251d33ee8a9acaf71b66df4ae01c3bbe7" ref: "busybox@sha256:e2af53705b841ace3ab3a44998663d4251d33ee8a9acaf71b66df4ae01c3bbe7"
}, },
] ]
busybox5: #up: [ busybox5: #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "busybox:1.33-musl@sha256:e2af53705b841ace3ab3a44998663d4251d33ee8a9acaf71b66df4ae01c3bbe7" ref: "busybox:1.33-musl@sha256:e2af53705b841ace3ab3a44998663d4251d33ee8a9acaf71b66df4ae01c3bbe7"
}, },
] ]

View File

@ -1,7 +1,8 @@
package testing package testing
import "dagger.io/dagger/op"
#up: [ #up: [
{ op.#FetchContainer & {
do: "fetch-container"
}, },
] ]

View File

@ -1,8 +1,9 @@
package testing package testing
import "dagger.io/dagger/op"
#up: [ #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "alpine@sha256:c6c7524e2111f22a9f7577211232d89a9e68cf5b9ed4a41ba77957c9771380a5" ref: "alpine@sha256:c6c7524e2111f22a9f7577211232d89a9e68cf5b9ed4a41ba77957c9771380a5"
}, },
] ]

View File

@ -1,10 +1,11 @@
package testing package testing
import "dagger.io/dagger/op"
// XXX WATCHOUT // XXX WATCHOUT
// Once buildkit has pulled that digest, it will stay cached and happily succeed WHATEVER the image name then is // Once buildkit has pulled that digest, it will stay cached and happily succeed WHATEVER the image name then is
#up: [ #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "busyboxaaa@sha256:e2af53705b841ace3ab3a44998663d4251d33ee8a9acaf71b66df4ae01c3bbe7" ref: "busyboxaaa@sha256:e2af53705b841ace3ab3a44998663d4251d33ee8a9acaf71b66df4ae01c3bbe7"
}, },
] ]

View File

@ -1,8 +1,9 @@
package testing package testing
import "dagger.io/dagger/op"
#up: [ #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "doesnotexist" ref: "doesnotexist"
}, },
] ]

View File

@ -1,8 +1,9 @@
package testing package testing
import "dagger.io/dagger/op"
#up: [ #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "alpine:doesnotexist" ref: "alpine:doesnotexist"
}, },
] ]

View File

@ -1,8 +1,9 @@
package testing package testing
import "dagger.io/dagger/op"
#up: [ #up: [
{ op.#FetchGit & {
do: "fetch-git"
remote: "https://github.com/blocklayerhq/acme-clothing.git" remote: "https://github.com/blocklayerhq/acme-clothing.git"
ref: "master" ref: "master"
}, },

View File

@ -1,7 +1,8 @@
package testing package testing
import "dagger.io/dagger/op"
#up: [ #up: [
{ op.#FetchGit & {
do: "fetch-git"
}, },
] ]

View File

@ -1,8 +1,9 @@
package testing package testing
import "dagger.io/dagger/op"
#up: [ #up: [
{ op.#FetchGit & {
do: "fetch-git"
remote: "pork://pork" remote: "pork://pork"
ref: "master" ref: "master"
}, },

View File

@ -1,8 +1,9 @@
package testing package testing
import "dagger.io/dagger/op"
#up: [ #up: [
{ op.#FetchGit & {
do: "fetch-git"
remote: "https://github.com/blocklayerhq/acme-clothing.git" remote: "https://github.com/blocklayerhq/acme-clothing.git"
ref: "lalalalal" ref: "lalalalal"
}, },

View File

@ -1,8 +1,9 @@
package testing package testing
import "dagger.io/dagger/op"
#up: [ #up: [
{ op.#FetchGit & {
do: "fetch-git"
remote: "https://github.com/blocklayerhq/lalalala.git" remote: "https://github.com/blocklayerhq/lalalala.git"
ref: "master" ref: "master"
}, },

View File

@ -1,15 +1,19 @@
package testing package testing
import "dagger.io/dagger/op"
test1: { test1: {
string string
#up: [ #up: [
{ op.#Load & {
do: "load" from: [
from: [{do: "fetch-container", ref: "alpine"}] op.#FetchContainer & {
ref: "alpine"
}, },
{ ]
do: "export" },
op.#Export & {
source: "/etc/issue" source: "/etc/issue"
format: "string" format: "string"
}, },
@ -20,12 +24,14 @@ test2: {
string string
#up: [ #up: [
{ op.#Load & {
do: "load" from: [
from: [{do: "fetch-container", ref: "busybox"}] op.#FetchContainer & {
ref: "busybox"
}, },
{ ]
do: "export" },
op.#Export & {
source: "/etc/issue" source: "/etc/issue"
format: "string" format: "string"
}, },

View File

@ -1,26 +1,26 @@
package testing package testing
component: #up: [{ import "dagger.io/dagger/op"
do: "fetch-container"
component: #up: [
op.#FetchContainer & {
ref: "alpine" ref: "alpine"
}, { },
do: "exec" op.#Exec & {
args: ["sh", "-c", """ args: ["sh", "-c", """
printf lol > /id printf lol > /id
"""] """]
dir: "/" },
}] ]
test1: { test1: {
string string
#up: [ #up: [
{ op.#Load & {
do: "load"
from: component from: component
}, },
{ op.#Export & {
do: "export"
source: "/id" source: "/id"
format: "string" format: "string"
}, },
@ -31,21 +31,19 @@ test2: {
string string
#up: [ #up: [
{ op.#Load & {
do: "load" from: #up: [
from: #up: [{ op.#FetchContainer & {
do: "fetch-container"
ref: "alpine" ref: "alpine"
}, { },
do: "exec" op.#Exec & {
args: ["sh", "-c", """ args: ["sh", "-c", """
printf lol > /id printf lol > /id
"""] """]
dir: "/"
}]
}, },
{ ]
do: "export" },
op.#Export & {
source: "/id" source: "/id"
format: "string" format: "string"
}, },

View File

@ -1,15 +1,19 @@
package testing package testing
import "dagger.io/dagger/op"
test: { test: {
string string
#up: [ #up: [
{ op.#Load & {
do: "load" from: [
from: [{do: "fetch-container", ref: "alpine"}] op.#FetchContainer & {
ref: "alpine"
}, },
{ ]
do: "export" },
op.#Export & {
source: "/etc/issue" source: "/etc/issue"
format: "string" format: "string"
}, },

View File

@ -1,23 +1,22 @@
package testing package testing
import "dagger.io/dagger/op"
test: { test: {
string string
#up: [ #up: [
{ op.#Load & {
do: "load"
from: [{do: "fetch-container", ref: "alpine"}] from: [{do: "fetch-container", ref: "alpine"}]
}, },
{ op.#Exec & {
do: "exec"
args: ["sh", "-c", """ args: ["sh", "-c", """
echo "NOT SURE WHAT TO TEST YET" > /out echo "NOT SURE WHAT TO TEST YET" > /out
"""] """]
dir: "/" dir: "/"
mount: something: "cache" mount: something: "cache"
}, },
{ op.#Export & {
do: "export"
source: "/out" source: "/out"
format: "string" format: "string"
}, },

View File

@ -1,33 +1,34 @@
package testing package testing
import "dagger.io/dagger/op"
test: { test: {
string string
#up: [ #up: [
{ op.#Load & {
do: "load" from: [
from: [{do: "fetch-container", ref: "alpine"}] op.#FetchContainer & {
ref: "alpine"
}, },
{ ]
do: "exec" },
op.#Exec & {
args: ["sh", "-c", """ args: ["sh", "-c", """
cat /mnt/test/lol > /out cat /mnt/test/lol > /out
"""] """]
mount: "/mnt/test": from: #up: [ mount: "/mnt/test": from: #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "alpine" ref: "alpine"
}, },
{ op.#Exec & {
do: "exec"
args: ["sh", "-c", """ args: ["sh", "-c", """
echo -n "hello world" > /lol echo -n "hello world" > /lol
"""] """]
}, },
] ]
}, },
{ op.#Export & {
do: "export"
source: "/out" source: "/out"
format: "string" format: "string"
}, },

View File

@ -1,19 +1,22 @@
package testing package testing
import "dagger.io/dagger/op"
test: { test: {
string string
#up: [ #up: [
{ op.#Load & {
do: "load" from: [
from: [{do: "fetch-container", ref: "alpine"}] op.#FetchContainer & {
ref: "alpine"
}, },
{ ]
do: "exec" },
op.#Exec & {
args: ["sh", "-c", """ args: ["sh", "-c", """
ls -lA /lol > /out ls -lA /lol > /out
"""] """]
dir: "/"
mount: something: { mount: something: {
input: [{ input: [{
do: "fetch-container" do: "fetch-container"
@ -22,8 +25,7 @@ test: {
path: "/lol" path: "/lol"
} }
}, },
{ op.#Export & {
do: "export"
source: "/out" source: "/out"
format: "string" format: "string"
}, },

View File

@ -1,32 +1,33 @@
package testing package testing
import "dagger.io/dagger/op"
test: { test: {
string string
#up: [ #up: [
{ op.#Load & {
do: "load" from: [
from: [{do: "fetch-container", ref: "alpine"}] op.#FetchContainer & {
ref: "alpine"
}, },
{ ]
do: "exec" },
op.#Exec & {
args: ["sh", "-c", """ args: ["sh", "-c", """
echo ok > /out echo ok > /out
echo ok > /tmpdir/out echo ok > /tmpdir/out
"""] """]
dir: "/"
mount: "/tmpdir": "tmpfs" mount: "/tmpdir": "tmpfs"
}, },
{ op.#Exec & {
do: "exec"
args: ["sh", "-c", """ args: ["sh", "-c", """
[ -f /out ] || exit 1 [ -f /out ] || exit 1
# content of /cache/tmp must not exist in this layer # content of /cache/tmp must not exist in this layer
[ ! -f /tmpdir/out ] || exit 1 [ ! -f /tmpdir/out ] || exit 1
"""] """]
}, },
{ op.#Export & {
do: "export"
source: "/out" source: "/out"
format: "string" format: "string"
}, },

View File

@ -1,27 +1,24 @@
package main package main
import "dagger.io/dagger/op"
hello: { hello: {
string string
#up: [ #up: [
{ op.#FetchContainer & {
do: "fetch-container"
ref: "alpine" ref: "alpine"
}, },
{ op.#Exec & {
do: "exec"
args: ["mkdir", "-p", "/tmp/foo"] args: ["mkdir", "-p", "/tmp/foo"]
}, },
{ op.#Exec & {
do: "exec"
args: ["sh", "-c", "echo -n world > /tmp/foo/hello"] args: ["sh", "-c", "echo -n world > /tmp/foo/hello"]
}, },
{ op.#Subdir & {
do: "subdir"
dir: "/tmp/foo" dir: "/tmp/foo"
}, },
{ op.#Export & {
do: "export"
source: "/hello" source: "/hello"
format: "string" format: "string"
}, },