From cf7e222a0446c1c4451a96efbe3e8274042949d8 Mon Sep 17 00:00:00 2001 From: Guillaume de Rouville Date: Fri, 20 Aug 2021 18:00:10 +0200 Subject: [PATCH] Fix bats dagger to bats dagger() expansion not working inside shellscript Signed-off-by: Guillaume de Rouville --- docs/learn/tests/doc.bats | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/learn/tests/doc.bats b/docs/learn/tests/doc.bats index fdab968e..a2c1d891 100644 --- a/docs/learn/tests/doc.bats +++ b/docs/learn/tests/doc.bats @@ -243,8 +243,14 @@ setup() { cp $CODEBLOC_SRC/dev-cue-package/source.cue cue.mod/pkg/github.com/tjovicic/gcpcloudrun/source.cue cp $CODEBLOC_SRC/dev-cue-package/script.sh . + # We remove the last line of the script, as bats cannot expand dagger + # to dagger() bats helper func inside bash files + sed '$d' < script.sh > tmpFile ; mv tmpFile script.sh + chmod +x script.sh ./script.sh + # Command removed from script.sh above + dagger new staging -p ./test run dagger up -e staging - assert_output --partial "environment=staging input=run.gcpConfig.serviceKey" + assert_output --partial "input=run.gcpConfig.serviceKey" }