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

SonarQube Generic Execution Test Data reporter #1738

Closed

Conversation

sp-dani-garcia
Copy link
Contributor

Added a SonarQube reporter that creates Generic Execution Test Data reports

For more information check the following documentation:

@horenmar
Copy link
Member

horenmar commented Sep 6, 2019

Nice PR, lacking just a simple changes to approval script for normalization across platforms. As it turns out, I cannot push to your PR branch, so this is the diff

diff --git a/scripts/approvalTests.py b/scripts/approvalTests.py
index 148832f..dad2a96 100755
--- a/scripts/approvalTests.py
+++ b/scripts/approvalTests.py
@@ -29,6 +29,7 @@ filelocParser = re.compile(r'''
 lineNumberParser = re.compile(r' line="[0-9]*"')
 hexParser = re.compile(r'\b(0[xX][0-9a-fA-F]+)\b')
 durationsParser = re.compile(r' time="[0-9]*\.[0-9]*"')
+sonarqubeDurationParser = re.compile(r' duration="[0-9]+"')
 timestampsParser = re.compile(r'\d{4}-\d{2}-\d{2}T\d{2}\:\d{2}\:\d{2}Z')
 versionParser = re.compile(r'Catch v[0-9]+\.[0-9]+\.[0-9]+(-develop\.[0-9]+)?')
 nullParser = re.compile(r'\b(__null|nullptr)\b')
@@ -138,6 +139,7 @@ def filterLine(line, isCompact):
 
     # strip durations and timestamps
     line = durationsParser.sub(' time="{duration}"', line)
+    line = sonarqubeDurationParser.sub(' duration="{duration}"', line)
     line = timestampsParser.sub('{iso8601-timestamp}', line)
     line = specialCaseParser.sub('file:\g<1>', line)
     line = errnoParser.sub('errno', line)

@codecov
Copy link

codecov bot commented Sep 9, 2019

Codecov Report

Merging #1738 into master will decrease coverage by 2.15%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #1738      +/-   ##
==========================================
- Coverage   87.03%   84.88%   -2.15%     
==========================================
  Files         136      129       -7     
  Lines        5275     3744    -1531     
==========================================
- Hits         4591     3178    -1413     
+ Misses        684      566     -118

1 similar comment
@codecov
Copy link

codecov bot commented Sep 9, 2019

Codecov Report

Merging #1738 into master will decrease coverage by 2.15%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #1738      +/-   ##
==========================================
- Coverage   87.03%   84.88%   -2.15%     
==========================================
  Files         136      129       -7     
  Lines        5275     3744    -1531     
==========================================
- Hits         4591     3178    -1413     
+ Misses        684      566     -118

@sp-dani-garcia
Copy link
Contributor Author

@horenmar done!

Thank you.

@JoeyGrajciar
Copy link
Contributor

@sp-dani-garcia is the xml output accepted by SonarQube? I see that in strings there is < escaped but > is not escaped.

@sp-dani-garcia
Copy link
Contributor Author

@JoeyGrajciar yes. We have been using this output with SonarQube in our CI for almost a year now with no issues. Could you give an example please? The code was based in the JUnit reporter and I don't see any special treatment there.

@horenmar horenmar closed this in 51b29ce Oct 27, 2019
@horenmar
Copy link
Member

I ended up cherry-picking the commits manually to fix the merge conflict.

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