Skip to content

Commit

Permalink
Adding the test step into AZP (#825)
Browse files Browse the repository at this point in the history
Also enabling local bazel cache to carry state between the CI steps and printing out the full bazel command line for debugging.

Works on #820.

Signed-off-by: Jakub Sobon <[email protected]>
  • Loading branch information
mum4k authored Apr 8, 2022
1 parent dce4418 commit 5f72e3d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .azure-pipelines/bazel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ steps:
- script: ci/run_envoy_docker.sh 'ci/do_ci.sh ${{ parameters.ciTarget }}'
workingDirectory: $(Build.SourcesDirectory)
displayName: "Run the CI script"
env:
BAZEL_REMOTE_CACHE: $(LocalBuildCache)

- bash: |
echo "disk space at end of build:"
Expand Down
2 changes: 2 additions & 0 deletions .azure-pipelines/pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ stages:
matrix:
build:
CI_TARGET: "build"
test:
CI_TARGET: "test"
timeoutInMinutes: 120
pool: "x64-large"
steps:
Expand Down
7 changes: 6 additions & 1 deletion ci/do_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export BAZEL_BUILD_EXTRA_OPTIONS=${BAZEL_BUILD_EXTRA_OPTIONS:=""}
export SRCDIR=${SRCDIR:="${PWD}"}
export CLANG_FORMAT=clang-format
export NIGHTHAWK_BUILD_ARCH=$(uname -m)
export BAZEL_REMOTE_CACHE=${BAZEL_REMOTE_CACHE:=""}

# We build in steps to avoid running out of memory in CI.
# This list doesn't have to be complete, execution of bazel test will build any
Expand Down Expand Up @@ -219,6 +220,10 @@ if grep 'docker\|lxc' /proc/1/cgroup; then
export BAZEL="bazel"
fi

if [ -n "${BAZEL_REMOTE_CACHE}" ]; then
export BAZEL_BUILD_EXTRA_OPTIONS="${BAZEL_BUILD_EXTRA_OPTIONS} --remote_cache=${BAZEL_REMOTE_CACHE}"
fi

export BAZEL_EXTRA_TEST_OPTIONS="--test_env=ENVOY_IP_TEST_VERSIONS=v4only ${BAZEL_EXTRA_TEST_OPTIONS}"
export BAZEL_BUILD_OPTIONS=" \
--verbose_failures ${BAZEL_OPTIONS} --action_env=HOME --action_env=PYTHONUSERBASE \
Expand All @@ -236,9 +241,9 @@ if [ -n "$CIRCLECI" ]; then
BAZEL_BUILD_OPTIONS="${BAZEL_BUILD_OPTIONS} \
--discard_analysis_cache --notrack_incremental_state --nokeep_state_after_build"
fi
echo "Running with ${NUM_CPUS} cpus and BAZEL_BUILD_OPTIONS: ${BAZEL_BUILD_OPTIONS}"
BAZEL_BUILD_OPTIONS="${BAZEL_BUILD_OPTIONS} --jobs=${NUM_CPUS}"
fi
echo "Running with ${NUM_CPUS} cpus and BAZEL_BUILD_OPTIONS: ${BAZEL_BUILD_OPTIONS}"

export BAZEL_TEST_OPTIONS="${BAZEL_BUILD_OPTIONS} --test_env=HOME --test_env=PYTHONUSERBASE \
--test_env=UBSAN_OPTIONS=print_stacktrace=1 \
Expand Down

0 comments on commit 5f72e3d

Please sign in to comment.