From 0e7c19cdb3a64a851606e76df0c90160c6530a91 Mon Sep 17 00:00:00 2001 From: Fabian Meumertzheim Date: Wed, 9 Nov 2022 21:38:35 +0100 Subject: [PATCH] Test with --nobuild_runfile_links --- src/test/shell/bazel/bazel_rules_test.sh | 34 ++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/test/shell/bazel/bazel_rules_test.sh b/src/test/shell/bazel/bazel_rules_test.sh index 8c7c9d98e94f29..cc49a1fe4728dc 100755 --- a/src/test/shell/bazel/bazel_rules_test.sh +++ b/src/test/shell/bazel/bazel_rules_test.sh @@ -1001,4 +1001,38 @@ function test_bash_runfiles_current_repository_test_noenable_runfiles() { expect_log "in external/other_repo/pkg/library2.sh: 'other_repo'" } +function test_bash_runfiles_current_repository_binary_nobuild_runfile_links() { + setup_bash_runfiles_current_repository + + RUNFILES_LIB_DEBUG=1 bazel run --enable_bzlmod --nobuild_runfile_links //pkg:binary \ + &>"$TEST_log" || fail "Run should succeed" + expect_log "in pkg/binary.sh: ''" + expect_log "in pkg/library.sh: ''" + expect_log "in external/other_repo/pkg/library2.sh: 'other_repo'" + + RUNFILES_LIB_DEBUG=1 bazel run --enable_bzlmod --nobuild_runfile_links @other_repo//pkg:binary \ + &>"$TEST_log" || fail "Run should succeed" + expect_log "in external/other_repo/pkg/binary.sh: 'other_repo'" + expect_log "in pkg/library.sh: ''" + expect_log "in external/other_repo/pkg/library2.sh: 'other_repo'" +} + +function test_bash_runfiles_current_repository_test_nobuild_runfile_links() { + setup_bash_runfiles_current_repository + + bazel test --enable_bzlmod --noenable_runfiles --nobuild_runfile_links \ + --test_env=RUNFILES_LIB_DEBUG=1 --test_output=all //pkg:test \ + &>"$TEST_log" || fail "Test should succeed" + expect_log "in pkg/test.sh: ''" + expect_log "in pkg/library.sh: ''" + expect_log "in external/other_repo/pkg/library2.sh: 'other_repo'" + + bazel test --enable_bzlmod --noenable_runfiles --nobuild_runfile_links \ + --test_env=RUNFILES_LIB_DEBUG=1 --test_output=all @other_repo//pkg:test \ + &>"$TEST_log" || fail "Test should succeed" + expect_log "in external/other_repo/pkg/test.sh: 'other_repo'" + expect_log "in pkg/library.sh: ''" + expect_log "in external/other_repo/pkg/library2.sh: 'other_repo'" +} + run_suite "rules test"