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

Add a testcase line number to the output of JUnitFormatter #13468

Merged

Conversation

nobodywasishere
Copy link
Contributor

@nobodywasishere nobodywasishere commented May 13, 2023

This pull request adds a line number to every testcase in the JUnitFormatter output. Closes #13467.

Example:

<?xml version="1.0"?>
<testsuite tests="1" skipped="0" errors="0" failures="1" time="2.003540435" timestamp="2023-05-13T19:25:33Z" hostname="my-hostname">
  <testcase file="/path/to/project/directory/mlcsim/spec/mlcsim/transcoder_spec.cr" classname="spec.mlcsim.transcoder_spec" 
    name="MLCSim::Transcoder when transcoding encodes a value into cells" time="2.3956e-5" line="5"/>
</testsuite>

Copy link
Member

@straight-shoota straight-shoota left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I have a small suggestion to remove unnecessary escaping.
But I'm fine with or without that change.

src/spec/junit_formatter.cr Outdated Show resolved Hide resolved
Co-authored-by: Johannes Müller <straightshoota@gmail.com>
@straight-shoota straight-shoota added this to the 1.9.0 milestone May 14, 2023
@nobodywasishere
Copy link
Contributor Author

I'm unsure why the CI is failing - I didn't change those files and what I did change (to my knowledge) shouldn't have an effect on it.

@straight-shoota
Copy link
Member

Yeah those tests are flaky. Don't worry about it.

@straight-shoota straight-shoota merged commit bf98a78 into crystal-lang:master May 16, 2023
45 of 46 checks passed
@nobodywasishere nobodywasishere deleted the junit_line_number branch September 25, 2023 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add line number to JUnitFormatter
4 participants