-
Notifications
You must be signed in to change notification settings - Fork 522
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add clean_legacy_e2e.sh script for local dev (#704)
- Loading branch information
1 parent
d024566
commit 9918842
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eu -o pipefail | ||
# -e: exits if a command fails | ||
# -u: errors if an variable is referenced before being set | ||
# -o pipefail: causes a pipeline to produce a failure return code if any command errors | ||
|
||
readonly E2E_TESTS=${@:?"No e2e test names specified"} | ||
|
||
readonly RULES_NODEJS_DIR=$(cd $(dirname "$0")/..; pwd) | ||
readonly E2E_DIR="${RULES_NODEJS_DIR}/internal/e2e" | ||
|
||
echo_and_run() { echo "+ $@" ; "$@" ; } | ||
|
||
for e2eTest in ${E2E_TESTS[@]} ; do | ||
( | ||
# Clean e2e test | ||
cd "${E2E_DIR}/${e2eTest}" | ||
printf "\n\nCleaning legacy e2e test ${e2eTest}\n" | ||
${RULES_NODEJS_DIR}/scripts/unlink_deps.sh | ||
echo_and_run bazel clean --expunge | ||
echo_and_run rm -rf `find . -type d -name node_modules -prune` | ||
) | ||
done |