Skip to content

Commit

Permalink
Windows, test-setup.sh: Setting RUNFILES_MANIFEST_FILE only when it e…
Browse files Browse the repository at this point in the history
…xists.

Make remote execution work on Windows again.

RELNOTES: None
PiperOrigin-RevId: 216724305
  • Loading branch information
meteorcloudy authored and Copybara-Service committed Oct 11, 2018
1 parent d729f91 commit 83d406b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 7 additions & 1 deletion src/test/py/bazel/windows_remote_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,20 @@ def testShTestRunsRemotely(self):
')',
])
self.ScratchFile(
'foo/foo_test.sh', ['#!/bin/sh', 'echo hello test'], executable=True)
'foo/foo_test.sh', [
'#!/bin/sh',
'echo hello test',
'echo "RUNFILES_MANIFEST_FILE: \\"${RUNFILES_MANIFEST_FILE:-}\\""'
],
executable=True)
self.ScratchFile('bar/BUILD', ['exports_files(["bar.txt"])'])
self.ScratchFile('bar/bar.txt', ['hello'])

# Test.
exit_code, stdout, stderr = self._RunRemoteBazel(
['test', '--test_output=all', '//foo:foo_test'])
self.AssertExitCode(exit_code, 0, stderr, stdout)
self.assertIn('RUNFILES_MANIFEST_FILE: ""', stdout)

# The Java launcher uses Rlocation which has differing behavior for local and
# remote.
Expand Down
6 changes: 3 additions & 3 deletions tools/test/test-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ function rlocation() {

export -f rlocation
export -f is_absolute
# If RUNFILES_MANIFEST_ONLY is set to 1, then test programs should use manifest file to find
# runfiles.
if [[ "${RUNFILES_MANIFEST_ONLY:-}" == "1" ]]; then
# If RUNFILES_MANIFEST_ONLY is set to 1 and the manifest file does exist,
# then test programs should use manifest file to find runfiles.
if [[ "${RUNFILES_MANIFEST_ONLY:-}" == "1" && -e "${RUNFILES_MANIFEST_FILE:-}" ]]; then
export RUNFILES_MANIFEST_FILE
export RUNFILES_MANIFEST_ONLY
fi
Expand Down

0 comments on commit 83d406b

Please sign in to comment.