From cd028341889bd3212d863ef64dc4646c6609daf9 Mon Sep 17 00:00:00 2001 From: Andrei Malashkin Date: Thu, 14 Nov 2024 13:13:05 +0100 Subject: [PATCH] add sanitizers reports --- .github/workflows/clang-sanitizers-linux-nix-check.yml | 2 +- .github/workflows/pull-request.yml | 4 +++- parse_tests.py | 9 ++++++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/clang-sanitizers-linux-nix-check.yml b/.github/workflows/clang-sanitizers-linux-nix-check.yml index d0e1ec308b..7405aeed8a 100644 --- a/.github/workflows/clang-sanitizers-linux-nix-check.yml +++ b/.github/workflows/clang-sanitizers-linux-nix-check.yml @@ -1,4 +1,4 @@ -name: Build and Test on Linux Platforms +name: Build and Test sanitizers on Linux with clang on: workflow_call: diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index ad05b22c61..963b1d163e 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -30,7 +30,9 @@ jobs: steps: - name: Post logs to Sig Noz run: | - printenv + UndefinedBehaviorSanitizer=$(nix log -L .?#checks.x86_64-linux.all-sanitizers | grep UndefinedBehaviorSanitizer | wc -l) + AddressSanitizer=$(nix log -L .?#checks.x86_64-linux.all-sanitizers | grep "AddressSanitizer" | wc -l) + LeakSanitizer=$(nix log -L .?#checks.x86_64-linux.all-sanitizers | grep "LeakSanitizer" | wc -l) ls -l -a ls -l -a ./result/ export OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED=true diff --git a/parse_tests.py b/parse_tests.py index 4d7f0aa7ed..88961d8bd8 100644 --- a/parse_tests.py +++ b/parse_tests.py @@ -3,6 +3,10 @@ import glob, os from opentelemetry import trace +undefined_behavior_sanitizer=os.environ['UndefinedBehaviorSanitizer'] +address_sanitizer=os.environ['AddressSanitizer'] +leak_sanitizer=os.environ['LeakSanitizer'] + aggregated_test_results = JUnitXml(); for file in glob.glob("result/test-logs/*.xml"): aggregated_test_results.append(JUnitXml.fromfile(file)) @@ -18,7 +22,10 @@ "errors" : aggregated_test_results.errors, "skipped" : aggregated_test_results.skipped, "succeeded" : succeeded, - "execution_time" : aggregated_test_results.time, + "execution_time" : aggregated_test_results.time, + "undefined_behavior_sanitizer" : int(undefined_behavior_sanitizer), + "address_sanitizer" : int(address_sanitizer), + "leak_sanitizer" : int(leak_sanitizer), } print("Resulting JSON: {}".format(json.dumps(result)))