feat: allow/fix no keywords in output.xml processing#297
Conversation
|
@HuntTheSun it is indeed fine not to make an issue for this. I think it is indeed small enough. I dont mind adding this, but I think there could be 2 improvements:
Let me know what you think about these points! |
Tbh I'm not sure if that will work, I havent played around with suite-less runs, or "runless" runs, I will play around with it and find out if it's possible.
I will add a warning if no suite/test/keyword encountered if expected. I will get back to you once I have an idea of whats feasible and how to do it, thank you for your replies. |
That's a good point. If it's not possible to do this without any errors then we can go with the solution that has "as many as work" in them. But of course if it's not possible we don't need to add it. Thanks for looking into this! |
Signed-off-by: HuntTheSun <HuntTheSun@users.noreply.github.com>
Signed-off-by: HuntTheSun <HuntTheSun@users.noreply.github.com>
80c1466 to
887d236
Compare
|
Hi @timdegroot1996 I generated runs with no suites/tests/keywords with this: # gen_empty.py
import subprocess
from robot.api import TestSuite
# empty tests
suite = TestSuite("Empty Suite")
suite.run(output="output_empty_tests.xml", stdout=open("/dev/null", "w"))
# empty suites (parent with child that has no tests)
root = TestSuite("Root")
root.suites.create(name="Child With No Tests")
root.run(output="output_empty_suites.xml", stdout=open("/dev/null", "w"))
# use rebot directly it has a flag for rm-ing keywords
subprocess.run([
"rebot", "--removekeywords", "ALL",
"--output", "output_no_keywords.xml",
"--nostatusrc",
"tests/robot/resources/outputs/output-20250313-002549.xml",
], stdout=subprocess.DEVNULL) |
|
Nice to see that it works! I will check it out when you are ready with this PR as well. Let me know if it's ready for review by updating the status from "Draft", then I will start the check again! |
|
@timdegroot1996 Thank you! |
|
Thanks for the update! Just like with the other PR I'll try to review today somewhere and get back to you! |
|
Looks good so I merged it, sorry that I haven't gotten around to it earlier... |
|
Thank you for your work! |
Hi @timdegroot1996
for the sake of our pipeline and storage systems, we strip our output.xml of keywords during robotframework tests.
Sadly, robotframework-dashboard runs into an exception here if there are no keywords in the output:
Would my "fix" be alright or do you dislike the "feature"/"fix"?
The keywords are empty for the run in the web-ui, no errors in the console.
Sorry for opening a PR directly, I thought a new Issue for a 1-line change would be a bit overkill :)