-
Notifications
You must be signed in to change notification settings - Fork 49
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
Avoid malformed results xml #209
Avoid malformed results xml #209
Conversation
In case there are no results, the xml files get malformed. The malformed xml is then refused by polarion. This edits the code the way the xml and html results will be generated only in the case when the subunit was generated with 0 return code (successfull operation). https://issues.redhat.com/browse/OSPRH-9242
|
||
echo "Generate html result" | ||
subunit2html ${TEMPEST_LOGS_DIR}testrepository.subunit ${TEMPEST_LOGS_DIR}stestr_results.html || true | ||
echo "Generate subunit, then xml and html results" |
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.
validation of the && and || logic, all possible situations:
# zero return code and successfully executes both of the echos - ideal case
$ true && (echo 1 || true) && echo 2 || true
1
2
# zero return code and no echo outputs - that's what we need to fix the issue
$ false && (echo 1 || true) && echo 2 || true
# zero return code and only the second echo successful - the first echo didn't affect the second one
$ true && (false || true) && echo 2 || true
2
# zero return code and only the first echo successful - the second echo didn't affect the first one nor the overall result
$ true && (echo 1 || true) && false || true
1
$
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.
What do you think about this version?
stestr last --subunit > ${TEMPEST_LOGS_DIR}testrepository.subunit
if [[ $? -eq 0 ]]; then
subunit2junitxml ${TEMPEST_LOGS_DIR}testrepository.subunit > ${TEMPEST_LOGS_DIR}tempest_results.xml
subunit2html ${TEMPEST_LOGS_DIR}testrepository.subunit ${TEMPEST_LOGS_DIR}stestr_results.html
fi
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.
same result with the difference i need to modify the patch one more time :D
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.
Yes, the result is the same. Readability wise, I'm not so sure. Take a look on how long comment you had to make just to explain how it works.
I'm not holding this. Let's move this forward.
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.
One small comment.
|
||
echo "Generate html result" | ||
subunit2html ${TEMPEST_LOGS_DIR}testrepository.subunit ${TEMPEST_LOGS_DIR}stestr_results.html || true | ||
echo "Generate subunit, then xml and html results" |
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.
What do you think about this version?
stestr last --subunit > ${TEMPEST_LOGS_DIR}testrepository.subunit
if [[ $? -eq 0 ]]; then
subunit2junitxml ${TEMPEST_LOGS_DIR}testrepository.subunit > ${TEMPEST_LOGS_DIR}tempest_results.xml
subunit2html ${TEMPEST_LOGS_DIR}testrepository.subunit ${TEMPEST_LOGS_DIR}stestr_results.html
fi
what are we waiting for here? it's ready to be merged or I need to hear specific feedback |
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.
LGTM 👍
|
||
echo "Generate html result" | ||
subunit2html ${TEMPEST_LOGS_DIR}testrepository.subunit ${TEMPEST_LOGS_DIR}stestr_results.html || true | ||
echo "Generate subunit, then xml and html results" |
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.
Yes, the result is the same. Readability wise, I'm not so sure. Take a look on how long comment you had to make just to explain how it works.
I'm not holding this. Let's move this forward.
[APPROVALNOTIFIER] This PR is APPROVED Approval requirements bypassed by manually added approval. This pull-request has been approved by: kopecmartin, lpiwowar The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
c19c44a
into
openstack-k8s-operators:main
In case there are no results, the xml files get malformed. The malformed xml is then refused by polarion.
This edits the code the way the xml and html results will be generated only in the case when the subunit was generated with 0 return code (successfull operation).
https://issues.redhat.com/browse/OSPRH-9242