Adding tests

Signed-off-by: dubo-dubon-duponey <dubodubonduponey+github@pm.me>
This commit is contained in:
dubo-dubon-duponey
2021-01-14 13:50:54 -08:00
parent 9338d10a04
commit e301dfa7b1
33 changed files with 761 additions and 1 deletions

View File

@@ -0,0 +1,15 @@
package testing
#dagger: compute: [
{
do: "fetch-container"
ref: "alpine"
},
{
do: "exec"
args: ["echo", "always output"]
// XXX Blocked by https://github.com/blocklayerhq/dagger/issues/19
dir: "/"
always: true
},
]

View File

@@ -0,0 +1,13 @@
package testing
#dagger: compute: [
{
do: "fetch-container"
ref: "alpine"
},
{
do: "exec"
args: ["sh", "-c", "echo should not succeed"]
dir: "/thisisnonexistent"
},
]

View File

@@ -0,0 +1,16 @@
package testing
#dagger: compute: [
{
do: "fetch-container"
ref: "alpine"
},
{
do: "exec"
args: ["sh", "-c", """
echo "pwd is: $(pwd)"
[ "$(pwd)" == "/etc" ] || exit 1
"""]
dir: "/etc"
},
]

View File

@@ -0,0 +1,17 @@
package testing
#dagger: compute: [
{
do: "fetch-container"
ref: "alpine"
},
{
do: "exec"
args: ["sh", "-c", #"""
echo "$foo"
"""#]
env: foo: {lala: "lala"}
// XXX Blocked by https://github.com/blocklayerhq/dagger/issues/19
dir: "/"
},
]

View File

@@ -0,0 +1,21 @@
package testing
bar: string
#dagger: compute: [
{
do: "fetch-container"
ref: "alpine"
},
{
do: "exec"
args: ["sh", "-c", """
echo "foo: $foo"
[ "$foo" == "overlay environment" ] || exit 1
"""]
env: foo: bar
always: true
// XXX Blocked by https://github.com/blocklayerhq/dagger/issues/19
dir: "/"
},
]

17
examples/tests/exec/env/valid/main.cue vendored Normal file
View File

@@ -0,0 +1,17 @@
package testing
#dagger: compute: [
{
do: "fetch-container"
ref: "alpine"
},
{
do: "exec"
args: ["sh", "-c", """
[ "$foo" == "output environment" ] || exit 1
"""]
env: foo: "output environment"
// XXX Blocked by https://github.com/blocklayerhq/dagger/issues/19
dir: "/"
},
]

View File

@@ -0,0 +1,14 @@
package testing
#dagger: compute: [
{
do: "fetch-container"
ref: "alpine"
},
{
do: "exec"
args: ["erroringout"]
// XXX Blocked by https://github.com/blocklayerhq/dagger/issues/19
dir: "/"
},
]

View File

@@ -0,0 +1,13 @@
package testing
#dagger: compute: [
{
do: "fetch-container"
ref: "alpine"
},
{
do: "exec"
// XXX Blocked by https://github.com/blocklayerhq/dagger/issues/19
dir: "/"
},
}

View File

@@ -0,0 +1,14 @@
package testing
#dagger: compute: [
{
do: "fetch-container"
ref: "alpine"
},
{
do: "exec"
args: ["echo", "simple output"]
// XXX Blocked by https://github.com/blocklayerhq/dagger/issues/19
dir: "/"
},
]