Skip to content

JUnit reporter for GitLab artifact:report:junit - #3177

Merged
PaulTaykalo merged 2 commits into
realm:masterfrom
krin-san:master
Apr 12, 2020
Merged

PaulTaykalo merged 2 commits into
realm:masterfrom
krin-san:master

Conversation

@krin-san

@krin-san krin-san commented Apr 9, 2020

Copy link
Copy Markdown
Contributor

When I found out that GitLab provides a nice representation of JUnit reports and SwiftLint can generate JUnit report, I tried to use that but the result (for 7 failures) looked like that:

Not only it joined 7 issues into 1 because classname & name combination is not unique, but it don't give much details on why and where this issue is.

So I created a new JUnit formatter which would give much better result:

I decided to create a new reporter instead of existing one because JUnit format GitLab supports is not compliant with JUnit format specifications and might break already configured CI set-ups with, for example, Jenkins.

Test file: https://gitlab.com/krin-san/swiftlint-gitlabreporter/-/blob/master/main.swift
JUnit reporter results: https://gitlab.com/krin-san/swiftlint-gitlabreporter/-/merge_requests/2
GitLab reporter results: https://gitlab.com/krin-san/swiftlint-gitlabreporter/-/merge_requests/3


I plan to improve that reporter even more, when GitLab release new update related to junit artifacts. E.g.:

@SwiftLintBot

SwiftLintBot commented Apr 9, 2020 •

Copy link
Copy Markdown
12 Messages
📖 Linting Aerial with this PR took 1.35s vs 1.31s on master (3% slower)
📖 Linting Alamofire with this PR took 2.37s vs 2.3s on master (3% slower)
📖 Linting Firefox with this PR took 8.99s vs 8.95s on master (0% slower)
📖 Linting Kickstarter with this PR took 14.24s vs 14.08s on master (1% slower)
📖 Linting Moya with this PR took 1.35s vs 1.3s on master (3% slower)
📖 Linting Nimble with this PR took 1.32s vs 1.31s on master (0% slower)
📖 Linting Quick with this PR took 0.53s vs 0.53s on master (0% slower)
📖 Linting Realm with this PR took 2.31s vs 2.34s on master (1% faster)
📖 Linting SourceKitten with this PR took 1.0s vs 1.0s on master (0% slower)
📖 Linting Sourcery with this PR took 6.77s vs 6.73s on master (0% slower)
📖 Linting Swift with this PR took 12.63s vs 12.63s on master (0% slower)
📖 Linting WordPress with this PR took 15.19s vs 15.2s on master (0% faster)

Generated by 🚫 Danger

@PaulTaykalo
PaulTaykalo self-requested a review April 12, 2020 14:13
@PaulTaykalo
PaulTaykalo merged commit ef4a37e into realm:master Apr 12, 2020
optionalendeavors added a commit to optionalendeavors/SwiftLint that referenced this pull request Jul 12, 2020
* master: (101 commits)
  JUnit reporter for GitLab artifact:report:junit (realm#3177)
  Add empty changelog section
  release 0.39.2
  Update CI to run jobs with Xcode 11.0 to 11.4 (realm#3168)
  Fix false positives in valid_ibinspectable rule when using Swift 5.2 (realm#3155)
  Fix attributes rule false positive with Swift 5.2 (realm#3154)
  Fix CHANGELOG link
  Fix false positives in redundant_objc_attribute with Swift 5.2 (realm#3152)
  Fix false positives on implicit_getter with Swift 5.2+ (realm#3151)
  Simplify regex (realm#3145)
  fix links about configuration rules (realm#3142)
  Add unused_import config options to require imports for each module used (realm#3123)
  Add empty changelog section
  release 0.39.1
  Temporarily remove all SwiftSyntax rules and support (realm#3107)
  Fix unused_import rule reported locations and corrections (realm#3106)
  release 0.39.0
  Fix false positive in `empty_string` rule with multiline literals (realm#3101)
  Fix PrivateActionRule in Swift 5.2 (realm#3092)
  Fix false positive in implicit_getter with Swift 5.2 (realm#3099)
  ...

# Conflicts:
#	Source/SwiftLintFramework/Extensions/SwiftLintFile+Regex.swift
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