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

behavex 4.0.2 generates invalid failure XML #144

Closed
aconti-ns1 opened this issue Sep 17, 2024 · 3 comments
Closed

behavex 4.0.2 generates invalid failure XML #144

aconti-ns1 opened this issue Sep 17, 2024 · 3 comments
Labels
bug Something isn't working fixed good first issue Good for newcomers

Comments

@aconti-ns1
Copy link

aconti-ns1 commented Sep 17, 2024

Describe the bug
XML files generated by behavex contain invalid <failure> tags: the type attribute is unquoted and the CDATA is empty.

To Reproduce
Steps to reproduce the behavior:

  1. Run behavex 4.0.2 with failing tests (see Additional Context for my minimal configuration)
  2. behavex -o reports
  3. Check the XML in reports/behave/
  4. Observe the <failure> tag:
<failure type=Exception message=''>
    <![CDATA[  ]]>
</failure>

Expected behavior
The <failure> tag should contain a quoted value for the type attribute and the failing test step information should be contained in the CDATA:

<failure type="Assertionerror" message=''>
    <![CDATA[ Failing step: -- OMITTED OUTPUT -- ]]>
</failure>

Desktop (please complete the following information):

  • OS: Linux (Ubuntu 22.04.4), macOS (14.4)
  • behavex Version 4.0.2

Additional context
I have confirmed this is not related to behave, I have invoked behave with behavex installed at both 3.2.0 and 4.0.2 and behave generates valid XML in both cases.

I have a minimal configuration which will reproduce the issue:

features/steps/steps.py

from behave import step

@step("the test fails")
def fail_step(context):
    assert(False), "FAIL!"

features/sample.feature

Feature: Sample test
  Scenario: A failing scenario
    Given the test fails
@hrcorval hrcorval added bug Something isn't working good first issue Good for newcomers labels Sep 17, 2024
@hrcorval
Copy link
Owner

Hi @aconti-ns1 , thanks for reporting this issue. We have provided a fix in version 4.0.4 that will be released very soon:
https://github.com/hrcorval/behavex/tree/release_4.0.4
If you have urgency to get the fix, I can release a testing package in https://test.pypi.org/. just let us know and we can trigger it.
Regards,

@hrcorval hrcorval added the fixed label Sep 23, 2024
@hrcorval
Copy link
Owner

Hi @aconti-ns1, we have fixed this issue in latest version: https://pypi.org/project/behavex/4.0.4/
We hope it helps.

@aconti-ns1
Copy link
Author

Awesome, thanks so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants