Skip to content

Add test2json and UTOF output to bazel-driven go tests - #54655

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 12 commits into
mainfrom
alopez/bazel-go-test-tweaks
Aug 14, 2026
Merged

Add test2json and UTOF output to bazel-driven go tests#54655
gh-worker-dd-mergequeue-cf854d[bot] merged 12 commits into
mainfrom
alopez/bazel-go-test-tweaks

Conversation

@alopezz

@alopezz alopezz commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Generates test2json output and UTOF output for Bazel-run tests.

Motivation

We want to switch over to using Bazel for running our unit tests, this helps us produce output that is closer to the existing jobs to reduce friction during the switch.

Describe how you validated your changes

Additional Notes

This generates a bit of noise on the UTOF output because it treats the multiple runs of the same tests (with different tag sets) as retries, which get printed out. This will be dealt with separately.

@alopezz alopezz added changelog/no-changelog No changelog entry needed qa/no-code-change No code change in Agent code requiring validation labels Aug 10, 2026
@dd-octo-sts dd-octo-sts Bot added the internal Identify a non-fork PR label Aug 10, 2026
@github-actions github-actions Bot added the medium review PR review might take time label Aug 10, 2026
chatgpt-codex-connector[bot]

This comment was marked as outdated.

@dd-octo-sts

dd-octo-sts Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Gitlab CI Configuration Changes

Modified Jobs

.bazel:test:reporting
  .bazel:test:reporting:
    after_script:
-   - dda inv -- -e bazel.collect-junit --flavor=$FLAVOR --output-tgz=junit-${CI_JOB_NAME}.tgz
-     --bep-file=$BEP_FILE || true
+   - dda inv -- -e bazel.process-test-results --bep-file=$BEP_FILE --junit-tar=junit-${CI_JOB_NAME}.tgz
+     --result-json=$RESULT_JSON
    - $CI_PROJECT_DIR/tools/ci/junit_upload.sh
    artifacts:
      expire_in: 2 weeks
      paths:
+     - $RESULT_JSON
+     - test_output_unified.json
      - junit-*.tgz
-     - bazel-bep-*.json
?                --
+     - bazel-bep.json
      reports:
        annotations:
        - $EXTERNAL_LINKS_PATH
      when: always
    id_tokens:
      CI_IDENTITIES_GITLAB_ID_TOKEN:
        aud: ci-identities
    variables:
-     BEP_FILE: $CI_PROJECT_DIR/bazel-bep-$FLAVOR.json
?                                        --------
+     BEP_FILE: $CI_PROJECT_DIR/bazel-bep.json
      EXTERNAL_LINKS_PATH: external_links_$CI_JOB_ID.json
-     FLAVOR: base
+     RESULT_JSON: test_output.json
bazel:coverage:linux-amd64
  bazel:coverage:linux-amd64:
    after_script:
-   - dda inv -- -e bazel.collect-junit --flavor=$FLAVOR --output-tgz=junit-${CI_JOB_NAME}.tgz
-     --bep-file=$BEP_FILE || true
+   - dda inv -- -e bazel.process-test-results --bep-file=$BEP_FILE --junit-tar=junit-${CI_JOB_NAME}.tgz
+     --result-json=$RESULT_JSON
    - $CI_PROJECT_DIR/tools/ci/junit_upload.sh
    - cp "$(bazel info output_path)/_coverage/_coverage_report.dat" "$CI_PROJECT_DIR/coverage-bazel-$CI_JOB_NAME_SLUG.out"
    artifacts:
      expire_in: 2 weeks
      paths:
+     - $RESULT_JSON
+     - test_output_unified.json
      - junit-*.tgz
-     - bazel-bep-*.json
?                --
+     - bazel-bep.json
      - coverage-bazel-*.out
      reports:
        annotations:
        - $EXTERNAL_LINKS_PATH
      when: always
    cache:
    - key:
        files:
        - .bazelversion
        prefix: bazelversion-$CI_RUNNER_DESCRIPTION
      paths:
      - .cache/bazelisk
      - .cache/bazel/*/install
      policy: pull$BAZEL_CACHE_POLICY_SUFFIX
      when: on_success
    - key:
        files:
        - MODULE.bazel.lock
        prefix: bazel-$CI_JOB_NAME
      paths:
      - .cache/bazel/*/cache
      - .cache/go
      - .cache/ms-go
      - .cache/pip
      policy: pull$BAZEL_CACHE_POLICY_SUFFIX
      when: on_success
    id_tokens:
      BUILDBARN_ID_TOKEN:
        aud: buildbarn.us1.ddbuild.io
      CI_IDENTITIES_GITLAB_ID_TOKEN:
        aud: ci-identities
    image: registry.ddbuild.io/ci/datadog-agent-buildimages/linux$CI_IMAGE_LINUX_SUFFIX:$CI_IMAGE_LINUX
    needs:
    - artifacts: false
      job: bazel:run-go-mod-tidy
    - artifacts: false
      job: bazel:run-gazelle
    rules:
    - when: on_success
    script:
    - dda inv -- -e gitlab.generate-ci-visibility-links --output=$EXTERNAL_LINKS_PATH
    - bazel coverage --config=go --config=gorace --config=dd-agent-go-tests-only --jobs=$KUBERNETES_CPU_REQUEST
      --build_tests_only --keep_going --remote_download_outputs=toplevel --build_event_json_file=$BEP_FILE
      //... -- -//test/new-e2e/...
    stage: source_test
    tags:
    - arch:amd64
    - specific:true
    variables:
      BAZELISK_HOME: $XDG_CACHE_HOME/bazelisk
-     BEP_FILE: $CI_PROJECT_DIR/bazel-bep-$FLAVOR.json
?                                        --------
+     BEP_FILE: $CI_PROJECT_DIR/bazel-bep.json
      EXTERNAL_LINKS_PATH: external_links_$CI_JOB_ID.json
-     FLAVOR: base
      KUBERNETES_CPU_REQUEST: 16
      KUBERNETES_MEMORY_LIMIT: 32Gi
      KUBERNETES_MEMORY_REQUEST: 32Gi
+     RESULT_JSON: test_output.json
      XDG_CACHE_HOME: $CI_PROJECT_DIR/.cache
bazel:test:linux-amd64
  bazel:test:linux-amd64:
    after_script:
-   - dda inv -- -e bazel.collect-junit --flavor=$FLAVOR --output-tgz=junit-${CI_JOB_NAME}.tgz
-     --bep-file=$BEP_FILE || true
+   - dda inv -- -e bazel.process-test-results --bep-file=$BEP_FILE --junit-tar=junit-${CI_JOB_NAME}.tgz
+     --result-json=$RESULT_JSON
    - $CI_PROJECT_DIR/tools/ci/junit_upload.sh
    artifacts:
      expire_in: 2 weeks
      paths:
+     - $RESULT_JSON
+     - test_output_unified.json
      - junit-*.tgz
-     - bazel-bep-*.json
?                --
+     - bazel-bep.json
      reports:
        annotations:
        - $EXTERNAL_LINKS_PATH
      when: always
    cache:
    - key:
        files:
        - .bazelversion
        prefix: bazelversion-$CI_RUNNER_DESCRIPTION
      paths:
      - .cache/bazelisk
      - .cache/bazel/*/install
      policy: pull$BAZEL_CACHE_POLICY_SUFFIX
      when: on_success
    - key:
        files:
        - MODULE.bazel.lock
        prefix: bazel-$CI_JOB_NAME
      paths:
      - .cache/bazel/*/cache
      - .cache/go
      - .cache/ms-go
      - .cache/pip
      policy: pull$BAZEL_CACHE_POLICY_SUFFIX
      when: on_success
    id_tokens:
      BUILDBARN_ID_TOKEN:
        aud: buildbarn.us1.ddbuild.io
      CI_IDENTITIES_GITLAB_ID_TOKEN:
        aud: ci-identities
    image: registry.ddbuild.io/ci/datadog-agent-buildimages/linux$CI_IMAGE_LINUX_SUFFIX:$CI_IMAGE_LINUX
    needs:
    - artifacts: false
      job: bazel:run-go-mod-tidy
    - artifacts: false
      job: bazel:run-gazelle
    rules:
    - when: on_success
    script:
    - dda inv -- -e gitlab.generate-ci-visibility-links --output=$EXTERNAL_LINKS_PATH
    - bazel test --config=gorace --jobs=$KUBERNETES_CPU_REQUEST --keep_going --remote_download_outputs=toplevel
      --build_event_json_file=$BEP_FILE //... -- -//test/new-e2e/...
    stage: source_test
    tags:
    - arch:amd64
    - specific:true
    variables:
      BAZELISK_HOME: $XDG_CACHE_HOME/bazelisk
-     BEP_FILE: $CI_PROJECT_DIR/bazel-bep-$FLAVOR.json
?                                        --------
+     BEP_FILE: $CI_PROJECT_DIR/bazel-bep.json
      EXTERNAL_LINKS_PATH: external_links_$CI_JOB_ID.json
-     FLAVOR: base
      KUBERNETES_CPU_REQUEST: 8
      KUBERNETES_MEMORY_LIMIT: 32Gi
      KUBERNETES_MEMORY_REQUEST: 32Gi
+     RESULT_JSON: test_output.json
      XDG_CACHE_HOME: $CI_PROJECT_DIR/.cache
bazel:test:linux-arm64
  bazel:test:linux-arm64:
    after_script:
-   - dda inv -- -e bazel.collect-junit --flavor=$FLAVOR --output-tgz=junit-${CI_JOB_NAME}.tgz
-     --bep-file=$BEP_FILE || true
+   - dda inv -- -e bazel.process-test-results --bep-file=$BEP_FILE --junit-tar=junit-${CI_JOB_NAME}.tgz
+     --result-json=$RESULT_JSON
    - $CI_PROJECT_DIR/tools/ci/junit_upload.sh
    artifacts:
      expire_in: 2 weeks
      paths:
+     - $RESULT_JSON
+     - test_output_unified.json
      - junit-*.tgz
-     - bazel-bep-*.json
?                --
+     - bazel-bep.json
      reports:
        annotations:
        - $EXTERNAL_LINKS_PATH
      when: always
    cache:
    - key:
        files:
        - .bazelversion
        prefix: bazelversion-$CI_RUNNER_DESCRIPTION
      paths:
      - .cache/bazelisk
      - .cache/bazel/*/install
      policy: pull$BAZEL_CACHE_POLICY_SUFFIX
      when: on_success
    - key:
        files:
        - MODULE.bazel.lock
        prefix: bazel-$CI_JOB_NAME
      paths:
      - .cache/bazel/*/cache
      - .cache/go
      - .cache/ms-go
      - .cache/pip
      policy: pull$BAZEL_CACHE_POLICY_SUFFIX
      when: on_success
    id_tokens:
      BUILDBARN_ID_TOKEN:
        aud: buildbarn.us1.ddbuild.io
      CI_IDENTITIES_GITLAB_ID_TOKEN:
        aud: ci-identities
    image: registry.ddbuild.io/ci/datadog-agent-buildimages/linux$CI_IMAGE_LINUX_SUFFIX:$CI_IMAGE_LINUX
    needs:
    - artifacts: false
      job: bazel:run-go-mod-tidy
    - artifacts: false
      job: bazel:run-gazelle
    rules:
    - when: on_success
    script:
    - dda inv -- -e gitlab.generate-ci-visibility-links --output=$EXTERNAL_LINKS_PATH
    - bazel test --config=gorace --jobs=$KUBERNETES_CPU_REQUEST --keep_going --remote_download_outputs=toplevel
      --build_event_json_file=$BEP_FILE //... -- -//test/new-e2e/...
    stage: source_test
    tags:
    - arch:arm64
    - specific:true
    variables:
      BAZELISK_HOME: $XDG_CACHE_HOME/bazelisk
-     BEP_FILE: $CI_PROJECT_DIR/bazel-bep-$FLAVOR.json
?                                        --------
+     BEP_FILE: $CI_PROJECT_DIR/bazel-bep.json
      EXTERNAL_LINKS_PATH: external_links_$CI_JOB_ID.json
-     FLAVOR: base
      KUBERNETES_CPU_REQUEST: 8
      KUBERNETES_MEMORY_LIMIT: 32Gi
      KUBERNETES_MEMORY_REQUEST: 32Gi
+     RESULT_JSON: test_output.json
      XDG_CACHE_HOME: $CI_PROJECT_DIR/.cache
bazel:test:macos-amd64
  bazel:test:macos-amd64:
    after_script:
    - "if [ -z \"$TMPDIR\" ]; then\n  echo \"TMPDIR must be set\" >& 2\n  exit 1\nfi\n"
    - export DDA_DIR="$TMPDIR/dda-${CI_JOB_ID}"
    - export PATH="$DDA_DIR:$PATH"
    - export DDA_NO_DYNAMIC_DEPS=1
    - "# Perform installation only if the directory does not exist\nif [ ! -d \"$DDA_DIR\"\
      \ ]; then\n  robust_curl=\"curl -fsSL --retry 4\"  # recommended flags + resist\
      \ transient errors like `Connection reset by peer`\n  # Get the commit from the\
      \ build image variable in the format `vPIPELINE_ID-COMMIT`\n  export BUILDIMAGES_COMMIT=\"\
      ${CI_IMAGE_LINUX#*-}\"\n  export DDA_VERSION=\"$($robust_curl https://raw.githubusercontent.com/DataDog/datadog-agent-buildimages/${BUILDIMAGES_COMMIT}/dda.env\
      \ | awk -F= '/^DDA_VERSION=/ {print $2}')\"\n  # Detect architecture and download\
      \ appropriate binary\n  if [ \"$(uname -m)\" = \"arm64\" ]; then\n    dda_target_triple=\"\
      aarch64-apple-darwin\"\n  else\n    dda_target_triple=\"x86_64-apple-darwin\"\n\
      \  fi\n  $robust_curl -o dda.tar.gz https://github.com/DataDog/datadog-agent-dev/releases/download/${DDA_VERSION}/dda-${dda_target_triple}.tar.gz\n\
      \  tar -xzf dda.tar.gz\n  mkdir -p \"$DDA_DIR\"\n  sudo mv dda $DDA_DIR\n  rm\
      \ -f dda.tar.gz\n  # Explicitly bootstrap dda's managed environment. The stable\
      \ mirror\n  # (UV_DEFAULT_INDEX) lags new dda releases by a publish waiting period,\
      \ so\n  # let this install also resolve dda from the testing index already present\n\
      \  # in UV_INDEX. Scoped to the bootstrap only.\n  UV_INDEX_STRATEGY=unsafe-best-match\
      \ dda self restore\n  dda self dep sync -f legacy-tasks\n  dda self pip install\
      \ awscli==1.29.45\nfi\n"
-   - dda inv -- -e bazel.collect-junit --flavor=$FLAVOR --output-tgz=junit-${CI_JOB_NAME}.tgz
-     --bep-file=$BEP_FILE || true
+   - dda inv -- -e bazel.process-test-results --bep-file=$BEP_FILE --junit-tar=junit-${CI_JOB_NAME}.tgz
+     --result-json=$RESULT_JSON
    - $CI_PROJECT_DIR/tools/ci/junit_upload.sh
    artifacts:
      expire_in: 2 weeks
      paths:
+     - $RESULT_JSON
+     - test_output_unified.json
      - junit-*.tgz
-     - bazel-bep-*.json
?                --
+     - bazel-bep.json
      reports:
        annotations:
        - $EXTERNAL_LINKS_PATH
      when: always
    before_script:
    - . tools/ci/sanitize-goproxy.sh
    id_tokens:
      BUILDBARN_ID_TOKEN:
        aud: buildbarn.us1.ddbuild.io
      CI_IDENTITIES_GITLAB_ID_TOKEN:
        aud: ci-identities
    needs:
    - artifacts: false
      job: bazel:run-go-mod-tidy
    - artifacts: false
      job: bazel:run-gazelle
    rules:
    - when: on_success
    script:
    - "if [ -z \"$TMPDIR\" ]; then\n  echo \"TMPDIR must be set\" >& 2\n  exit 1\nfi\n"
    - export DDA_DIR="$TMPDIR/dda-${CI_JOB_ID}"
    - export PATH="$DDA_DIR:$PATH"
    - export DDA_NO_DYNAMIC_DEPS=1
    - "# Perform installation only if the directory does not exist\nif [ ! -d \"$DDA_DIR\"\
      \ ]; then\n  robust_curl=\"curl -fsSL --retry 4\"  # recommended flags + resist\
      \ transient errors like `Connection reset by peer`\n  # Get the commit from the\
      \ build image variable in the format `vPIPELINE_ID-COMMIT`\n  export BUILDIMAGES_COMMIT=\"\
      ${CI_IMAGE_LINUX#*-}\"\n  export DDA_VERSION=\"$($robust_curl https://raw.githubusercontent.com/DataDog/datadog-agent-buildimages/${BUILDIMAGES_COMMIT}/dda.env\
      \ | awk -F= '/^DDA_VERSION=/ {print $2}')\"\n  # Detect architecture and download\
      \ appropriate binary\n  if [ \"$(uname -m)\" = \"arm64\" ]; then\n    dda_target_triple=\"\
      aarch64-apple-darwin\"\n  else\n    dda_target_triple=\"x86_64-apple-darwin\"\n\
      \  fi\n  $robust_curl -o dda.tar.gz https://github.com/DataDog/datadog-agent-dev/releases/download/${DDA_VERSION}/dda-${dda_target_triple}.tar.gz\n\
      \  tar -xzf dda.tar.gz\n  mkdir -p \"$DDA_DIR\"\n  sudo mv dda $DDA_DIR\n  rm\
      \ -f dda.tar.gz\n  # Explicitly bootstrap dda's managed environment. The stable\
      \ mirror\n  # (UV_DEFAULT_INDEX) lags new dda releases by a publish waiting period,\
      \ so\n  # let this install also resolve dda from the testing index already present\n\
      \  # in UV_INDEX. Scoped to the bootstrap only.\n  UV_INDEX_STRATEGY=unsafe-best-match\
      \ dda self restore\n  dda self dep sync -f legacy-tasks\n  dda self pip install\
      \ awscli==1.29.45\nfi\n"
    - dda inv -- -e gitlab.generate-ci-visibility-links --output=$EXTERNAL_LINKS_PATH
    - bazel test --config=gorace --keep_going --remote_download_outputs=toplevel --build_event_json_file=$BEP_FILE
      //... -- -//test/new-e2e/...
    stage: source_test
    tags:
    - macos:sonoma-amd64
    - specific:true
    variables:
      BAZELISK_HOME: $XDG_CACHE_HOME/bazelisk
-     BEP_FILE: $CI_PROJECT_DIR/bazel-bep-$FLAVOR.json
?                                        --------
+     BEP_FILE: $CI_PROJECT_DIR/bazel-bep.json
      EXTERNAL_LINKS_PATH: external_links_$CI_JOB_ID.json
-     FLAVOR: base
+     RESULT_JSON: test_output.json
      XDG_CACHE_HOME: $RUNNER_TEMP_PROJECT_DIR
bazel:test:macos-arm64
  bazel:test:macos-arm64:
    after_script:
    - "if [ -z \"$TMPDIR\" ]; then\n  echo \"TMPDIR must be set\" >& 2\n  exit 1\nfi\n"
    - export DDA_DIR="$TMPDIR/dda-${CI_JOB_ID}"
    - export PATH="$DDA_DIR:$PATH"
    - export DDA_NO_DYNAMIC_DEPS=1
    - "# Perform installation only if the directory does not exist\nif [ ! -d \"$DDA_DIR\"\
      \ ]; then\n  robust_curl=\"curl -fsSL --retry 4\"  # recommended flags + resist\
      \ transient errors like `Connection reset by peer`\n  # Get the commit from the\
      \ build image variable in the format `vPIPELINE_ID-COMMIT`\n  export BUILDIMAGES_COMMIT=\"\
      ${CI_IMAGE_LINUX#*-}\"\n  export DDA_VERSION=\"$($robust_curl https://raw.githubusercontent.com/DataDog/datadog-agent-buildimages/${BUILDIMAGES_COMMIT}/dda.env\
      \ | awk -F= '/^DDA_VERSION=/ {print $2}')\"\n  # Detect architecture and download\
      \ appropriate binary\n  if [ \"$(uname -m)\" = \"arm64\" ]; then\n    dda_target_triple=\"\
      aarch64-apple-darwin\"\n  else\n    dda_target_triple=\"x86_64-apple-darwin\"\n\
      \  fi\n  $robust_curl -o dda.tar.gz https://github.com/DataDog/datadog-agent-dev/releases/download/${DDA_VERSION}/dda-${dda_target_triple}.tar.gz\n\
      \  tar -xzf dda.tar.gz\n  mkdir -p \"$DDA_DIR\"\n  sudo mv dda $DDA_DIR\n  rm\
      \ -f dda.tar.gz\n  # Explicitly bootstrap dda's managed environment. The stable\
      \ mirror\n  # (UV_DEFAULT_INDEX) lags new dda releases by a publish waiting period,\
      \ so\n  # let this install also resolve dda from the testing index already present\n\
      \  # in UV_INDEX. Scoped to the bootstrap only.\n  UV_INDEX_STRATEGY=unsafe-best-match\
      \ dda self restore\n  dda self dep sync -f legacy-tasks\n  dda self pip install\
      \ awscli==1.29.45\nfi\n"
-   - dda inv -- -e bazel.collect-junit --flavor=$FLAVOR --output-tgz=junit-${CI_JOB_NAME}.tgz
-     --bep-file=$BEP_FILE || true
+   - dda inv -- -e bazel.process-test-results --bep-file=$BEP_FILE --junit-tar=junit-${CI_JOB_NAME}.tgz
+     --result-json=$RESULT_JSON
    - $CI_PROJECT_DIR/tools/ci/junit_upload.sh
    artifacts:
      expire_in: 2 weeks
      paths:
+     - $RESULT_JSON
+     - test_output_unified.json
      - junit-*.tgz
-     - bazel-bep-*.json
?                --
+     - bazel-bep.json
      - bazel-exec.log
      reports:
        annotations:
        - $EXTERNAL_LINKS_PATH
      when: always
    before_script:
    - . tools/ci/sanitize-goproxy.sh
    id_tokens:
      BUILDBARN_ID_TOKEN:
        aud: buildbarn.us1.ddbuild.io
      CI_IDENTITIES_GITLAB_ID_TOKEN:
        aud: ci-identities
    needs:
    - artifacts: false
      job: bazel:run-go-mod-tidy
    - artifacts: false
      job: bazel:run-gazelle
    rules:
    - when: on_success
    script:
    - "if [ -z \"$TMPDIR\" ]; then\n  echo \"TMPDIR must be set\" >& 2\n  exit 1\nfi\n"
    - export DDA_DIR="$TMPDIR/dda-${CI_JOB_ID}"
    - export PATH="$DDA_DIR:$PATH"
    - export DDA_NO_DYNAMIC_DEPS=1
    - "# Perform installation only if the directory does not exist\nif [ ! -d \"$DDA_DIR\"\
      \ ]; then\n  robust_curl=\"curl -fsSL --retry 4\"  # recommended flags + resist\
      \ transient errors like `Connection reset by peer`\n  # Get the commit from the\
      \ build image variable in the format `vPIPELINE_ID-COMMIT`\n  export BUILDIMAGES_COMMIT=\"\
      ${CI_IMAGE_LINUX#*-}\"\n  export DDA_VERSION=\"$($robust_curl https://raw.githubusercontent.com/DataDog/datadog-agent-buildimages/${BUILDIMAGES_COMMIT}/dda.env\
      \ | awk -F= '/^DDA_VERSION=/ {print $2}')\"\n  # Detect architecture and download\
      \ appropriate binary\n  if [ \"$(uname -m)\" = \"arm64\" ]; then\n    dda_target_triple=\"\
      aarch64-apple-darwin\"\n  else\n    dda_target_triple=\"x86_64-apple-darwin\"\n\
      \  fi\n  $robust_curl -o dda.tar.gz https://github.com/DataDog/datadog-agent-dev/releases/download/${DDA_VERSION}/dda-${dda_target_triple}.tar.gz\n\
      \  tar -xzf dda.tar.gz\n  mkdir -p \"$DDA_DIR\"\n  sudo mv dda $DDA_DIR\n  rm\
      \ -f dda.tar.gz\n  # Explicitly bootstrap dda's managed environment. The stable\
      \ mirror\n  # (UV_DEFAULT_INDEX) lags new dda releases by a publish waiting period,\
      \ so\n  # let this install also resolve dda from the testing index already present\n\
      \  # in UV_INDEX. Scoped to the bootstrap only.\n  UV_INDEX_STRATEGY=unsafe-best-match\
      \ dda self restore\n  dda self dep sync -f legacy-tasks\n  dda self pip install\
      \ awscli==1.29.45\nfi\n"
    - dda inv -- -e gitlab.generate-ci-visibility-links --output=$EXTERNAL_LINKS_PATH
    - bazel test --config=gorace --keep_going --remote_download_outputs=toplevel --build_event_json_file=$BEP_FILE
      --execution_log_compact_file=$CI_PROJECT_DIR/bazel-exec.log //... -- -//test/new-e2e/...
    stage: source_test
    tags:
    - macos:sonoma-arm64
    - specific:true
    variables:
      BAZELISK_HOME: $XDG_CACHE_HOME/bazelisk
-     BEP_FILE: $CI_PROJECT_DIR/bazel-bep-$FLAVOR.json
?                                        --------
+     BEP_FILE: $CI_PROJECT_DIR/bazel-bep.json
      EXTERNAL_LINKS_PATH: external_links_$CI_JOB_ID.json
-     FLAVOR: base
+     RESULT_JSON: test_output.json
      XDG_CACHE_HOME: $RUNNER_TEMP_PROJECT_DIR

Changes Summary

Removed Modified Added Renamed
0 6 0 0

ℹ️ Diff available in the job log.

@alopezz
alopezz force-pushed the alopez/bazel-go-test-tweaks branch from cf90882 to c8a2a19 Compare August 10, 2026 16:29
@alopezz alopezz changed the title Alopez/bazel go test tweaks Add test2json and UTOF output to bazel-driven go tests Aug 10, 2026
@alopezz
alopezz marked this pull request as ready for review August 10, 2026 17:53
@alopezz
alopezz requested a review from a team as a code owner August 10, 2026 17:53
@dd-octo-sts

dd-octo-sts Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Files inventory check summary

File checks results against ancestor cf93aeb3:

Results for datadog-agent_7.84.0~devel.git.200.1b94cc8.pipeline.130920635-1_amd64.deb:

No change detected

Results for datadog-iot-agent_7.84.0~devel.git.200.1b94cc8.pipeline.130920635-1_amd64.deb:

No change detected

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b0f1265448

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread tasks/bazel.py
@dd-octo-sts

dd-octo-sts Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Static quality checks

✅ Please find below the results from static quality gates
Comparison made with ancestor cf93aeb
📊 Static Quality Gates Dashboard
🔗 SQG Job

33 successful checks with minimal change (< 2 KiB)
Quality gate Current Size
agent_deb_amd64 760.082 MiB
agent_deb_amd64_fips 712.942 MiB
agent_heroku_amd64 312.420 MiB
agent_msi 643.509 MiB
agent_rpm_amd64 760.065 MiB
agent_rpm_amd64_fips 712.926 MiB
agent_rpm_arm64 735.965 MiB
agent_rpm_arm64_fips 692.151 MiB
agent_suse_amd64 760.065 MiB
agent_suse_amd64_fips 712.926 MiB
agent_suse_arm64 735.965 MiB
agent_suse_arm64_fips 692.151 MiB
docker_agent_amd64 818.697 MiB
docker_agent_arm64 819.640 MiB
docker_agent_jmx_amd64 1009.595 MiB
docker_agent_jmx_arm64 999.190 MiB
docker_cluster_agent_amd64 210.475 MiB
docker_cluster_agent_arm64 223.456 MiB
docker_cws_instrumentation_amd64 7.439 MiB
docker_cws_instrumentation_arm64 6.877 MiB
docker_dogstatsd_amd64 39.482 MiB
docker_dogstatsd_arm64 37.560 MiB
docker_host_profiler_amd64 305.814 MiB
docker_host_profiler_arm64 317.125 MiB
dogstatsd_deb_amd64 30.224 MiB
dogstatsd_deb_arm64 28.247 MiB
dogstatsd_rpm_amd64 30.224 MiB
dogstatsd_suse_amd64 30.224 MiB
iot_agent_deb_amd64 46.467 MiB
iot_agent_deb_arm64 43.120 MiB
iot_agent_deb_armhf 43.907 MiB
iot_agent_rpm_amd64 46.468 MiB
iot_agent_suse_amd64 46.467 MiB

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Aug 10, 2026

Copy link
Copy Markdown

Regression Detector

Regression Detector Results

Metrics dashboard
Target profiles
Job ID: 39b532b1-70c7-4297-940c-8c8f6d812771

Baseline: 078d86b
Comparison: 423906e
Diff

Optimization Goals: ✅ No significant changes detected

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI trials links
quality_gate_security_no_fs_load memory utilization +0.27 [+0.13, +0.41] 1 Logs bounds checks dashboard
quality_gate_security_idle memory utilization +0.25 [+0.15, +0.36] 1 Logs bounds checks dashboard
quality_gate_idle memory utilization -0.00 [-0.12, +0.12] 1 Logs bounds checks dashboard
quality_gate_idle_all_features memory utilization -0.02 [-0.07, +0.02] 1 Logs bounds checks dashboard
quality_gate_security_mean_fs_load memory utilization -0.19 [-0.26, -0.11] 1 Logs bounds checks dashboard
quality_gate_metrics_logs memory utilization -0.30 [-0.55, -0.04] 1 Logs bounds checks dashboard
quality_gate_private_action_runner memory utilization -0.40 [-0.51, -0.28] 1 Logs bounds checks dashboard
quality_gate_logs % cpu utilization -1.46 [-2.33, -0.59] 1 Logs bounds checks dashboard

Bounds Checks: ✅ Passed

perf experiment bounds_check_name replicates_passed observed_value links
quality_gate_idle intake_connections 10/10 4 = 4 bounds checks dashboard
quality_gate_idle memory_usage 10/10 172.52MiB ≤ 178MiB bounds checks dashboard
quality_gate_idle total_bytes_received 10/10 739.96KiB ≤ 819.20KiB bounds checks dashboard
quality_gate_idle_all_features intake_connections 10/10 4 = 4 bounds checks dashboard
quality_gate_idle_all_features memory_usage 10/10 524.75MiB ≤ 538MiB bounds checks dashboard
quality_gate_idle_all_features total_bytes_received 10/10 1.12MiB ≤ 1.25MiB bounds checks dashboard
quality_gate_logs intake_connections 10/10 16 ≤ 40 bounds checks dashboard
quality_gate_logs memory_usage 10/10 204.55MiB ≤ 229MiB bounds checks dashboard
quality_gate_logs missed_bytes 10/10 0B = 0B bounds checks dashboard
quality_gate_logs total_bytes_received 10/10 264.22MiB ≤ 292MiB bounds checks dashboard
quality_gate_metrics_logs cpu_usage 10/10 368.78 ≤ 2000 bounds checks dashboard
quality_gate_metrics_logs intake_connections 10/10 17 ≤ 40 bounds checks dashboard
quality_gate_metrics_logs memory_usage 10/10 409.04MiB ≤ 439MiB bounds checks dashboard
quality_gate_metrics_logs missed_bytes 10/10 0B = 0B bounds checks dashboard
quality_gate_metrics_logs total_bytes_received 10/10 0.94GiB ≤ 1.04GiB bounds checks dashboard
quality_gate_private_action_runner memory_usage 10/10 72.17MiB ≤ 76MiB bounds checks dashboard
quality_gate_security_idle cpu_usage 10/10 26.56 ≤ 100 bounds checks dashboard
quality_gate_security_idle memory_usage 10/10 326.71MiB ≤ 335MiB bounds checks dashboard
quality_gate_security_mean_fs_load cpu_usage 10/10 60.02 ≤ 200 bounds checks dashboard
quality_gate_security_mean_fs_load memory_usage 10/10 305.03MiB ≤ 314MiB bounds checks dashboard
quality_gate_security_no_fs_load cpu_usage 10/10 20.77 ≤ 100 bounds checks dashboard
quality_gate_security_no_fs_load memory_usage 10/10 308.33MiB ≤ 343MiB bounds checks dashboard

