Skip to content

Commit

Permalink
remove unnecessary verify_build_configs function
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Northey <ryan@synca.io>
  • Loading branch information
phlax committed Oct 4, 2020
1 parent 96a8a20 commit 48b24d5
Showing 1 changed file with 2 additions and 36 deletions.
38 changes: 2 additions & 36 deletions ci/verify_examples.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
#!/bin/bash -E

TESTCOMMAND="${1:-}"
TESTFILTER="${2:-*}"
TESTFILTER="${1:-*}"
FAILED=()
SRCDIR="${SRCDIR:-$(pwd)}"
EXCLUDED_BUILD_CONFIGS=${EXCLUDED_BUILD_CONFIGS:-"^./cache/responses.yaml|^./jaeger-native-tracing|docker-compose"}


trap_errors () {
Expand Down Expand Up @@ -39,39 +37,7 @@ run_examples () {
done
}

verify_build_configs () {
local config configs missing
missing=()
cd "${SRCDIR}/examples" || return 1
configs="$(find . -name "*.yaml" -o -name "*.lua" | grep -vE "${EXCLUDED_BUILD_CONFIGS}" | cut -d/ -f2-)"
for config in $configs; do
grep "\"$config\"" BUILD || missing+=("$config")
done
if [[ -n "${missing[*]}" ]]; then
for config in "${missing[@]}"; do
echo "Missing config: $config" >&2
done
return 1
fi
}

case "$TESTCOMMAND" in
build_config)
echo "Running build_configs test"
verify_build_configs
;;
sandbox)
echo "Running sandbox test"
run_examples
;;
""|all)
echo "Running all tests"
verify_build_configs
run_examples
;;
*)
echo "Usage: ./ci/verify_examples.sh [build_config|sandbox|all] [<test_filter>]"
esac
run_examples

if [[ "${#FAILED[@]}" -ne "0" ]]; then
echo "TESTS FAILED:"
Expand Down

0 comments on commit 48b24d5

Please sign in to comment.