Adding tests
Signed-off-by: dubo-dubon-duponey <dubodubonduponey+github@pm.me>
This commit is contained in:
15
examples/tests/exec/always/main.cue
Normal file
15
examples/tests/exec/always/main.cue
Normal 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
|
||||
},
|
||||
]
|
13
examples/tests/exec/dir/doesnotexist/main.cue
Normal file
13
examples/tests/exec/dir/doesnotexist/main.cue
Normal 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"
|
||||
},
|
||||
]
|
16
examples/tests/exec/dir/exist/main.cue
Normal file
16
examples/tests/exec/dir/exist/main.cue
Normal 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"
|
||||
},
|
||||
]
|
17
examples/tests/exec/env/invalid/main.cue
vendored
Normal file
17
examples/tests/exec/env/invalid/main.cue
vendored
Normal 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: "/"
|
||||
},
|
||||
]
|
21
examples/tests/exec/env/overlay/main.cue
vendored
Normal file
21
examples/tests/exec/env/overlay/main.cue
vendored
Normal 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
17
examples/tests/exec/env/valid/main.cue
vendored
Normal 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: "/"
|
||||
},
|
||||
]
|
14
examples/tests/exec/error/main.cue
Normal file
14
examples/tests/exec/error/main.cue
Normal 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: "/"
|
||||
},
|
||||
]
|
13
examples/tests/exec/invalid/main.cue
Normal file
13
examples/tests/exec/invalid/main.cue
Normal 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: "/"
|
||||
},
|
||||
}
|
14
examples/tests/exec/simple/main.cue
Normal file
14
examples/tests/exec/simple/main.cue
Normal 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: "/"
|
||||
},
|
||||
]
|
Reference in New Issue
Block a user