From 315068ed08b3f67307dd2ef4a50d0d869333ab03 Mon Sep 17 00:00:00 2001 From: Solomon Hykes Date: Fri, 30 Apr 2021 23:42:35 +0000 Subject: [PATCH] devenv: adhoc tests for quick and easy repro directly in dagger Signed-off-by: Solomon Hykes --- .dagger/env/dev/adhoc.cue | 44 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .dagger/env/dev/adhoc.cue diff --git a/.dagger/env/dev/adhoc.cue b/.dagger/env/dev/adhoc.cue new file mode 100644 index 00000000..41f5a493 --- /dev/null +++ b/.dagger/env/dev/adhoc.cue @@ -0,0 +1,44 @@ +package main + +import ( + "dagger.io/dagger/op" +) + +// Reproduce inline issue. +// See https://github.com/dagger/dagger/issues/395 +test: adhoc: repro395: { + good: { + // This field is correctly computed because its intermediary pipeline is not inlined. + hello: sayHello.message + + // Intermediary pipeline cannot be inlined: it must be visible in a field + sayHello: { + message: { + string + #up: [ + op.#FetchContainer & { ref: "alpine" }, + op.#Exec & { + args: ["sh", "-c", "echo hello > /message"] + }, + op.#Export & { source: "/message", format: "string" }, + ] + } + } + } + bad: { + // This field is NOT correctly computed because its intermediary pipeline is inlined. + hello: { + message: { + string + #up: [ + op.#FetchContainer & { ref: "alpine" }, + op.#Exec & { + args: ["sh", "-c", "echo hello > /message"] + }, + op.#Export & { source: "/message", format: "string" }, + ] + } + }.message + + } +}