Skip to content

Instantly share code, notes, and snippets.

@andyscott
Created August 26, 2019 15:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andyscott/4136e929e6e42a8329d27f04e2fe10a6 to your computer and use it in GitHub Desktop.
Save andyscott/4136e929e6e42a8329d27f04e2fe10a6 to your computer and use it in GitHub Desktop.
#
# .bazelrc has --test_tag_filters=-integration
# so integration tagged tests are skipped by default
#
echo ">> 🧐 Running Isolated Tests 🧐 <<"
START_TIME=$SECONDS
./bazel test \
//...
ELAPSED_TIME_MS_TEST=$(((SECONDS - START_TIME)*1000))
# Start any external services that integration tests depend on
./start-integration-test-infra.sh
# Compute a marker value. Changes in this value invalidate the cache,
# which force re-runs of integration tests if integration infra
# changes.
__INFRA_MARKER_VALUE=$(
shasum -a 256 ./start-integration-test-infra.sh \
| awk '{print $1}'
)
echo ">> 🔎 Running Integration Tests 🔍 <<"
START_TIME=$SECONDS
./bazel test \
--test_tag_filters=integration \
--test_env=__INFRA_MARKER_VALUE="$__INFRA_MARKER_VALUE" \
//...
ELAPSED_TIME_MS_INTEGRATION_TEST=$(((SECONDS - START_TIME)*1000))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment