forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mac_ci_steps.sh
executable file
·51 lines (40 loc) · 1.47 KB
/
mac_ci_steps.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
set -e
function finish {
echo "disk space at end of build:"
df -h
}
trap finish EXIT
echo "disk space at beginning of build:"
df -h
# shellcheck source=ci/setup_cache.sh
. "$(dirname "$0")"/setup_cache.sh
read -ra BAZEL_BUILD_EXTRA_OPTIONS <<< "${BAZEL_BUILD_EXTRA_OPTIONS:-}"
read -ra BAZEL_EXTRA_TEST_OPTIONS <<< "${BAZEL_EXTRA_TEST_OPTIONS:-}"
BUILD_CONFIG="$(dirname "$(realpath "$0")")"/osx-build-config
# TODO(zuercher): remove --flaky_test_attempts when https://github.com/envoyproxy/envoy/issues/2428
# is resolved.
BAZEL_BUILD_OPTIONS=(
"--curses=no"
--show_task_finish
--verbose_failures
"--action_env=PATH=/usr/local/bin:/opt/local/bin:/usr/bin:/bin"
"--test_output=all"
"--flaky_test_attempts=integration@2"
"--override_repository=envoy_build_config=${BUILD_CONFIG}"
"${BAZEL_BUILD_EXTRA_OPTIONS[@]}"
"${BAZEL_EXTRA_TEST_OPTIONS[@]}")
# Build envoy and run tests as separate steps so that failure output
# is somewhat more deterministic (rather than interleaving the build
# and test steps).
if [[ $# -gt 0 ]]; then
TEST_TARGETS=$*
else
TEST_TARGETS='//test/integration/...'
fi
if [[ "$TEST_TARGETS" == "//test/..." || "$TEST_TARGETS" == "//test/integration/..." ]]; then
bazel build "${BAZEL_BUILD_OPTIONS[@]}" //source/exe:envoy-static
fi
bazel test "${BAZEL_BUILD_OPTIONS[@]}" "${TEST_TARGETS}"
# Additionally run macOS specific test suites
bazel test "${BAZEL_BUILD_OPTIONS[@]}" //test/common/network:apple_dns_impl_test