Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI Script improvements #5471

Merged
merged 4 commits into from
Mar 21, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ jobs:
failure_screenshots/

codecov-units:
name: Unit tests with codecoverage
Copy link
Contributor

Choose a reason for hiding this comment

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

code coverage*

michaelkaye marked this conversation as resolved.
Show resolved Hide resolved
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -333,6 +334,7 @@ jobs:
build/reports/jacoco/allCodeCoverageReport/allCodeCoverageReport.xml

sonarqube:
name: Sonarqube upload
runs-on: macos-latest
if: always()
needs:
Expand Down Expand Up @@ -362,6 +364,7 @@ jobs:

# Notify the channel about scheduled runs, do not notify for manually triggered runs
notify:
name: Notify matrix
runs-on: ubuntu-latest
needs:
- integration-tests
Expand All @@ -379,4 +382,4 @@ jobs:
matrix_access_token: ${{ secrets.ELEMENT_ANDROID_NOTIFICATION_ACCESS_TOKEN }}
matrix_room_id: ${{ secrets.ELEMENT_ANDROID_INTERNAL_ROOM_ID }}
text_template: "Nightly test run: {{#each job_statuses }}{{#with this }}{{#if completed }} {{name}} {{conclusion}} at {{completed_at}}, {{/if}}{{/with}}{{/each}}"
html_template: "Nightly test run results: {{#each job_statuses }}{{#with this }}{{#if completed }}<br />{{name}} {{conclusion}} at {{completed_at}} <a href=\"{{html_url}}\">[details]</a>{{/if}}{{/with}}{{/each}}"
html_template: "Nightly test run results: {{#each job_statuses }}{{#with this }}{{#if completed }}<br />{{icon conclusion}} {{name}} <font color='{{color conclusion}}'>{{conclusion}} at {{completed_at}} <a href=\"{{html_url}}\">[details]</a></font>{{/if}}{{/with}}{{/each}}"
55 changes: 29 additions & 26 deletions tools/ci/render_test_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,35 @@
print(f"{sys.argv}")
print("::endgroup::")
for xmlfile in xmlfiles:
tree = ET.parse(xmlfile)
try:
tree = ET.parse(xmlfile)

root = tree.getroot()
name = root.attrib['name']
time = root.attrib['time']
tests = int(root.attrib['tests'])
skipped = int(root.attrib['skipped'])
errors = int(root.attrib['errors'])
failures = int(root.attrib['failures'])
success = tests - failures - errors - skipped
total = tests - skipped
print(f"::group::{name} {success}/{total} ({skipped} skipped) in {time}")

for testcase in root:
if testcase.tag != "testcase":
continue
testname = testcase.attrib['classname']
message = testcase.attrib['name']
time = testcase.attrib['time']
child = testcase.find("failure")
if child is None:
print(f"{message} in {time}s")
else:
print(f"::error file={testname}::{message} in {time}s")
print(child.text)
body = f"passed={success} failures={failures} errors={errors} skipped={skipped}"
print(f"::set-output name={suitename}::={body}")
root = tree.getroot()
name = root.attrib['name']
time = root.attrib['time']
tests = int(root.attrib['tests'])
skipped = int(root.attrib['skipped'])
errors = int(root.attrib['errors'])
failures = int(root.attrib['failures'])
success = tests - failures - errors - skipped
total = tests - skipped
print(f"::group::{name} {success}/{total} ({skipped} skipped) in {time}")

for testcase in root:
if testcase.tag != "testcase":
continue
testname = testcase.attrib['classname']
message = testcase.attrib['name']
time = testcase.attrib['time']
child = testcase.find("failure")
if child is None:
print(f"{message} in {time}s")
else:
print(f"::error file={testname}::{message} in {time}s")
print(child.text)
body = f" passed={success} failures={failures} errors={errors} skipped={skipped}"
print(f"::set-output name={suitename}::={body}")
except FileNotFoundError:
print(f"::error::Unable to open test results file {xmlfile} - check if the tests completed")
print("::endgroup::")