SERVER-106566 Upload resmoke telemetry to Evergreen when ran via bazel (#43707)

GitOrigin-RevId: 89d2f650255fbe7a1597763269dd95d2b257f18f
This commit is contained in:
Sean Lyons 2025-11-07 11:04:03 -05:00 committed by MongoDB Bot
parent 355e94eee2
commit f6ec27f3d9
6 changed files with 24 additions and 1 deletions

View File

@ -418,7 +418,7 @@ common:remote_test --features=-thin_archive
common:remote_test --remote_download_outputs=minimal
common:remote_test --test_output=summary
common:remote_test --modify_execution_info=^(CppLink|CppArchive|SolibSymlink|ExtractDebuginfo|StripDebuginfo|CcGenerateIntermediateDwp|CcGenerateDwp)$=-no-remote-cache
common:remote_test --remote_download_regex=.*(TestLogs.*|report.*\.json$|\.core$|data_archives.*\.tgz$) # Resmoke TestLogs directory, report, core dumps, and data directory archives.
common:remote_test --remote_download_regex=.*(TestLogs.*|metrics.*\.json|report.*\.json$|\.core$|data_archives.*\.tgz$) # Resmoke TestLogs directory, report, core dumps, and data directory archives.
test:remote_test --test_timeout=660 # Allow extra 60s for coredump on abort
test:remote_test --test_tag_filters=-incompatible_with_bazel_remote_test

View File

@ -54,6 +54,10 @@ genrule(
cat bazel-out/volatile-status.txt > $@
""",
stamp = True,
tags = [
"external",
"no-cache",
], # Consuming volatile-status, so this should not cache
visibility = ["//visibility:public"],
)
@ -65,6 +69,10 @@ genrule(
awk '/^TEST_RUNTIMES/ { for (i=2; i<=NF; i++) print $$i }' bazel-out/volatile-status.txt > $@
""",
stamp = True,
tags = [
"external",
"no-cache",
], # Consuming volatile-status, so this should not cache
visibility = ["//visibility:public"],
)

View File

@ -47,6 +47,8 @@ def add_evergreen_build_info(args):
add_volatile_arg(args, "--variantName=", "build_variant")
add_volatile_arg(args, "--versionId=", "version_id")
add_volatile_arg(args, "--requester=", "requester")
add_volatile_arg(args, "--otelTraceId=", "otel_trace_id")
add_volatile_arg(args, "--otelParentId=", "otel_parent_id")
class ResmokeShimContext:

View File

@ -18,5 +18,7 @@ echo task_name ${task_name}
echo build_variant ${build_variant}
echo version_id ${version_id}
echo requester ${requester}
echo otel_trace_id ${otel_trace_id}
echo otel_parent_id ${otel_parent_id}
python bazel/resmoke/workspace_status.py

View File

@ -1349,6 +1349,8 @@ functions:
build_variant: ${build_variant}
version_id: ${version_id}
requester: ${requester}
otel_trace_id: ${otel_trace_id}
otel_parent_id: ${otel_parent_id}
args:
- "./src/evergreen/resmoke_tests_execute_bazel.sh"

View File

@ -129,6 +129,15 @@ find bazel-testlogs/ -path '*data_archives/*.tgz' -print0 |
ln -sf $source $target
done
# Symlink OTel metrics from multiple tests/shards to ${workdir}/build/OTelTraces for Evergreen to parse.
find bazel-testlogs/ -type f -path '*test.outputs/build/metrics*' -print0 |
while IFS= read -r -d '' metrics; do
source=${workdir}/src/$metrics
target=${workdir}/build/OTelTraces/$(echo $metrics | sed -e 's/bazel-testlogs\///g' -e 's/test\.outputs\/build\/metrics\///g' -e 's/\//_/g')
mkdir -p $(dirname $target)
ln -sf $source $target
done
# Combine reports from potentially multiple tests/shards.
find bazel-testlogs/ -name report*.json | xargs $python buildscripts/combine_reports.py --no-report-exit -o report.json