tests: convert react example test to bats
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
parent
876ff7d4d6
commit
fb2e140b91
16
tests/examples.bats
Normal file
16
tests/examples.bats
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
setup() {
|
||||||
|
load 'helpers'
|
||||||
|
|
||||||
|
common_setup
|
||||||
|
}
|
||||||
|
|
||||||
|
@test "example: react" {
|
||||||
|
skip_unless_secrets_available "$TESTDIR"/examples/react/inputs.yaml
|
||||||
|
|
||||||
|
run "$DAGGER" compute -l fatal "$TESTDIR"/../examples/react --input-yaml "$TESTDIR"/examples/react/inputs.yaml
|
||||||
|
assert_success
|
||||||
|
url=$(echo "$output" | jq -r .www.deployUrl)
|
||||||
|
run curl -sS "$url"
|
||||||
|
assert_success
|
||||||
|
assert_output --partial "Todo App"
|
||||||
|
}
|
@ -1,12 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -o errexit -o errtrace -o functrace -o nounset -o pipefail
|
|
||||||
|
|
||||||
# Test Directory
|
|
||||||
d=$(cd "$(dirname "${BASH_SOURCE[0]:-$PWD}")" 2>/dev/null 1>&2 && pwd)
|
|
||||||
|
|
||||||
test::examples() {
|
|
||||||
local dagger="$1"
|
|
||||||
|
|
||||||
test::secret "$d"/examples/react/inputs.yaml "examples: React" --exit=0 \
|
|
||||||
"$dagger" "${DAGGER_BINARY_ARGS[@]}" compute "$d"/../examples/react
|
|
||||||
}
|
|
@ -19,15 +19,12 @@ d=$(cd "$(dirname "${BASH_SOURCE[0]:-$PWD}")" 2>/dev/null 1>&2 && pwd)
|
|||||||
. "$d/test-compute.sh"
|
. "$d/test-compute.sh"
|
||||||
# shellcheck source=/dev/null
|
# shellcheck source=/dev/null
|
||||||
. "$d/test-stdlib.sh"
|
. "$d/test-stdlib.sh"
|
||||||
# shellcheck source=/dev/null
|
|
||||||
. "$d/test-examples.sh"
|
|
||||||
|
|
||||||
test::all(){
|
test::all(){
|
||||||
local dagger="$1"
|
local dagger="$1"
|
||||||
|
|
||||||
test::suite "compute" && test::compute "$dagger"
|
test::suite "compute" && test::compute "$dagger"
|
||||||
test::suite "stdlib" && test::stdlib "$dagger"
|
test::suite "stdlib" && test::stdlib "$dagger"
|
||||||
test::suite "examples" && test::examples "$dagger"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
test::suite() {
|
test::suite() {
|
||||||
|
Reference in New Issue
Block a user