-
Notifications
You must be signed in to change notification settings - Fork 592
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: Improve integ test wrapper script #13628
chore: Improve integ test wrapper script #13628
Conversation
Thanks for opening a PR! 💯
Howto
More infoPlease take a moment to read through the Magma project's
If this is your first Magma PR, also consider reading
|
bb870b9
to
9dde152
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed offline:
$ ./bazel/scripts/run_integ_tests.sh --retry-on-failure
results in./bazel/scripts/run_integ_tests.sh: line 111: POSITIONAL_ARGS: unbound variable
report/merged_report/report_all_tests.xml
should not be localted under magma root, e.g., use something related toRESULTS_DIR := /var/tmp/test_results
in make integ tests
-> in the repo is not good- fix result xml - make it publishable
9dde152
to
fe00aee
Compare
Fixed. |
@@ -46,12 +46,15 @@ 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() | |||
|
|||
integration_tests = test_suites_data.attrib == {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit confused by the these changes. So if we're running integration tests, there's an empty dict here and the real data is in the first element? Maybe it would be good to add a comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the xml is created with pytest then the structure is slightly different from what this script was intended to work with. If the attributes are missing, then we have to copy them from the child node.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. 👍
By the way, there's an unused variable in this function called c
that you could remove if you like.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AGW changes looking good.
@@ -46,12 +46,15 @@ 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() | |||
|
|||
integration_tests = test_suites_data.attrib == {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. 👍
By the way, there's an unused variable in this function called c
that you could remove if you like.
6a509f1
to
c7c861a
Compare
@@ -1199,10 +1198,7 @@ pytest_test( | |||
srcs = ["test_attach_detach_flaky_retry_success.py"], | |||
imports = [LTE_ROOT], | |||
tags = TAG_EXTENDED_TEST, | |||
deps = [ | |||
":s1ap_wrapper", | |||
requirement("flaky"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since "flaky" is a dependency of pytest from now on you do not need to specify it. (It will lead to a duplication error.)
See bazel/python_test.bzl
Needs to be rebased to get the fix for the DP CI issue from master. |
Signed-off-by: Krisztián Varga <krisztian.varga@tngtech.com>
…t wrapper script Signed-off-by: Krisztián Varga <krisztian.varga@tngtech.com>
Signed-off-by: Krisztián Varga <krisztian.varga@tngtech.com>
… the wrapper script Signed-off-by: Krisztián Varga <krisztian.varga@tngtech.com>
c7c861a
to
fee0c71
Compare
Summary
The integration test wrapper script for Bazel was lacking some desired features, this PR aims to resolve 4 of them:
--retry-on-failure
and--retry-attempts N
was added. With these you can rerun failing tests N times and they will only be considered failed if all attempts fail.--rerun-previously-failed
option you can rerun all previously failed tests.Test Plan
Use options as described in
bazel/scripts/run_integ_tests.sh --help
.Some examples:
Additional Information