Explanation

Confidence level: 90.00%
Effect size tolerance: |Δ mean %| ≥ 5.00%

Performance changes are noted in the perf column of each table:

  • ✅ = significantly better comparison variant performance
  • ❌ = significantly worse comparison variant performance
  • ➖ = no significant change in performance

A regression test is an A/B test of target performance in a repeatable rig, where "performance" is measured as "comparison variant minus baseline variant" for an optimization goal (e.g., ingress throughput). Due to intrinsic variability in measuring that goal, we can only estimate its mean value for each experiment; we report uncertainty in that value as a 90.00% confidence interval denoted "Δ mean % CI".

For each experiment, we decide whether a change in performance is a "regression" -- a change worth investigating further -- if all of the following criteria are true:

  1. Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.

  2. Its 90.00% confidence interval "Δ mean % CI" does not contain zero, indicating that if our statistical model is accurate, there is at least a 90.00% chance there is a difference in performance between baseline and comparison variants.

  3. Its configuration does not mark it "erratic".

CI Pass/Fail Decision

Passed. All Quality Gates passed.

  • quality_gate_security_no_fs_load, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_security_no_fs_load, bounds check cpu_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_security_idle, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_security_idle, bounds check cpu_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_metrics_logs, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_metrics_logs, bounds check cpu_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_metrics_logs, bounds check missed_bytes: 10/10 replicas passed. Gate passed.
  • quality_gate_metrics_logs, bounds check intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_metrics_logs, bounds check total_bytes_received: 10/10 replicas passed. Gate passed.
  • quality_gate_private_action_runner, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_idle_all_features, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_idle_all_features, bounds check intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_idle_all_features, bounds check total_bytes_received: 10/10 replicas passed. Gate passed.
  • quality_gate_logs, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_logs, bounds check missed_bytes: 10/10 replicas passed. Gate passed.
  • quality_gate_logs, bounds check intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_logs, bounds check total_bytes_received: 10/10 replicas passed. Gate passed.
  • quality_gate_security_mean_fs_load, bounds check cpu_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_security_mean_fs_load, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_idle, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_idle, bounds check intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_idle, bounds check total_bytes_received: 10/10 replicas passed. Gate passed.

Comment thread tasks/bazel.py


def _parse_bep(bep_path: Path) -> tuple[list[Path], dict[str, bool]]:
class BepTestArtifacts(TypedDict):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is any of this in tasks/bazel.py. This module is already too big.
We can split this into seperate things, and anything we can make a standalone tool (not in tasks) is even better.

I would make this a py_binary right next to bazel/tools/testlogs_to_json

In the long run, invoke has to go away. Let's stop making it bigger.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we do this later?

This PR is just modifying the existing machinery that we had already added for junit post-processing to add the rest of the processing steps. This is the minimal change to move us towards replacing the "legacy" test jobs with the bazel-enabled ones.

This functionality imports from a couple of modules from under the tasks tree. I don't want to figure out as part of this PR how to share that code with a bazel-run python script.

I also planned to follow this up with some cleanup because I think we're not planning to use ensure-test-parity anymore, so all the code supporting that might go away.

Also, this is fairly consistent with us planning to have users use inv test for the bazel-run tests when we make the switch.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes.. later is fine.

@alopezz alopezz added the ask-review Ask in slack required teams to review this PR label Aug 12, 2026
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit 423906e into main Aug 14, 2026
289 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the alopez/bazel-go-test-tweaks branch August 14, 2026 16:17
@github-actions github-actions Bot added this to the 7.84.0 milestone Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ask-review Ask in slack required teams to review this PR changelog/no-changelog No changelog entry needed internal Identify a non-fork PR medium review PR review might take time qa/no-code-change No code change in Agent code requiring validation team/agent-build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants