diff --git a/.azure-pipelines/stage/checks.yml b/.azure-pipelines/stage/checks.yml index 791c042f90f8..f730bc0df7c6 100644 --- a/.azure-pipelines/stage/checks.yml +++ b/.azure-pipelines/stage/checks.yml @@ -42,6 +42,10 @@ jobs: maxParallel: ${{ parameters.concurrencyChecks }} matrix: # These are ordered by most time-consuming first. + coverage: + CI_TARGET: "bazel.coverage" + fuzz_coverage: + CI_TARGET: "bazel.fuzz_coverage" compile_time_options: CI_TARGET: "bazel.compile_time_options" ENVOY_FILTER_EXAMPLE: true @@ -80,7 +84,6 @@ jobs: publishTestResults: variables.PUBLISH_TEST_RESULTS publishEnvoy: variables.PUBLISH_ENVOY stepsPost: - # TODO(phlax): consolidate "fix" paths/jobs - task: PublishBuildArtifacts@1 inputs: @@ -88,54 +91,23 @@ jobs: artifactName: "$(CI_TARGET).fixes" timeoutInMinutes: 10 condition: and(failed(), eq(variables['CI_TARGET'], 'bazel.clang_tidy')) - -- job: coverage - displayName: "Linux x64" - dependsOn: [] - condition: | - and(not(canceled()), - eq(${{ parameters.runChecks }}, 'true')) - timeoutInMinutes: 240 - pool: "envoy-x64-large" - variables: - BAZEL_STARTUP_EXTRA: '' - strategy: - maxParallel: 2 - matrix: - coverage: - CI_TARGET: "coverage" - BAZEL_STARTUP_EXTRA: --host_jvm_args=-Xmx20g --host_jvm_args=-XX:MaxDirectMemorySize=4G - fuzz_coverage: - CI_TARGET: "fuzz_coverage" - steps: - - template: ../bazel.yml - parameters: - managedAgent: false - ciTarget: bazel.$(CI_TARGET) - rbe: true - # /tmp/sandbox_base is a tmpfs in CI environment to optimize large I/O for coverage traces - bazelConfigRBE: --config=ci --config=rbe-google --jobs=$(RbeJobs) - bazelBuildExtraOptions: --sandbox_base=/tmp/sandbox_base --define=no_debug_info=1 --linkopt=-Wl,-s --test_env=ENVOY_IP_TEST_VERSIONS=v4only - bazelStartupExtraOptions: $(BAZEL_STARTUP_EXTRA) - bazelUseBES: false - cacheTestResults: ${{ parameters.cacheTestResults }} - - script: ci/run_envoy_docker.sh 'ci/do_ci.sh $(CI_TARGET)-upload' - displayName: "Upload $(CI_TARGET) Report to GCS" - env: - ENVOY_DOCKER_BUILD_DIR: $(Build.StagingDirectory) - GCP_SERVICE_ACCOUNT_KEY: ${{ parameters.authGCP }} - GCS_ARTIFACT_BUCKET: ${{ parameters.bucketGCP }} - BAZEL_BUILD_EXTRA_OPTIONS: "--config=ci" - BAZEL_REMOTE_CACHE: $(LocalBuildCache) - ${{ if eq(variables['Build.Reason'], 'PullRequest') }}: - BAZEL_REMOTE_INSTANCE_BRANCH: "$(System.PullRequest.TargetBranch)" - ${{ if ne(variables['Build.Reason'], 'PullRequest') }}: - BAZEL_REMOTE_INSTANCE_BRANCH: "$(Build.SourceBranchName)" - condition: not(canceled()) + - script: ci/run_envoy_docker.sh 'ci/do_ci.sh $(CI_TARGET)-upload' + displayName: "Upload $(CI_TARGET) Report to GCS" + condition: and(not(canceled()), or(eq(variables['CI_TARGET'], 'bazel.coverage'), eq(variables['CI_TARGET'], 'bazel.fuzz_coverage'))) + env: + ENVOY_DOCKER_BUILD_DIR: $(Build.StagingDirectory) + ENVOY_RBE: "1" + BAZEL_BUILD_EXTRA_OPTIONS: "--config=ci --config=rbe-google --jobs=$(RbeJobs)" + GCP_SERVICE_ACCOUNT_KEY: ${{ parameters.authGCP }} + GCS_ARTIFACT_BUCKET: ${{ parameters.bucketGCP }} + ${{ if eq(variables['Build.Reason'], 'PullRequest') }}: + BAZEL_REMOTE_INSTANCE_BRANCH: "$(System.PullRequest.TargetBranch)" + ${{ if ne(variables['Build.Reason'], 'PullRequest') }}: + BAZEL_REMOTE_INSTANCE_BRANCH: "$(Build.SourceBranchName)" - job: complete displayName: "Checks complete" - dependsOn: ["bazel", "coverage"] + dependsOn: ["bazel"] pool: x64-nano # This condition ensures that this (required) check passes if all of # the preceding checks either pass or are skipped @@ -144,8 +116,7 @@ jobs: condition: | and( eq(variables['Build.Reason'], 'PullRequest'), - in(dependencies.bazel.result, 'Succeeded', 'SucceededWithIssues', 'Skipped'), - in(dependencies.coverage.result, 'Succeeded', 'SucceededWithIssues', 'Skipped')) + in(dependencies.bazel.result, 'Succeeded', 'SucceededWithIssues', 'Skipped')) steps: - checkout: none - bash: | diff --git a/.azure-pipelines/stages.yml b/.azure-pipelines/stages.yml index f5ae006eb682..108bf18952ee 100644 --- a/.azure-pipelines/stages.yml +++ b/.azure-pipelines/stages.yml @@ -29,7 +29,7 @@ parameters: - name: concurrencyChecks displayName: "Check concurrency" type: number - default: 3 + default: 5 - name: concurrencyPrechecks displayName: "Prechecks concurrency" type: number diff --git a/.bazelrc b/.bazelrc index 847ec1c41b28..1ec5e4b73ad1 100644 --- a/.bazelrc +++ b/.bazelrc @@ -197,14 +197,19 @@ build:coverage --define=ENVOY_CONFIG_COVERAGE=1 build:coverage --cxxopt="-DENVOY_CONFIG_COVERAGE=1" build:coverage --test_env=HEAPCHECK= build:coverage --combined_report=lcov -build:coverage --strategy=TestRunner=sandboxed,local +build:coverage --strategy=TestRunner=remote,sandboxed,local build:coverage --strategy=CoverageReport=sandboxed,local build:coverage --experimental_use_llvm_covmap build:coverage --experimental_generate_llvm_lcov +build:coverage --experimental_split_coverage_postprocessing +build:coverage --experimental_fetch_all_coverage_outputs build:coverage --collect_code_coverage build:coverage --instrumentation_filter="^//source(?!/common/quic/platform)[/:],^//envoy[/:],^//contrib(?!/.*/test)[/:]" -build:coverage --remote_download_toplevel +build:coverage --remote_download_minimal build:coverage --define=tcmalloc=gperftools +build:coverage --define=no_debug_info=1 +build:coverage --linkopt=-Wl,-s +build:coverage --test_env=ENVOY_IP_TEST_VERSIONS=v4only build:test-coverage --test_arg="-l trace" build:test-coverage --test_arg="--log-path /dev/null"