-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
049bc76
commit abdb0f5
Showing
4 changed files
with
99 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Build and Test benchmark tests on Linux with clang | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
build-and-test: | ||
name: "Build and test benchmark tests on Linux with clang" | ||
runs-on: [self-hosted, Linux, X64, aws_autoscaling] | ||
continue-on-error: true | ||
steps: | ||
# https://github.com/actions/checkout/issues/1552 | ||
- name: Clean up after previous checkout | ||
run: chmod +w -R ${GITHUB_WORKSPACE}; rm -rf ${GITHUB_WORKSPACE}/*; | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Run checks | ||
run: | | ||
nix build -L .?#checks.x86_64-linux.all-clang-benchmarks | ||
mkdir results | ||
cp result/test-logs/*_test.xml results/ | ||
cp result/test-logs/*_benchmark.xml results/ | ||
ls -l -a results/ | ||
continue-on-error: true | ||
env: | ||
NIX_CONFIG: | | ||
cores = 8 | ||
- name: Publish Benchmarks Test Results | ||
uses: EnricoMi/publish-unit-test-result-action/linux@v2 | ||
with: | ||
check_name: "Benchmarks Test Results" | ||
files: "results/*.xml" | ||
comment_mode: ${{ github.event.pull_request.head.repo.fork && 'off' || 'always' }} # Don't create PR comment from fork runs | ||
action_fail_on_inconclusive: true # fail, if no reports | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters