tests: convert tests to new style

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
Andrea Luzzardi
2021-10-20 12:03:22 -07:00
parent c08f619b02
commit d763976ea9
13 changed files with 79 additions and 104 deletions

View File

@@ -1,23 +1,21 @@
package testing
import "alpha.dagger.io/dagger/op"
A: {
result: string
#up: [
{
do: "fetch-container"
op.#FetchContainer & {
ref: "alpine"
},
{
do: "exec"
op.#Exec & {
args: ["sh", "-c", """
echo '{"result": "from A"}' > /tmp/out
""",
]
dir: "/"
},
{
do: "export"
op.#Export & {
// Source path in the container
source: "/tmp/out"
format: "json"
@@ -29,12 +27,10 @@ B: {
result: string
#up: [
{
do: "fetch-container"
op.#FetchContainer & {
ref: "alpine"
},
{
do: "exec"
op.#Exec & {
env: DATA: A.result
args: ["sh", "-c", """
echo "{\\"result\\": \\"dependency $DATA\\"}" > /tmp/out
@@ -42,8 +38,7 @@ B: {
]
dir: "/"
},
{
do: "export"
op.#Export & {
// Source path in the container
source: "/tmp/out"
format: "json"