Skip to content

Conversation

vinnybod
Copy link
Contributor

@vinnybod vinnybod commented Dec 19, 2024

The junit.xml files generated by pytest use the name pytest by default. For any tools that consume the xml files like IDEs or CI system UIs, this makes the output unfriendly because every test case rolls up the the same test suite named pytest.

The changes here add the BAZEL_TARGET name to the suite using standard pytest command line args.

Here is an example before and after when running the tests with and without the change in IntelliJ. The example only runs two test targets. The issue becomes more apparent as the number of targets scales up.

Screenshot 2024-12-18 at 5 13 47 PM Screenshot 2024-12-18 at 5 12 37 PM

Changes are visible to end-users: yes/no

  • Searched for relevant documentation and updated as needed: no
  • Breaking change (forces users to change their own code or config): no
  • Suggested release notes appear below: no

Test plan

Run a py_test target that uses py_pytest_main and observe the test suite name.

@fzakaria
Copy link

fzakaria commented Jan 9, 2025

This has been a great QoL improvement for us; highly recommend the merge.

@mattem mattem enabled auto-merge (squash) January 10, 2025 00:28
@mattem mattem merged commit abb63a1 into aspect-build:main Jan 10, 2025
12 checks passed
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

Successfully merging this pull request may close these issues.

3 participants