-
Notifications
You must be signed in to change notification settings - Fork 39
Ensure the dashes are removed from the test name prefix #184
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
Ensure the dashes are removed from the test name prefix #184
Conversation
|
@psss , do you know what is the fail there in the CI? It seems to me unrelated to beakerlib. |
|
/packit build |
|
Account martinhoyer has no write access nor is author of PR! |
Yes, these failures seem to be unrelated: This one is weird, will investigate. Just different grep needed for Seems to be an rpm conflict for the latest |
|
I've added a test that checks the phase name is correctly converted when passed into the |
src/test/journalTest.sh
Outdated
| journalReset | ||
|
|
||
| silentIfNotDebug "rlPhaseStartTest '//some/-phase//na--me-'" | ||
| assertTrue "Phase name is correctly converted when passing value to rlReport in rlPhaseEnd" "rlPhaseEnd | grep '^some-phase-na-me- '" |
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.
Looking at the example, wouldn't it be better to strip the dashes trailing at the end as well?
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 don't think it's necessary from the perspective of the tmt-report-result script (or other BEAKERLIB_COMMAND_REPORT_RESULT scripts). The trailing dashes shouldn't affect getopts parsing in any way. However, I agree that removing them does make the output look neater.
I've added another sed which removes them.
1bf495a to
47954ef
Compare
This PR ensures the dashes are removed from the prefix of the test name (phase name) when calling the
rlReport.Commands located in the
BEAKERLIB_COMMAND_REPORT_RESULTvariable can badly handle these dashes (e.g. as program arguments when parsing with getopts):beakerlib/src/testing.sh
Line 1076 in cfa801f
We should also consider adding
--after the$BEAKERLIB_COMMAND_REPORT_RESULTcommand call to enforce the handling of these arguments as positional. But we are not sure whetherrstrnt-report-resultorrhts-report-resultwould handle it as expected:Related to:
TODOs:
tmt-report-resultscript.