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 output 'testsuite name' includes the full path of the test folder except on the first one #913

Open
e-minguez opened this issue Apr 29, 2024 · 0 comments
Labels
Component: Bash Code Everything regarding the bash code Priority: Medium Wrong or misleading documentation, broken behavior with workaround Size: Medium Changes in the same file Status: Unconfirmend No reproducer was provided or the reproducer did not work for maintainers. Type: Bug

Comments

@e-minguez
Copy link

Describe the bug
When running bats --report-formatter junit ... with a couple of folders, the xml generated includes the full path of the tests except on the first one.

To Reproduce
Steps to reproduce the behavior:

  1. Create example file.bats with following contents
@test "can run our script" {
    ./src/project.sh
}
  1. Create the following src/project.sh file and make it executable (chmod a+x)
#!/bin/bash
echo "yas"
  1. Create the following structure:
foobar
└── file.bats
foobar-second
└── file.bats
src
└── project.sh
  1. Run bats as bats --report-formatter junit -T foobar foobar-second

The xml file being generated looks like:

<?xml version="1.0" encoding="UTF-8"?>
<testsuites time="0.013">
<testsuite name="file.bats" tests="1" failures="0" errors="0" skipped="0" time="0.006" timestamp="2024-04-29T15:31:31" hostname="N-1.local">
    <testcase classname="file.bats" name="can run our script" time="0.006" />

</testsuite>
<testsuite name="/Users/eminguez/Downloads/foobar-second/file.bats" tests="1" failures="0" errors="0" skipped="0" time="0.007" timestamp="2024-04-29T15:31:31" hostname="N-1.local">
    <testcase classname="/Users/eminguez/Downloads/foobar-second/file.bats" name="can run our script" time="0.007" />

</testsuite>
</testsuites>

As you can see the testsuite name should be either the whole path or just the file but not mixed.

Expected behavior
I think only the filename should be present on the testsuite name property.

Environment

  • Bats version - Bats 1.10.0
  • operating system (including version): OSX but also openSUSE Tumbleweed
  • bash --version: 4.4.23(1)-release
  • Install method: packages or containers

Additional context

@e-minguez e-minguez added Priority: NeedsTriage Issue has not been vetted yet Type: Bug labels Apr 29, 2024
@martin-schulze-vireso martin-schulze-vireso added Priority: Medium Wrong or misleading documentation, broken behavior with workaround Status: Unconfirmend No reproducer was provided or the reproducer did not work for maintainers. Component: Bash Code Everything regarding the bash code Size: Medium Changes in the same file and removed Priority: NeedsTriage Issue has not been vetted yet labels May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Bash Code Everything regarding the bash code Priority: Medium Wrong or misleading documentation, broken behavior with workaround Size: Medium Changes in the same file Status: Unconfirmend No reproducer was provided or the reproducer did not work for maintainers. Type: Bug
Projects
None yet
Development

No branches or pull requests

2 participants