Skip to content
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

Rebot generates invalid output.xml when using --removekeywords and there's IF on test case level #4009

Closed
mkorpela opened this issue Jun 9, 2021 · 5 comments
Labels
acknowledge To be acknowledged in release notes bug priority: high rc 1
Milestone

Comments

@mkorpela
Copy link
Member

mkorpela commented Jun 9, 2021

Here is the test case:

*** Test Cases ***
Testing 2
   IF  1 == 1
       Log  hello
   ELSE
       Log  none
   END
   Keyword

*** Keywords ***
Keyword
   IF  1 == 1
       Fail
   ELSE
       Log  none
   END

Then do
rebot --log NONE --report NONE --xunit NONE --consolecolors off --NoStatusRC --removekeywords all --output output_invalid.xml output.xml
If you do:
rebot --log NONE --report NONE --xunit NONE --consolecolors off --NoStatusRC --removekeywords all --output output_invalid.xml output_invalid.xml
Boom =>

[ ERROR ] Reading XML source 'output_invalid.xml' failed: Incompatible child element 'doc' for 'if'.

Try --help for usage information.
@mkorpela
Copy link
Member Author

mkorpela commented Jun 9, 2021

Credit for this goes to @emakaay mkorpela/pabot#364

@pekkaklarck
Copy link
Member

I can reproduce the problem and also have a pretty good idea why it occurs. Luckily the problem only occurs if there's IF on the test case level, not if there's IF in user keyword used by the test. Although this is an annoying bug, I don't think this is severe enough to warrant one more RF 4.0.x release, especially now when RF 4.1 work has just started. This obviously will be fixed RF 4.1.

@pekkaklarck pekkaklarck changed the title Removekeywords with if results in invalid output Rebot generates invalid output.xml when using --removekeywords and there's IF on test case level Jun 9, 2021
@miktuy
Copy link
Contributor

miktuy commented Jun 10, 2021

Hi! Try to fix in #4010

@pekkaklarck pekkaklarck added acknowledge To be acknowledged in release notes priority: high and removed priority: medium labels Jun 19, 2021
pekkaklarck pushed a commit that referenced this issue Jun 19, 2021
@pekkaklarck
Copy link
Member

I merged #4010 and it fixes the crash. A problem now is that the IF structure is completely removed from the log file. Considering that all keyword data is removed, we could consider this fine but I'd like to have something left there. Anyway, this is a lot smaller problem than the crash.

@pekkaklarck
Copy link
Member

The aforementioned problem was fixed in the above commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
acknowledge To be acknowledged in release notes bug priority: high rc 1
Projects
None yet
Development

No branches or pull requests

3 participants