Skip to content

Commit

Permalink
Update the verify_workspace test to also check distdir_deps.bzl.
Browse files Browse the repository at this point in the history
Closes bazelbuild#13260.

PiperOrigin-RevId: 364642451
  • Loading branch information
katre authored and copybara-github committed Mar 23, 2021
1 parent 36e11b2 commit 9a56b80
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/test/shell/bazel/verify_workspace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,22 @@ fi
source "$(rlocation "io_bazel/src/test/shell/integration_test_setup.sh")" \
|| { echo "integration_test_setup.sh not found!" >&2; exit 1; }

WORKSPACE_FILE="$(rlocation io_bazel/WORKSPACE)"
WORKSPACE_FILES=("$(rlocation io_bazel/WORKSPACE)" "$(rlocation io_bazel/distdir_deps.bzl)")

function test_verify_urls() {
# Find url-shaped lines, skipping jekyll-tree (which isn't a valid URL), and
# skipping comments.
invalid_urls=()
for url in $(grep -E '"https://|http://' "${WORKSPACE_FILE}" | \
grep -v 'jekyll-tree' | \
grep -v '^ *#' | \
perl -pe 's#.*"(https?://[^"]+)".*#$1#g' | \
sort -u); do
#echo "Checking ${url}"
if ! curl --head -silent --fail --output /dev/null --retry 3 "${url}"; then
#fail "URL ${url} is invalid."
invalid_urls+=("${url}")
fi
for file in "${WORKSPACE_FILES[@]}"; do
for url in $(grep -E '"https://|http://' "${file}" | \
sed -e '/jekyll-tree/d' -e '/^#/d' -r -e 's#^.*"(https?://[^"]+)".*$#\1#g' | \
sort -u); do
#echo "Checking ${url}"
if ! curl --head -silent --fail --output /dev/null --retry 3 "${url}"; then
#fail "URL ${url} is invalid."
invalid_urls+=("${url}")
fi
done
done

if [[ ${#invalid_urls[@]} > 0 ]]; then
Expand Down

0 comments on commit 9a56b80

Please sign in to comment.