From 53f4ef049ae2ac387308842943e7d82c06defc8b Mon Sep 17 00:00:00 2001 From: Solomon Hykes Date: Mon, 21 Jun 2021 09:07:18 +0000 Subject: [PATCH] stdlib: dagger.#Output Signed-off-by: Solomon Hykes --- .dagger/env/test-core/plan/test-core.cue | 4 ++-- stdlib/dagger/dagger.cue | 6 ++++++ tests/core.bats | 7 ++++++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.dagger/env/test-core/plan/test-core.cue b/.dagger/env/test-core/plan/test-core.cue index a3495b94..aae00c60 100644 --- a/.dagger/env/test-core/plan/test-core.cue +++ b/.dagger/env/test-core/plan/test-core.cue @@ -8,8 +8,8 @@ name: dagger.#Input & { string | *"world" } -message: "Hello, \(name)!" @dagger(output) +message: dagger.#Output & "Hello, \(name)!" dir: dagger.#Input & dagger.#Artifact -samedir: dir @dagger(output) +samedir: dagger.#Output & dir diff --git a/stdlib/dagger/dagger.cue b/stdlib/dagger/dagger.cue index 094159b3..f0463135 100644 --- a/stdlib/dagger/dagger.cue +++ b/stdlib/dagger/dagger.cue @@ -25,3 +25,9 @@ import ( _ ... } + +#Output: { + @dagger(output) + _ + ... +} diff --git a/tests/core.bats b/tests/core.bats index 542c9eae..ee600509 100644 --- a/tests/core.bats +++ b/tests/core.bats @@ -9,7 +9,7 @@ setup() { unset DAGGER_WORKSPACE } -@test "core: inputs" { +@test "core: inputs & outputs" { # List available inputs run dagger -e test-core input list assert_success @@ -22,9 +22,14 @@ setup() { assert_success assert_output --partial 'Hello, Bob!' + run dagger -e test-core output list + assert_success + assert_output --partial 'message "Hello, Bob!"' + # Unset text input dagger -e test-core input unset name run dagger -e test-core up assert_success assert_output --partial 'Hello, world!' } +