Skip to content

feat: allow/fix no keywords in output.xml processing#297

Merged
timdegroot1996 merged 2 commits into
MarketSquare:mainfrom
HuntTheSun:pr/allow_no_keywords
Jun 1, 2026
Merged

feat: allow/fix no keywords in output.xml processing#297
timdegroot1996 merged 2 commits into
MarketSquare:mainfrom
HuntTheSun:pr/allow_no_keywords

Conversation

@HuntTheSun

Copy link
Copy Markdown
Contributor

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:

# processors.py function calculate_keyword_averages
run_start = keyword_list[0][0] # keyword list is None if no keywords in xml

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 :)

@timdegroot1996

Copy link
Copy Markdown
Collaborator

@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:

  1. If we do this for the keywords, would it not make sense to also do this for the other data types as well? So also for test, suite and run?
  2. If we add it for all types, or even only for keywords, I think it's a good idea to still show a warning in the console during the processing that this has occurred. This way it is not some invisible handling but it can be found if people look for it.

Let me know what you think about these points!

@HuntTheSun

Copy link
Copy Markdown
Contributor Author

If we do this for the keywords, would it not make sense to also do this for the other data types as well? So also for test, suite and run?

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.

If we add it for all types, or even only for keywords, I think it's a good idea to still show a warning in the console during the processing that this has occurred. This way it is not some invisible handling but it can be found if people look for it.

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.

@timdegroot1996

Copy link
Copy Markdown
Collaborator

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.

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>
@HuntTheSun HuntTheSun force-pushed the pr/allow_no_keywords branch from 80c1466 to 887d236 Compare May 27, 2026 13:35
@HuntTheSun

Copy link
Copy Markdown
Contributor Author

empty.html

Hi @timdegroot1996
It seems to work, my gut feeling says the implementation shouldn't have been so seamless, but I haven't gotten it to break yet. I just added some warning prints, nothing else needed (as far as I can tell).
I will need to poke around a bit further, do you by chance know about anything I messed up or forgot?

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)

@timdegroot1996

Copy link
Copy Markdown
Collaborator

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!

@HuntTheSun

Copy link
Copy Markdown
Contributor Author

@timdegroot1996
I haven't gotten it to break anything yet, there may still be some hidden small breakages (other than the UI being empty where Keywords would be), but if you're comfortable with risking having a few small bugs (I couldn't find any) for such a niche use case I think its good to go. I've set it to ready for review.

Thank you!

@HuntTheSun HuntTheSun marked this pull request as ready for review May 28, 2026 08:24
@timdegroot1996

Copy link
Copy Markdown
Collaborator

Thanks for the update! Just like with the other PR I'll try to review today somewhere and get back to you!

@timdegroot1996

Copy link
Copy Markdown
Collaborator

Looks good so I merged it, sorry that I haven't gotten around to it earlier...

@timdegroot1996 timdegroot1996 merged commit 90b1228 into MarketSquare:main Jun 1, 2026
3 checks passed
@HuntTheSun

Copy link
Copy Markdown
Contributor Author

Thank you for your work!
❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants