tests: move compute tests away
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
1
tests/core/dependencies/interpolation/cue.mod/module.cue
Normal file
1
tests/core/dependencies/interpolation/cue.mod/module.cue
Normal file
@@ -0,0 +1 @@
|
||||
module: ""
|
2
tests/core/dependencies/interpolation/cue.mod/pkg/.gitignore
vendored
Normal file
2
tests/core/dependencies/interpolation/cue.mod/pkg/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
# dagger universe
|
||||
alpha.dagger.io
|
47
tests/core/dependencies/interpolation/main.cue
Normal file
47
tests/core/dependencies/interpolation/main.cue
Normal 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"
|
||||
},
|
||||
]
|
||||
}
|
1
tests/core/dependencies/simple/cue.mod/module.cue
Normal file
1
tests/core/dependencies/simple/cue.mod/module.cue
Normal file
@@ -0,0 +1 @@
|
||||
module: ""
|
2
tests/core/dependencies/simple/cue.mod/pkg/.gitignore
vendored
Normal file
2
tests/core/dependencies/simple/cue.mod/pkg/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
# dagger universe
|
||||
alpha.dagger.io
|
47
tests/core/dependencies/simple/main.cue
Normal file
47
tests/core/dependencies/simple/main.cue
Normal 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"
|
||||
},
|
||||
]
|
||||
}
|
1
tests/core/dependencies/unmarshal/cue.mod/module.cue
Normal file
1
tests/core/dependencies/unmarshal/cue.mod/module.cue
Normal file
@@ -0,0 +1 @@
|
||||
module: ""
|
2
tests/core/dependencies/unmarshal/cue.mod/pkg/.gitignore
vendored
Normal file
2
tests/core/dependencies/unmarshal/cue.mod/pkg/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
# dagger universe
|
||||
alpha.dagger.io
|
52
tests/core/dependencies/unmarshal/main.cue
Normal file
52
tests/core/dependencies/unmarshal/main.cue
Normal 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"
|
||||
},
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user