From 314f32ed45f52c01685e04ce6af2170e91942f49 Mon Sep 17 00:00:00 2001 From: Michael Kaye <1917473+michaelkaye@users.noreply.github.com> Date: Wed, 9 Mar 2022 09:33:05 +0000 Subject: [PATCH 1/4] If a FileNotFound exception occurs, log a simple message indicating the tests may have not run. --- tools/ci/render_test_output.py | 55 ++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/tools/ci/render_test_output.py b/tools/ci/render_test_output.py index 1e7940ce04..f955b93cf9 100755 --- a/tools/ci/render_test_output.py +++ b/tools/ci/render_test_output.py @@ -13,32 +13,35 @@ print("::group::Arguments") 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::") From 5ec8a2b36d8f8027c311a67bf5590dbe7791b5ce Mon Sep 17 00:00:00 2001 From: Michael Kaye <1917473+michaelkaye@users.noreply.github.com> Date: Wed, 9 Mar 2022 10:04:25 +0000 Subject: [PATCH 2/4] Add some color to the nightly summary. --- .github/workflows/nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index a5bb7c2a6c..01df067f1f 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -379,4 +379,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 }}
{{name}} {{conclusion}} at {{completed_at}} [details]{{/if}}{{/with}}{{/each}}" + html_template: "Nightly test run results: {{#each job_statuses }}{{#with this }}{{#if completed }}
{{icon conclusion}} {{name}} {{conclusion}} at {{completed_at}} [details]{{/if}}{{/with}}{{/each}}" From 029ccfa37f397e04323158d40b963ec484e4aa70 Mon Sep 17 00:00:00 2001 From: Michael Kaye <1917473+michaelkaye@users.noreply.github.com> Date: Wed, 9 Mar 2022 10:21:29 +0000 Subject: [PATCH 3/4] Add names to all jobs --- .github/workflows/nightly.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 01df067f1f..ebddf716d5 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -308,6 +308,7 @@ jobs: failure_screenshots/ codecov-units: + name: Unit tests with codecoverage runs-on: macos-latest steps: - uses: actions/checkout@v3 @@ -333,6 +334,7 @@ jobs: build/reports/jacoco/allCodeCoverageReport/allCodeCoverageReport.xml sonarqube: + name: Sonarqube upload runs-on: macos-latest if: always() needs: @@ -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 From c687252fb6b91106a5df444ac629b49cca1b2339 Mon Sep 17 00:00:00 2001 From: Michael Kaye <1917473+michaelkaye@users.noreply.github.com> Date: Mon, 21 Mar 2022 14:31:17 +0000 Subject: [PATCH 4/4] Update .github/workflows/nightly.yml --- .github/workflows/nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index ebddf716d5..a36ea0a123 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -308,7 +308,7 @@ jobs: failure_screenshots/ codecov-units: - name: Unit tests with codecoverage + name: Unit tests with code coverage runs-on: macos-latest steps: - uses: actions/checkout@v3