Work on integration tests

- add new entries for #70 and #74
- cleaned-up / enriched a little bit compute and exec tests

Signed-off-by: dubo-dubon-duponey <dubodubonduponey+github@pm.me>
This commit is contained in:
dubo-dubon-duponey
2021-01-26 11:33:10 -08:00
parent d06070b85a
commit 707dbd0256
20 changed files with 254 additions and 23 deletions

View File

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

View File

@@ -0,0 +1,20 @@
package testing
hello: "world"
bar: string
#dagger: 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
"""]
},
]

View File

@@ -0,0 +1,20 @@
package testing
hello: "world"
bar: string
#dagger: 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
"""]
},
]

View File

@@ -0,0 +1 @@
module: "dagger.cloud/testing"

View File

@@ -0,0 +1,19 @@
package def
#dang: string
#dagger: {
compute: [
{
do: "fetch-container"
ref: "alpine"
},
{
do: "exec"
dir: "/"
args: ["sh", "-c", """
echo success
"""]
},
]
}

View File

@@ -0,0 +1,14 @@
package testing
import (
"dagger.cloud/def"
)
#dagger: {
compute: [
{
do: "load",
from: def
},
]
}

View File

@@ -0,0 +1 @@
module: "dagger.cloud/testing"

View File

@@ -0,0 +1,20 @@
package nonoptional
dang: string
#dagger: {
compute: [
{
do: "fetch-container"
ref: "alpine"
},
{
do: "exec"
dir: "/"
args: ["sh", "-c", """
echo "This test SHOULD fail, because this SHOULD be executed"
exit 1
"""]
},
]
}

View File

@@ -0,0 +1,14 @@
package testing
import (
"dagger.cloud/nonoptional"
)
#dagger: {
compute: [
{
do: "load",
from: nonoptional
},
]
}

View File

@@ -0,0 +1 @@
module: "dagger.cloud/testing"

View File

@@ -0,0 +1,19 @@
package optional
dang?: string
#dagger: {
compute: [
{
do: "fetch-container"
ref: "alpine"
},
{
do: "exec"
dir: "/"
args: ["sh", "-c", """
echo success
"""]
},
]
}

View File

@@ -0,0 +1,14 @@
package testing
import (
"dagger.cloud/optional"
)
#dagger: {
compute: [
{
do: "load",
from: optional
},
]
}