Skip to content

Commit

Permalink
Windows CI: Upload test results to AZP (#14083)
Browse files Browse the repository at this point in the history
- Requires removing --output_base flag to Bazel startup options
- The TEST_TMPDIR and BUILD_DIR bind mounts from the host are where
  Bazel will place build output etc.
- Allowing Bazel to place build and test output there will give the host
  access to the data to upload

Signed-off-by: Sunjay Bhatia <sunjayb@vmware.com>
Co-authored-by: William A Rowe Jr <wrowe@vmware.com>
  • Loading branch information
sunjayBhatia and wrowe authored Nov 20, 2020
1 parent 6fe0a68 commit 6a2ea36
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .azure-pipelines/pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,12 @@ stages:
BAZEL_REMOTE_CACHE: grpcs://remotebuildexecution.googleapis.com
BAZEL_REMOTE_INSTANCE: projects/envoy-ci/instances/default_instance
GCP_SERVICE_ACCOUNT_KEY: $(GcpServiceAccountKey)
- task: PublishTestResults@2
inputs:
testResultsFiles: "**/bazel-out/**/testlogs/**/test.xml"
testRunTitle: "windows"
searchFolder: $(Build.StagingDirectory)/tmp
condition: always()
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: "$(Build.StagingDirectory)/envoy"
Expand Down
9 changes: 7 additions & 2 deletions bazel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,19 @@ for how to update or override dependencies.
Install bazelisk in the PATH using the `bazel.exe` executable name as described above in the first section.

When building Envoy, Bazel creates very long path names. One way to work around these excessive path
lengths is to change the output base directory for bazel to a very short root path. The CI pipeline
for Windows uses `C:\_eb` as the bazel base path. This and other preferences should be set up by placing
lengths is to change the output base directory for bazel to a very short root path. An example Bazel configuration
to help with this is to use `C:\_eb` as the bazel base path. This and other preferences should be set up by placing
the following bazelrc configuration line in a system `%ProgramData%\bazel.bazelrc` file or the individual
user's `%USERPROFILE%\.bazelrc` file (rather than including it on every bazel command line):

```
startup --output_base=C:/_eb
```

Another option to shorten the the output root for Bazel is to set the `USERNAME` environment variable in your shell
session to a short value. Bazel uses this value when constructing its output root path if no explicit `--output_base`
is set.

Bazel also creates file symlinks when building Envoy. It's strongly recommended to enable file symlink support
using [Bazel's instructions](https://docs.bazel.build/versions/master/windows.html#enable-symlink-support).
For other common issues, see the
Expand Down
2 changes: 1 addition & 1 deletion ci/windows_ci_steps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export TEST_TMPDIR=${BUILD_DIR}/tmp

[[ "${BUILD_REASON}" != "PullRequest" ]] && BAZEL_EXTRA_TEST_OPTIONS+=(--nocache_test_results)

BAZEL_STARTUP_OPTIONS+=("--output_base=c:/_eb")
BAZEL_STARTUP_OPTIONS+=("--output_base=${TEST_TMPDIR/\/c/c:}")
BAZEL_BUILD_OPTIONS=(
-c opt
--show_task_finish
Expand Down

0 comments on commit 6a2ea36

Please sign in to comment.