tests: move compute tests away

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
Andrea Luzzardi
2021-12-08 14:38:07 -05:00
parent 79f86227f3
commit 1872af9b18
61 changed files with 21 additions and 109 deletions

View File

@@ -0,0 +1 @@
module: ""

View File

@@ -0,0 +1,2 @@
# dagger universe
alpha.dagger.io

View File

@@ -0,0 +1,47 @@
package testing
import "alpha.dagger.io/dagger/op"
A: {
result: string
#up: [
op.#FetchContainer & {
ref: "alpine"
},
op.#Exec & {
args: ["sh", "-c", """
echo '{"result": "from A"}' > /tmp/out
""",
]
dir: "/"
},
op.#Export & {
// Source path in the container
source: "/tmp/out"
format: "json"
},
]
}
B: {
result: string
#up: [
op.#FetchContainer & {
ref: "alpine"
},
op.#Exec & {
args: ["sh", "-c", """
echo "{\\"result\\": \\"dependency \(A.result)\\"}" > /tmp/out
""",
]
dir: "/"
},
op.#Export & {
// Source path in the container
source: "/tmp/out"
format: "json"
},
]
}

View File

@@ -0,0 +1 @@
module: ""

View File

@@ -0,0 +1,2 @@
# dagger universe
alpha.dagger.io

View File

@@ -0,0 +1,47 @@
package testing
import "alpha.dagger.io/dagger/op"
A: {
result: string
#up: [
op.#FetchContainer & {
ref: "alpine"
},
op.#Exec & {
args: ["sh", "-c", """
echo '{"result": "from A"}' > /tmp/out
""",
]
},
op.#Export & {
// Source path in the container
source: "/tmp/out"
format: "json"
},
]
}
B: {
result: string
#up: [
op.#FetchContainer & {
ref: "alpine"
},
op.#Exec & {
env: DATA: A.result
args: ["sh", "-c", """
echo "{\\"result\\": \\"dependency $DATA\\"}" > /tmp/out
""",
]
dir: "/"
},
op.#Export & {
// Source path in the container
source: "/tmp/out"
format: "json"
},
]
}

View File

@@ -0,0 +1 @@
module: ""

View File

@@ -0,0 +1,2 @@
# dagger universe
alpha.dagger.io

View File

@@ -0,0 +1,52 @@
package testing
import (
"encoding/json"
"alpha.dagger.io/dagger/op"
)
A: {
string
#up: [
op.#FetchContainer & {
ref: "alpine"
},
op.#Exec & {
args: ["sh", "-c", """
echo '{"hello": "world"}' > /tmp/out
""",
]
dir: "/"
},
op.#Export & {
// Source path in the container
source: "/tmp/out"
format: "string"
},
]
}
unmarshalled: json.Unmarshal(A)
B: {
result: string
#up: [
op.#FetchContainer & {
ref: "alpine"
},
op.#Exec & {
args: ["sh", "-c", """
echo "{\\"result\\": \\"unmarshalled.hello=\(unmarshalled.hello)\\"}" > /tmp/out
""",
]
dir: "/"
},
op.#Export & {
// Source path in the container
source: "/tmp/out"
format: "json"
},
]
}