Skip to content

Radish --early-exit Flag Causes Error: Cannot Get Duration of Scenario in JUnit XML Report #485

Closed
@priyacshah

Description

@priyacshah

Describe the bug
When running a Radish feature with the --junit-xml and --early-exit flags, if the feature fails, I am encountering the following traceback error:
Traceback (most recent call last): File "/root/.cache/pypoetry/virtualenvs/test-automation-framework-DJpFP61h-py3.11/lib/python3.11/site-packages/radish/hookregistry.py", line 135, in call func(model, *args, **kwargs) File "/root/.cache/pypoetry/virtualenvs/test-automation-framework-DJpFP61h-py3.11/lib/python3.11/site-packages/radish/extensions/junit_xml_writer.py", line 136, in generate_junit_xml time="%.3f" % scenario.duration.total_seconds(), ^^^^^^^^^^^^^^^^^ File "/root/.cache/pypoetry/virtualenvs/test-automation-framework-DJpFP61h-py3.11/lib/python3.11/site-packages/radish/model.py", line 80, in duration raise RadishError( radish.exceptions.RadishError: Cannot get duration of Scenario 'Create tarball with missing topology' because either starttime or endtime is not set

Environment and Version

  • OS : Ubuntu 22.04.4 LTS
  • Python Version: 3.10
  • radish Version: 0.17.1

To Reproduce

  1. Run a Radish feature with failure scenario and the following flags:

radish features/your_feature_file.feature --junit-xml --early-exit

  1. Observe the failure and the traceback error.

Expected behavior
I expect the feature to run and the JUnit XML report to be generated with failure scenario without encountering the error related to the scenario duration.

Additional context

  • The issue arises only when using the --early-exit flag in combination with the --junit-xml flag.
  • This might be related to how the duration of scenarios is tracked when a test fails early in the process.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions