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

chore(ci): Publish unit-test results for the bazel-workflow #14145

Merged
merged 1 commit into from
Oct 18, 2022

Conversation

vktng
Copy link
Contributor

@vktng vktng commented Oct 12, 2022

Signed-off-by: Krisztián Varga krisztian.varga@tngtech.com

Summary

The the unit-test results were not published before for the Bazel build and test workflow. This PR ensures that the XML files are archived and published for all matrix jobs. This closes #13526.

Test Plan

CI.

Test run with failing tests: https://github.com/vktng/magma/actions/runs/3235921237
Test run without failing tests: https://github.com/vktng/magma/actions/runs/3236092774

Additional Information

  • This change is backwards-breaking

@vktng vktng added component: ci All updates on CI (Jenkins/CircleCi/Github Action) bazel changes for the Bazelification effort labels Oct 12, 2022
@vktng vktng self-assigned this Oct 12, 2022
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines. label Oct 12, 2022
@github-actions
Copy link
Contributor

Thanks for opening a PR! 💯

A couple initial guidelines

Howto

  • Reviews. The "Reviewers" listed for this PR are the Magma maintainers who will shepherd it.
  • Checks. All required CI checks must pass before merge.
  • Merge. Once approved and passing CI checks, use the ready2merge label to indicate the maintainers can merge your PR.

More info

Please take a moment to read through the Magma project's

If this is your first Magma PR, also consider reading

@github-actions github-actions bot added the component: agw Access gateway-related issue label Oct 12, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Oct 12, 2022

feg-workflow

    2 files  203 suites   40s ⏱️
374 tests 374 ✔️ 0 💤 0
388 runs  388 ✔️ 0 💤 0

Results for commit 1a21054.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 12, 2022

dp-workflow

14 tests   14 ✔️  2m 53s ⏱️
  1 suites    0 💤
  1 files      0

Results for commit 1a21054.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 12, 2022

agw-workflow

615 tests   611 ✔️  3m 51s ⏱️
    2 suites      4 💤
    2 files        0

Results for commit 1a21054.

♻️ This comment has been updated with latest results.

@vktng vktng force-pushed the publish_xml_unittest_report_for_bazel branch from 1486f62 to 32fcd9c Compare October 13, 2022 09:04
@vktng vktng requested a review from ajahl October 13, 2022 12:38
@vktng vktng marked this pull request as ready for review October 13, 2022 12:39
@vktng vktng requested a review from a team October 13, 2022 12:39
@vktng vktng requested a review from a team as a code owner October 13, 2022 12:39
@vktng vktng requested a review from LKreutzer October 13, 2022 12:39
num_all_disabled += int(test_suites_data.attrib['disabled'])
init_time = min(init_time, datetime.fromisoformat(test_suites_data.attrib['timestamp']))
init_time = datetime.fromisoformat(test_suites_data.attrib.get('timestamp', str(init_time)))
Copy link
Contributor

Choose a reason for hiding this comment

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

The old logic finds the lowest init time of all xml files, while the new logic uses the one from the last xml file in the loop. I guess this was adapted because at one point it encountered a KeyError when there was no timestamp? In that case we could just

try:
    init_time = ...
except KeyError:
    pass

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Your are right, but wouldn't this be better?:
init_time = min(init_time, datetime.fromisoformat(test_suites_data.attrib.get('timestamp', str(init_time))))

@@ -46,17 +46,24 @@ def merge_all_report(working_dir, list_xml_report_paths, output_path):
xml_file_path = working_dir + "/" + xml_file_path
test_result = ET.parse(xml_file_path)
test_suites_data = test_result.getroot()
# for the integration tests pytest generates the XML files with a slightly different structure
Copy link
Contributor

Choose a reason for hiding this comment

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

Was the old name wrong?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I introduced this conditional when I was working on publishing integration tests results, but now that unit tests require the same conditional I think it is reasonable to rename it.

@vktng vktng force-pushed the publish_xml_unittest_report_for_bazel branch from 32fcd9c to e42cd0e Compare October 17, 2022 14:19
Signed-off-by: Krisztián Varga <krisztian.varga@tngtech.com>
@vktng vktng force-pushed the publish_xml_unittest_report_for_bazel branch from e42cd0e to 1a21054 Compare October 17, 2022 16:12
@vktng vktng merged commit a5457d3 into magma:master Oct 18, 2022
lucasgonze pushed a commit to lucasgonze/magma that referenced this pull request Feb 29, 2024
)

Signed-off-by: Krisztián Varga <krisztian.varga@tngtech.com>

Signed-off-by: Krisztián Varga <krisztian.varga@tngtech.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bazel changes for the Bazelification effort component: agw Access gateway-related issue component: ci All updates on CI (Jenkins/CircleCi/Github Action) size/M Denotes a PR that changes 30-99 lines.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

xml unit test reports are created and published
3 participants