diff --git a/.azure-pipelines/pipelines.yml b/.azure-pipelines/pipelines.yml index b47cdb763..4964de281 100644 --- a/.azure-pipelines/pipelines.yml +++ b/.azure-pipelines/pipelines.yml @@ -6,19 +6,111 @@ trigger: stages: - stage: check dependsOn: [] + pool: "x64-large" jobs: - - job: bazel + - job: build_and_format displayName: "do_ci.sh" dependsOn: [] strategy: - maxParallel: 1 + maxParallel: 2 matrix: build: CI_TARGET: "build" + format: + CI_TARGET: "check_format" + timeoutInMinutes: 120 + steps: + - template: bazel.yml + parameters: + ciTarget: $(CI_TARGET) + +- stage: test + dependsOn: ["check"] + pool: "x64-large" + jobs: + - job: test_and_benchmark + displayName: "do_ci.sh" + strategy: + # Both test and benchmark need dedicated resources for stability. + maxParallel: 1 + matrix: test: CI_TARGET: "test" + benchmark: + CI_TARGET: "benchmark_with_own_binaries" + timeoutInMinutes: 120 + steps: + - template: bazel.yml + parameters: + ciTarget: $(CI_TARGET) + +- stage: clang_tidy + dependsOn: ["check"] + pool: "x64-large" + jobs: + - job: clang_tidy + displayName: "do_ci.sh" + strategy: + maxParallel: 1 + matrix: + clang_tidy: + CI_TARGET: "clang_tidy" + timeoutInMinutes: 120 + steps: + - template: bazel.yml + parameters: + ciTarget: $(CI_TARGET) + +- stage: test_gcc + dependsOn: ["check"] + pool: "x64-large" + jobs: + - job: test_gcc + displayName: "do_ci.sh" + strategy: + maxParallel: 1 + matrix: + test_gcc: + CI_TARGET: "test_gcc" + timeoutInMinutes: 120 + steps: + - template: bazel.yml + parameters: + ciTarget: $(CI_TARGET) + +- stage: sanitizers + dependsOn: ["test"] + pool: "x64-large" + jobs: + - job: sanitizers + displayName: "do_ci.sh" + strategy: + maxParallel: 2 + matrix: + asan: + CI_TARGET: "asan" + tsan: + CI_TARGET: "tsan" + timeoutInMinutes: 120 + steps: + - template: bazel.yml + parameters: + ciTarget: $(CI_TARGET) + +- stage: coverage + dependsOn: ["test"] + pool: "x64-large" + jobs: + - job: coverage + displayName: "do_ci.sh" + strategy: + maxParallel: 2 + matrix: + coverage: + CI_TARGET: "coverage" + coverage_integration: + CI_TARGET: "coverage_integration" timeoutInMinutes: 120 - pool: "x64-large" steps: - template: bazel.yml parameters: diff --git a/ci/do_ci.sh b/ci/do_ci.sh index 61682985b..586bd6f53 100755 --- a/ci/do_ci.sh +++ b/ci/do_ci.sh @@ -75,7 +75,11 @@ function do_test() { function do_clang_tidy() { # clang-tidy will warn on standard library issues with libc++ BAZEL_BUILD_OPTIONS=("--config=clang" "${BAZEL_BUILD_OPTIONS[@]}") - BAZEL_BUILD_OPTIONS="${BAZEL_BUILD_OPTIONS[*]}" NUM_CPUS=4 ci/run_clang_tidy.sh + if [ -n "$CIRCLECI" ]; then + BAZEL_BUILD_OPTIONS="${BAZEL_BUILD_OPTIONS[*]}" NUM_CPUS=4 ci/run_clang_tidy.sh + else + BAZEL_BUILD_OPTIONS="${BAZEL_BUILD_OPTIONS[*]}" ci/run_clang_tidy.sh + fi } function do_unit_test_coverage() { @@ -89,8 +93,8 @@ function do_unit_test_coverage() { function do_integration_test_coverage() { export TEST_TARGETS="//test:python_test" - #TODO(#564): Revert this to 78.6 - export COVERAGE_THRESHOLD=75.0 + # TODO(#830): Raise the integration test coverage. + export COVERAGE_THRESHOLD=74.2 echo "bazel coverage build with tests ${TEST_TARGETS}" test/run_nighthawk_bazel_coverage.sh ${TEST_TARGETS} exit 0 diff --git a/ci/run_clang_tidy.sh b/ci/run_clang_tidy.sh index 6412bedc1..b0ddfad08 100755 --- a/ci/run_clang_tidy.sh +++ b/ci/run_clang_tidy.sh @@ -91,6 +91,7 @@ function filter_excludes() { } function run_clang_tidy() { + echo "Running clang_tidy with NUM_CPUS: ${NUM_CPUS:-0}." python3 "${LLVM_PREFIX}/share/clang/run-clang-tidy.py" \ -clang-tidy-binary="${CLANG_TIDY}" \ -clang-apply-replacements-binary="${CLANG_APPLY_REPLACEMENTS}" \ diff --git a/test/BUILD b/test/BUILD index ce89f82e6..e761ce6e8 100644 --- a/test/BUILD +++ b/test/BUILD @@ -286,6 +286,7 @@ envoy_cc_test( # libraries as dependencies. envoy_cc_test( name = "python_test", + size = "enormous", srcs = ["python_test.cc"], data = ["//test/integration:integration_test"], repository = "@envoy",