tests: move llb tests into tests/llb
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
13
tests/llb/exec/always/main.cue
Normal file
13
tests/llb/exec/always/main.cue
Normal file
@@ -0,0 +1,13 @@
|
||||
package testing
|
||||
|
||||
#compute: [
|
||||
{
|
||||
do: "fetch-container"
|
||||
ref: "alpine"
|
||||
},
|
||||
{
|
||||
do: "exec"
|
||||
args: ["echo", "always output"]
|
||||
always: true
|
||||
},
|
||||
]
|
16
tests/llb/exec/dir/doesnotexist/main.cue
Normal file
16
tests/llb/exec/dir/doesnotexist/main.cue
Normal file
@@ -0,0 +1,16 @@
|
||||
package testing
|
||||
|
||||
#compute: [
|
||||
{
|
||||
do: "fetch-container"
|
||||
ref: "alpine"
|
||||
},
|
||||
{
|
||||
do: "exec"
|
||||
args: ["sh", "-c", """
|
||||
echo "pwd is: $(pwd)"
|
||||
[ "$(pwd)" == "/thisisnonexistent" ] || exit 1
|
||||
"""]
|
||||
dir: "/thisisnonexistent"
|
||||
},
|
||||
]
|
16
tests/llb/exec/dir/exist/main.cue
Normal file
16
tests/llb/exec/dir/exist/main.cue
Normal file
@@ -0,0 +1,16 @@
|
||||
package testing
|
||||
|
||||
#compute: [
|
||||
{
|
||||
do: "fetch-container"
|
||||
ref: "alpine"
|
||||
},
|
||||
{
|
||||
do: "exec"
|
||||
args: ["sh", "-c", """
|
||||
echo "pwd is: $(pwd)"
|
||||
[ "$(pwd)" == "/etc" ] || exit 1
|
||||
"""]
|
||||
dir: "/etc"
|
||||
},
|
||||
]
|
15
tests/llb/exec/env/invalid/main.cue
vendored
Normal file
15
tests/llb/exec/env/invalid/main.cue
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
package testing
|
||||
|
||||
#compute: [
|
||||
{
|
||||
do: "fetch-container"
|
||||
ref: "alpine"
|
||||
},
|
||||
{
|
||||
do: "exec"
|
||||
args: ["sh", "-c", #"""
|
||||
echo "$foo"
|
||||
"""#]
|
||||
env: foo: lala: "lala"
|
||||
},
|
||||
]
|
18
tests/llb/exec/env/overlay/main.cue
vendored
Normal file
18
tests/llb/exec/env/overlay/main.cue
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
package testing
|
||||
|
||||
bar: string
|
||||
|
||||
#compute: [
|
||||
{
|
||||
do: "fetch-container"
|
||||
ref: "alpine"
|
||||
},
|
||||
{
|
||||
do: "exec"
|
||||
args: ["sh", "-c", """
|
||||
echo "foo: $foo"
|
||||
[ "$foo" == "overlay environment" ] || exit 1
|
||||
"""]
|
||||
env: foo: bar
|
||||
},
|
||||
]
|
15
tests/llb/exec/env/valid/main.cue
vendored
Normal file
15
tests/llb/exec/env/valid/main.cue
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
package testing
|
||||
|
||||
#compute: [
|
||||
{
|
||||
do: "fetch-container"
|
||||
ref: "alpine"
|
||||
},
|
||||
{
|
||||
do: "exec"
|
||||
args: ["sh", "-c", """
|
||||
[ "$foo" == "output environment" ] || exit 1
|
||||
"""]
|
||||
env: foo: "output environment"
|
||||
},
|
||||
]
|
12
tests/llb/exec/error/main.cue
Normal file
12
tests/llb/exec/error/main.cue
Normal file
@@ -0,0 +1,12 @@
|
||||
package testing
|
||||
|
||||
#compute: [
|
||||
{
|
||||
do: "fetch-container"
|
||||
ref: "alpine"
|
||||
},
|
||||
{
|
||||
do: "exec"
|
||||
args: ["erroringout"]
|
||||
},
|
||||
]
|
14
tests/llb/exec/exit_code/main.cue
Normal file
14
tests/llb/exec/exit_code/main.cue
Normal file
@@ -0,0 +1,14 @@
|
||||
package testing
|
||||
|
||||
#compute: [
|
||||
{
|
||||
do: "fetch-container"
|
||||
ref: "alpine"
|
||||
},
|
||||
{
|
||||
do: "exec"
|
||||
args: ["sh", "-c", "exit 123"]
|
||||
// XXX Blocked by https://github.com/blocklayerhq/dagger/issues/19
|
||||
dir: "/"
|
||||
},
|
||||
]
|
11
tests/llb/exec/invalid/main.cue
Normal file
11
tests/llb/exec/invalid/main.cue
Normal file
@@ -0,0 +1,11 @@
|
||||
package testing
|
||||
|
||||
#compute: [
|
||||
{
|
||||
do: "fetch-container"
|
||||
ref: "alpine"
|
||||
},
|
||||
{
|
||||
do: "exec"
|
||||
},
|
||||
]
|
12
tests/llb/exec/simple/main.cue
Normal file
12
tests/llb/exec/simple/main.cue
Normal file
@@ -0,0 +1,12 @@
|
||||
package testing
|
||||
|
||||
#compute: [
|
||||
{
|
||||
do: "fetch-container"
|
||||
ref: "alpine"
|
||||
},
|
||||
{
|
||||
do: "exec"
|
||||
args: ["echo", "simple output"]
|
||||
},
|
||||
]
|
@@ -0,0 +1,20 @@
|
||||
package testing
|
||||
|
||||
hello: "world"
|
||||
bar: string
|
||||
|
||||
#compute: [
|
||||
{
|
||||
do: "fetch-container"
|
||||
ref: "alpine"
|
||||
},
|
||||
{
|
||||
do: "exec"
|
||||
dir: "/"
|
||||
args: ["sh", "-c", """
|
||||
echo \(hello)
|
||||
echo "This test SHOULD fail, because this script SHOULD execute, since bar is not referenced"
|
||||
exit 1
|
||||
"""]
|
||||
},
|
||||
]
|
20
tests/llb/exec/undefined/non_concrete_referenced/main.cue
Normal file
20
tests/llb/exec/undefined/non_concrete_referenced/main.cue
Normal file
@@ -0,0 +1,20 @@
|
||||
package testing
|
||||
|
||||
hello: "world"
|
||||
bar: string
|
||||
|
||||
#compute: [
|
||||
{
|
||||
do: "fetch-container"
|
||||
ref: "alpine"
|
||||
},
|
||||
{
|
||||
do: "exec"
|
||||
dir: "/"
|
||||
args: ["sh", "-c", """
|
||||
echo \(bar)
|
||||
echo "This test SHOULD succeed, because this is never going to be executed, as \(bar) is not concrete"
|
||||
exit 1
|
||||
"""]
|
||||
},
|
||||
]
|
1
tests/llb/exec/undefined/with_pkg_def/cue.mod/module.cue
Normal file
1
tests/llb/exec/undefined/with_pkg_def/cue.mod/module.cue
Normal file
@@ -0,0 +1 @@
|
||||
module: "dagger.io/testing"
|
@@ -0,0 +1,17 @@
|
||||
package def
|
||||
|
||||
#dang: string
|
||||
|
||||
#compute: [
|
||||
{
|
||||
do: "fetch-container"
|
||||
ref: "alpine"
|
||||
},
|
||||
{
|
||||
do: "exec"
|
||||
dir: "/"
|
||||
args: ["sh", "-c", """
|
||||
echo success
|
||||
"""]
|
||||
},
|
||||
]
|
12
tests/llb/exec/undefined/with_pkg_def/main.cue
Normal file
12
tests/llb/exec/undefined/with_pkg_def/main.cue
Normal file
@@ -0,0 +1,12 @@
|
||||
package testing
|
||||
|
||||
import (
|
||||
"dagger.io/def"
|
||||
)
|
||||
|
||||
#compute: [
|
||||
{
|
||||
do: "load",
|
||||
from: def
|
||||
},
|
||||
]
|
@@ -0,0 +1 @@
|
||||
module: "dagger.io/testing"
|
@@ -0,0 +1,18 @@
|
||||
package nonoptional
|
||||
|
||||
dang: string
|
||||
|
||||
#compute: [
|
||||
{
|
||||
do: "fetch-container"
|
||||
ref: "alpine"
|
||||
},
|
||||
{
|
||||
do: "exec"
|
||||
dir: "/"
|
||||
args: ["sh", "-c", """
|
||||
echo "This test SHOULD fail, because this SHOULD be executed"
|
||||
exit 1
|
||||
"""]
|
||||
},
|
||||
]
|
12
tests/llb/exec/undefined/with_pkg_mandatory/main.cue
Normal file
12
tests/llb/exec/undefined/with_pkg_mandatory/main.cue
Normal file
@@ -0,0 +1,12 @@
|
||||
package testing
|
||||
|
||||
import (
|
||||
"dagger.io/nonoptional"
|
||||
)
|
||||
|
||||
#compute: [
|
||||
{
|
||||
do: "load",
|
||||
from: nonoptional
|
||||
},
|
||||
]
|
@@ -0,0 +1 @@
|
||||
module: "dagger.io/testing"
|
@@ -0,0 +1,17 @@
|
||||
package optional
|
||||
|
||||
dang?: string
|
||||
|
||||
#compute: [
|
||||
{
|
||||
do: "fetch-container"
|
||||
ref: "alpine"
|
||||
},
|
||||
{
|
||||
do: "exec"
|
||||
dir: "/"
|
||||
args: ["sh", "-c", """
|
||||
echo success
|
||||
"""]
|
||||
},
|
||||
]
|
12
tests/llb/exec/undefined/with_pkg_optional/main.cue
Normal file
12
tests/llb/exec/undefined/with_pkg_optional/main.cue
Normal file
@@ -0,0 +1,12 @@
|
||||
package testing
|
||||
|
||||
import (
|
||||
"dagger.io/optional"
|
||||
)
|
||||
|
||||
#compute: [
|
||||
{
|
||||
do: "load",
|
||||
from: optional
|
||||
},
|
||||
]
|
Reference in New Issue
Block a user