diff --git a/tests/test-cli.sh b/tests/test-cli.sh index af8a011e..22fa040e 100644 --- a/tests/test-cli.sh +++ b/tests/test-cli.sh @@ -9,6 +9,7 @@ test::cli() { test::cli::list "$dagger" test::cli::newdir "$dagger" + test::cli::newgit "$dagger" test::cli::query "$dagger" } @@ -54,6 +55,27 @@ test::cli::newdir() { "$dagger" "${DAGGER_BINARY_ARGS[@]}" query -f cue -d "simple" -c } +test::cli::newgit() { + local dagger="$1" + + # Create temporary store + local DAGGER_STORE + DAGGER_STORE="$(mktemp -d -t dagger-store-XXXXXX)" + export DAGGER_STORE + + test::one "CLI: new: --plan-git" \ + "$dagger" "${DAGGER_BINARY_ARGS[@]}" new --plan-git https://github.com/samalba/dagger-test.git simple + + test::one "CLI: new: verify plan can be upped" \ + "$dagger" "${DAGGER_BINARY_ARGS[@]}" up -d "simple" + + test::one "CLI: new: verify we have the right plan" --stdout='{ + foo: "value" + bar: "another value" +}' \ + "$dagger" "${DAGGER_BINARY_ARGS[@]}" query -d "simple" -c +} + test::cli::query() { local dagger="$1"