Skip to content

Commit

Permalink
add benchmarks to nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreyMlashkin committed Nov 28, 2024
1 parent 049bc76 commit 804025f
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 2 deletions.
16 changes: 15 additions & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ jobs:
always() && !cancelled()
secrets: inherit

test-linux-benchmarks:
name: Linux placeholder testing and sanitize with clang
uses: ./.github/workflows/clang-benchmarks-linux-nix-check.yml
if: |
always() && !cancelled()
secrets: inherit

post-telemetry:
name: Post test results in Open Telemetry format
runs-on: [self-hosted, Linux, X64, aws_autoscaling]
Expand All @@ -33,7 +40,6 @@ jobs:
run: |
ls -l -a
nix build -L .?#checks.x86_64-linux.all-clang-sanitize
cat ./result/test-logs/test_errors.txt
export UndefinedBehaviorSanitizer=$(grep UndefinedBehaviorSanitizer result/test-logs/test_errors.txt | wc -l)
export AddressSanitizer=$(grep AddressSanitizer result/test-logs/test_errors.txt | wc -l)
export LeakSanitizer=$(grep LeakSanitizer result/test-logs/test_errors.txt | wc -l)
Expand All @@ -49,3 +55,11 @@ jobs:
--service_name nightly-build \
python3 ./parse_tests.py
nix build -L .?#checks.x86_64-linux.all-clang-benchmarks
/home/ec2-user/.local/bin/opentelemetry-instrument \
--traces_exporter console,otlp \
--metrics_exporter console,otlp \
--logs_exporter console,otlp \
--service_name nightly-build \
python3 ./parse_tests.py
43 changes: 43 additions & 0 deletions parse_benchmarks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import logging, json
from junitparser import JUnitXml
import glob, os
from opentelemetry import trace

aggregated_test_results = JUnitXml();
for file in glob.glob("result/test-logs/*_benchmark.xml"):
try:
test_result = JUnitXml.fromfile(file)
result[test_result.name]=test_result.time
aggregated_test_results.append(test_result)
except Exception as ex:
print("Error processing {}".format(file))
print(ex)

for file in glob.glob("result/test-logs/*_benchmark.xml"):
try:
except Exception as ex:
print("Error processing {}".format(file))
print(ex)

succeeded = aggregated_test_results.tests - \
aggregated_test_results.failures - \
aggregated_test_results.errors - \
aggregated_test_results.skipped

result = {
"benchmark_tests" : aggregated_test_results.tests,
"benchmark_failures" : aggregated_test_results.failures,
"benchmark_errors" : aggregated_test_results.errors,
"benchmark_skipped" : aggregated_test_results.skipped,
"benchmark_succeeded" : succeeded,
"benchmark_execution_time" : aggregated_test_results.time,
}

print("Resulting JSON: {}".format(json.dumps(result)))

tracer = trace.get_tracer_provider().get_tracer(__name__)
with tracer.start_as_current_span("nightly_span"):
current_span = trace.get_current_span()
current_span.add_event("Nightly benchmarks build finished")
logging.getLogger().error(json.dumps(result))

2 changes: 1 addition & 1 deletion parse_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@
tracer = trace.get_tracer_provider().get_tracer(__name__)
with tracer.start_as_current_span("nightly_span"):
current_span = trace.get_current_span()
current_span.add_event("Nightly build finished")
current_span.add_event("Nightly sanitizers build finished")
logging.getLogger().error(json.dumps(result))

0 comments on commit 804025f

Please sign in to comment.