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

jUnit report is missing required attribute #284

Open
mavinm opened this issue Dec 14, 2022 · 0 comments
Open

jUnit report is missing required attribute #284

mavinm opened this issue Dec 14, 2022 · 0 comments

Comments

@mavinm
Copy link

mavinm commented Dec 14, 2022

When running shellspec --format junit, the junit generated is missing the time attribute under the testsuite tag.

What's being outputted.

<?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="1" time="0.85" errors="0" failures="0" name="foo">
  <testsuite id="0" tests="1" errors="0" failures="0" skipped="0" name="spec/foo_spec.sh" hostname="HOSTNAME" timestamp="2022-12-13T23:56:02">
    <testcase time="0.85" classname="spec/foo_spec.sh" name="foo executes with no input">
      <system-out>my output</system-out>
      <system-err></system-err>
    </testcase>
  </testsuite>
</testsuites>

Adding the missing attribute time in testsuite.

<?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="1" time="0.85" errors="0" failures="0" name="foo">
  <testsuite time="0.85" id="0" tests="1" errors="0" failures="0" skipped="0" name="spec/foo_spec.sh" hostname="HOSTNAME" timestamp="2022-12-13T23:56:02">
    <testcase time="0.85" classname="spec/foo_spec.sh" name="foo executes with no input">
      <system-out>my output</system-out>
      <system-err></system-err>
    </testcase>
  </testsuite>
</testsuites>

I think this is a simple fix inside of https://github.com/shellspec/shellspec/blob/master/lib/libexec/reporter/junit_formatter.sh

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

No branches or pull requests

1 participant