test: added cli test for new --plan-git

Signed-off-by: Sam Alba <sam.alba@gmail.com>
This commit is contained in:
Sam Alba 2021-04-02 13:55:01 -07:00
parent 540f373993
commit 8bb2cfbb21

View File

@ -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"