From 39a7ebd176f4afbd304c640058f3b1c35e6d4eb3 Mon Sep 17 00:00:00 2001 From: Andrea Luzzardi Date: Mon, 1 Mar 2021 18:16:56 -0800 Subject: [PATCH] tests: enable mount cache test, fix mount component test Related to #46 Signed-off-by: Andrea Luzzardi --- tests/mounts/valid/component/main.cue | 22 ++++++++++++++-------- tests/test.sh | 12 ++++++------ 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/tests/mounts/valid/component/main.cue b/tests/mounts/valid/component/main.cue index b6d78345..d592b42b 100644 --- a/tests/mounts/valid/component/main.cue +++ b/tests/mounts/valid/component/main.cue @@ -11,15 +11,21 @@ test: { { do: "exec" args: ["sh", "-c", """ - ls -lA /lol > /out + cat /mnt/test/lol > /out """] - dir: "/" - mount: something: { - input: dagger: #compute: [{ - do: "fetch-container" - ref: "alpine" - }] - path: "/lol" + mount: "/mnt/test": { + from: #dagger: compute: [ + { + do: "fetch-container" + ref: "alpine" + }, + { + do: "exec" + args: ["sh", "-c", """ + echo -n "hello world" > /lol + """] + } + ] } }, { diff --git a/tests/test.sh b/tests/test.sh index 3866bba4..fb166a30 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -197,16 +197,16 @@ test::local(){ test::mount(){ disable test::one "Mount: tmpfs (FIXME https://github.com/blocklayerhq/dagger/issues/46)" --exit=0 \ - "$dagger" "${DAGGER_BINARY_ARGS[@]}" compute "$d"/mount/valid/tmpfs + "$dagger" "${DAGGER_BINARY_ARGS[@]}" compute "$d"/mounts/valid/tmpfs - disable test::one "Mount: cache (FIXME https://github.com/blocklayerhq/dagger/issues/46)" --exit=0 \ - "$dagger" "${DAGGER_BINARY_ARGS[@]}" compute "$d"/mount/valid/cache + test::one "Mount: cache (FIXME https://github.com/blocklayerhq/dagger/issues/46)" --exit=0 \ + "$dagger" "${DAGGER_BINARY_ARGS[@]}" compute "$d"/mounts/valid/cache - disable test::one "Mount: component (FIXME https://github.com/blocklayerhq/dagger/issues/46)" --exit=0 \ - "$dagger" "${DAGGER_BINARY_ARGS[@]}" compute "$d"/mount/valid/component + test::one "Mount: component (FIXME https://github.com/blocklayerhq/dagger/issues/46)" --exit=0 --stdout='{"test":"hello world"}' \ + "$dagger" "${DAGGER_BINARY_ARGS[@]}" compute "$d"/mounts/valid/component disable test::one "Mount: script (FIXME https://github.com/blocklayerhq/dagger/issues/46)" --exit=0 \ - "$dagger" "${DAGGER_BINARY_ARGS[@]}" compute "$d"/mount/valid/script + "$dagger" "${DAGGER_BINARY_ARGS[@]}" compute "$d"/mounts/valid/script } test::input() {