aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/shell/bazel/git_repository_test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/shell/bazel/git_repository_test.sh')
-rwxr-xr-xsrc/test/shell/bazel/git_repository_test.sh24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/test/shell/bazel/git_repository_test.sh b/src/test/shell/bazel/git_repository_test.sh
index b4a2919a0f..2c862b7f7e 100755
--- a/src/test/shell/bazel/git_repository_test.sh
+++ b/src/test/shell/bazel/git_repository_test.sh
@@ -26,8 +26,6 @@ source $(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/test-setup.sh \
# Unpacks the test Git repositories in the test temporary directory.
function set_up() {
bazel clean --expunge
- execroot=$(bazel info execution_root)
- genfiles=$execroot/../g/bazel-out/local-fastbuild/genfiles
local repos_dir=$TEST_TMPDIR/repos
if [ -e "$repos_dir" ]; then
rm -rf $repos_dir
@@ -269,17 +267,17 @@ EOF
bazel --batch build @g//:g >& $TEST_log || fail "Build failed"
expect_log "Cloning"
- assert_contains "GIT 1" "$genfiles/go"
+ assert_contains "GIT 1" bazel-genfiles/external/g/go
bazel --batch build @g//:g >& $TEST_log || fail "Build failed"
expect_not_log "Cloning"
- assert_contains "GIT 1" "$genfiles/go"
+ assert_contains "GIT 1" bazel-genfiles/external/g/go
cat > WORKSPACE <<EOF
git_repository(name='g', remote='$repo_dir', commit='62777acc')
EOF
bazel --batch build @g//:g >& $TEST_log || fail "Build failed"
expect_log "Cloning"
- assert_contains "GIT 2" "$genfiles/go"
+ assert_contains "GIT 2" bazel-genfiles/external/g/go
cat > WORKSPACE <<EOF
# This comment line is to change the line numbers, which should not cause Bazel
@@ -289,7 +287,7 @@ EOF
bazel --batch build @g//:g >& $TEST_log || fail "Build failed"
expect_not_log "Cloning"
- assert_contains "GIT 2" "$genfiles/go"
+ assert_contains "GIT 2" bazel-genfiles/external/g/go
}
@@ -302,10 +300,9 @@ function test_git_repository_refetched_when_commit_changes() {
git_repository(name='g', remote='$repo_dir', commit='f0b79ff0')
EOF
- execroot=$(bazel info execution_root)
bazel build @g//:g >& $TEST_log || fail "Build failed"
expect_log "Cloning"
- assert_contains "GIT 1" "$genfiles/go"
+ assert_contains "GIT 1" bazel-genfiles/external/g/go
cat > WORKSPACE <<EOF
git_repository(name='g', remote='$repo_dir', commit='62777acc')
@@ -314,7 +311,7 @@ EOF
bazel build @g//:g >& $TEST_log || fail "Build failed"
expect_log "Cloning"
- assert_contains "GIT 2" "$genfiles/go"
+ assert_contains "GIT 2" bazel-genfiles/external/g/go
}
function test_git_repository_and_nofetch() {
@@ -325,11 +322,10 @@ function test_git_repository_and_nofetch() {
git_repository(name='g', remote='$repo_dir', commit='f0b79ff0')
EOF
- execroot=$(bazel info execution_root)
bazel build --nofetch @g//:g >& $TEST_log && fail "Build succeeded"
expect_log "fetching repositories is disabled"
bazel build @g//:g >& $TEST_log || fail "Build failed"
- assert_contains "GIT 1" "$genfiles/go"
+ assert_contains "GIT 1" bazel-genfiles/external/g/go
cat > WORKSPACE <<EOF
git_repository(name='g', remote='$repo_dir', commit='62777acc')
@@ -338,9 +334,9 @@ EOF
bazel build --nofetch @g//:g >& $TEST_log || fail "Build failed"
expect_log "External repository 'g' is not up-to-date"
- assert_contains "GIT 1" "$genfiles/go"
+ assert_contains "GIT 1" bazel-genfiles/external/g/go
bazel build @g//:g >& $TEST_log || fail "Build failed"
- assert_contains "GIT 2" "$genfiles/go"
+ assert_contains "GIT 2" bazel-genfiles/external/g/go
}
# Helper function for setting up the workspace as follows
@@ -355,7 +351,7 @@ function setup_error_test() {
mkdir -p planets
cat > planets/planet_info.sh <<EOF
#!/bin/bash
-cat ../pluto/info
+cat external/pluto/info
EOF
cat > planets/BUILD <<EOF