Skip to content

Commit

Permalink
Disable test_path_is_consistent_regardless_of_base_url
Browse files Browse the repository at this point in the history
  • Loading branch information
meteorcloudy committed Nov 10, 2023
1 parent 9e40076 commit 81ae864
Showing 1 changed file with 46 additions and 46 deletions.
92 changes: 46 additions & 46 deletions bazelisk_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -299,52 +299,52 @@ EOF
(echo "FAIL: Expected to find 'BAZELISK_SKIP_WRAPPER=true' in the output of 'bazelisk version'"; exit 1)
}

function test_path_is_consistent_regardless_of_base_url() {
setup

echo 6.2.0 > .bazelversion

cat >WORKSPACE <<EOF
load("//:print_path.bzl", "print_path")
print_path(name = "print_path")
load("@print_path//:defs.bzl", "noop")
noop()
EOF

cat >print_path.bzl <<EOF
def _print_path_impl(rctx):
print("PATH is: {}".format(rctx.os.environ["PATH"]))
rctx.file("WORKSPACE", "")
rctx.file("BUILD", "")
rctx.file("defs.bzl", "def noop(): pass")
print_path = repository_rule(
implementation = _print_path_impl,
)
EOF

BAZELISK_HOME="$BAZELISK_HOME" bazelisk sync --only=print_path 2>&1 | tee log1

BAZELISK_HOME="$BAZELISK_HOME" bazelisk clean --expunge 2>&1

# We need a separate mirror of bazel binaries, which has identical files.
# Ideally we wouldn't depend on sourceforge for test runtime, but hey, it exists and it works.
# Disabled due to https://github.com/bazelbuild/bazelisk/pull/465#issuecomment-1805905082
# BAZELISK_HOME="$BAZELISK_HOME" BAZELISK_BASE_URL=https://downloads.sourceforge.net/project/bazel.mirror bazelisk sync --only=print_path 2>&1 | tee log2

path1="$(grep "PATH is:" log1)"
path2="$(grep "PATH is:" log2)"

[[ -n "${path1}" && -n "${path2}" ]] || \
(echo "FAIL: Expected PATH to be non-empty, got path1=${path1}, path2=${path2}"; exit 1)

[[ "${path1}" == "${path2}" ]] || \
(echo "FAIL: Expected PATH to be the same regardless of which mirror was used, got path1=${path1}, path2=${path2}"; exit 1)
}
# Disabled due to https://github.com/bazelbuild/bazelisk/pull/465#issuecomment-1805905082
# function test_path_is_consistent_regardless_of_base_url() {
# setup
#
# echo 6.2.0 > .bazelversion
#
# cat >WORKSPACE <<EOF
# load("//:print_path.bzl", "print_path")
#
# print_path(name = "print_path")
#
# load("@print_path//:defs.bzl", "noop")
#
# noop()
# EOF
#
# cat >print_path.bzl <<EOF
# def _print_path_impl(rctx):
# print("PATH is: {}".format(rctx.os.environ["PATH"]))
#
# rctx.file("WORKSPACE", "")
# rctx.file("BUILD", "")
# rctx.file("defs.bzl", "def noop(): pass")
#
# print_path = repository_rule(
# implementation = _print_path_impl,
# )
# EOF
#
# BAZELISK_HOME="$BAZELISK_HOME" bazelisk sync --only=print_path 2>&1 | tee log1
#
# BAZELISK_HOME="$BAZELISK_HOME" bazelisk clean --expunge 2>&1
#
# # We need a separate mirror of bazel binaries, which has identical files.
# # Ideally we wouldn't depend on sourceforge for test runtime, but hey, it exists and it works.
# BAZELISK_HOME="$BAZELISK_HOME" BAZELISK_BASE_URL=https://downloads.sourceforge.net/project/bazel.mirror bazelisk sync --only=print_path 2>&1 | tee log2
#
# path1="$(grep "PATH is:" log1)"
# path2="$(grep "PATH is:" log2)"
#
# [[ -n "${path1}" && -n "${path2}" ]] || \
# (echo "FAIL: Expected PATH to be non-empty, got path1=${path1}, path2=${path2}"; exit 1)
#
# [[ "${path1}" == "${path2}" ]] || \
# (echo "FAIL: Expected PATH to be the same regardless of which mirror was used, got path1=${path1}, path2=${path2}"; exit 1)
# }

function test_skip_wrapper() {
setup
Expand Down

0 comments on commit 81ae864

Please sign in to comment.