rspec-sonarqube-formatter 1.0.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Gemfile.lock +1 -1
- data/README.md +80 -4
- data/documentation/sonarcloud.png +0 -0
- data/lib/rspec_sonarqube_formatter.rb +1 -1
- data/rspec-sonarqube-formatter.gemspec +1 -1
- metadata +2 -1
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 93972356452ed71c7faa406e7bbf606ecd50f3e132b0e069275b512b31f600b1
         | 
| 4 | 
            +
              data.tar.gz: a93154e5011e94d1d0803600e8b3e1ebad2681e8546d8f75619c193ef11f900c
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 7615b6c9602c81f122a17ca9721eb4fe2ab25d1a36793cfa931d68dc8e99a0eed4b1e0e6c9bc1ed7203037e098fb875e9e7f3503490434e9ce5c208c665e1fa3
         | 
| 7 | 
            +
              data.tar.gz: 0de1ff8fffa56043ee5145981cda0b56e2bf04bd8c319a24e1efcafe9316a62725423f8e44c02b4b7dd852b47df47a0924f505ccc1c9bef4d922c5785ed8ee5a
         | 
    
        data/.gitignore
    CHANGED
    
    
    
        data/Gemfile.lock
    CHANGED
    
    
    
        data/README.md
    CHANGED
    
    | @@ -1,6 +1,7 @@ | |
| 1 1 | 
             
            # RSpec SonarQube Formatter
         | 
| 2 2 |  | 
| 3 | 
            -
             | 
| 3 | 
            +
            [RSpec 3](https://rspec.info/) formatter that generates an XML file for [SonarQube](https://www.sonarqube.org/) 6.2+, using 
         | 
| 4 | 
            +
            the [Generic Test Data](https://docs.sonarqube.org/latest/analysis/generic-test/) format.
         | 
| 4 5 |  | 
| 5 6 | 
             
            [][rubygems]
         | 
| 6 7 | 
             
            [][rubygems]
         | 
| @@ -19,12 +20,87 @@ Rspec formatter to generates an xml file for SonarQube, using the generec-test-d | |
| 19 20 | 
             
            [sonarqube]: https://sonarcloud.io/dashboard?id=otherguy_rspec-sonarqube-formatter
         | 
| 20 21 | 
             
            [license]: https://github.com/otherguy/rspec-sonarqube-formatter/blob/master/LICENSE.md
         | 
| 21 22 |  | 
| 23 | 
            +
            ## Features 🌈
         | 
| 22 24 |  | 
| 23 | 
            -
             | 
| 25 | 
            +
            This formatter generates an XML report that can be read by [SonarQube](https://www.sonarqube.org/) 6.2+. 
         | 
| 26 | 
            +
            Out of the box, SonarQube 6.2+ supports generic formats for test coverage and test execution import. Using the XML file 
         | 
| 27 | 
            +
            generated by this gem, you get an overview of test executions (`passed`, `skipped`, `failed`)
         | 
| 28 | 
            +
            and the time in milliseconds it took to execute these. 
         | 
| 24 29 |  | 
| 30 | 
            +
            [][sonarqube]️
         | 
| 31 | 
            +
             | 
| 32 | 
            +
            ## Installation 🚀
         | 
| 33 | 
            +
             | 
| 34 | 
            +
            Add the gem to your application's `Gemfile`:
         | 
| 35 | 
            +
             | 
| 36 | 
            +
            ```ruby
         | 
| 37 | 
            +
            # RSpec formatters
         | 
| 38 | 
            +
            gem 'rspec-sonarqube-formatter', '~> 1.0', require: false
         | 
| 39 | 
            +
            ```
         | 
| 40 | 
            +
             | 
| 41 | 
            +
            Then, update your bundle:
         | 
| 42 | 
            +
             | 
| 43 | 
            +
                $ bundle install
         | 
| 44 | 
            +
             | 
| 45 | 
            +
            Or install it manually using:
         | 
| 46 | 
            +
             | 
| 47 | 
            +
                $ gem install rspec-sonarqube-formatter
         | 
| 48 | 
            +
             | 
| 49 | 
            +
             | 
| 50 | 
            +
            ## Usage 🛠
         | 
| 51 | 
            +
             | 
| 52 | 
            +
            Add the following code to your `spec_helper.rb`:
         | 
| 53 | 
            +
             | 
| 54 | 
            +
            ```ruby
         | 
| 55 | 
            +
            RSpec.configure do |c|
         | 
| 56 | 
            +
              c.formatter = 'documentation'
         | 
| 57 | 
            +
              c.add_formatter('RspecSonarqubeFormatter', 'out/test-report.xml')
         | 
| 58 | 
            +
              ...
         | 
| 59 | 
            +
            end
         | 
| 60 | 
            +
            ```
         | 
| 61 | 
            +
             | 
| 62 | 
            +
            Alternatively, edit your `.rspec` file to define your formatters there:
         | 
| 63 | 
            +
             | 
| 64 | 
            +
            ```bash
         | 
| 65 | 
            +
            # .rspec
         | 
| 66 | 
            +
            --require spec_helper
         | 
| 67 | 
            +
            --color
         | 
| 68 | 
            +
            --format RspecSonarqubeFormatter
         | 
| 69 | 
            +
            --out out/test-report.xml
         | 
| 70 | 
            +
            --format documentation
         | 
| 71 | 
            +
            ```
         | 
| 72 | 
            +
             | 
| 73 | 
            +
            To make SonarQube read the test report, specify the path to the generated XML in your 
         | 
| 74 | 
            +
            [`sonar-project.properties`](sonar-project.properties) or configure it in the SonarQube GUI. 
         | 
| 75 | 
            +
             | 
| 76 | 
            +
            ```bash
         | 
| 77 | 
            +
            # sonar-project.properties
         | 
| 78 | 
            +
            sonar.testExecutionReportPaths=out/test-report.xml
         | 
| 79 | 
            +
            ```
         | 
| 80 | 
            +
             | 
| 81 | 
            +
            ## Inspiration 💅
         | 
| 82 | 
            +
             | 
| 83 | 
            +
            The only [existing formatter](https://github.com/witjoh/rspec_sonar_formatter) does not work out of the box and is not
         | 
| 84 | 
            +
            published to [RubyGems.org](https://rubygems.org/gems/rspec-sonarqube-formatter), so I created my own.
         | 
| 85 | 
            +
             | 
| 86 | 
            +
            Thank you to [`@witjoh`](https://github.com/witjoh) for the original work ♥️!
         | 
| 87 | 
            +
             | 
| 88 | 
            +
             | 
| 89 | 
            +
            ## Contributing 🚧
         | 
| 90 | 
            +
             | 
| 91 | 
            +
            Bug reports and pull requests are welcome on GitHub at [`otherguy/rspec-sonarqube-formatter`](https://github.com/otherguy/rspec-sonarqube-formatter).
         | 
| 92 | 
            +
             | 
| 93 | 
            +
            After checking out the repository, you need to install dependencies:
         | 
| 94 | 
            +
             | 
| 95 | 
            +
            ```bash
         | 
| 25 96 | 
             
            gem install bundler -v 2.0.2
         | 
| 26 97 | 
             
            bundle install
         | 
| 98 | 
            +
            ```
         | 
| 99 | 
            +
             | 
| 100 | 
            +
            Then, run `bundle exec rake spec` to run the test suite. 
         | 
| 101 | 
            +
             | 
| 102 | 
            +
            To install this gem on your local machine, run `bundle exec rake install`.
         | 
| 27 103 |  | 
| 104 | 
            +
            Please check your contributions with RuboCop by running `bundle exec rubocop`. 
         | 
| 28 105 |  | 
| 29 | 
            -
             | 
| 30 | 
            -
            bundle exec rake spec
         | 
| 106 | 
            +
            Releases are built from tags automatically on [Travis][travis] and pushed to [RubyGems.org][rubygems].
         | 
| Binary file | 
| @@ -7,7 +7,7 @@ Gem::Specification.new do |spec| | |
| 7 7 | 
             
              spec.name          = 'rspec-sonarqube-formatter'
         | 
| 8 8 |  | 
| 9 9 | 
             
              # rubocop:disable Gemspec/DuplicatedAssignment
         | 
| 10 | 
            -
              spec.version       = '1.0.0- | 
| 10 | 
            +
              spec.version       = '1.0.0-local'
         | 
| 11 11 | 
             
              spec.version       = ENV.fetch('TRAVIS_TAG') { spec.version }.to_s if ENV['TRAVIS']
         | 
| 12 12 | 
             
              # rubocop:enable Gemspec/DuplicatedAssignment
         | 
| 13 13 |  | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: rspec-sonarqube-formatter
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 1.0 | 
| 4 | 
            +
              version: 1.1.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Alexander Graf
         | 
| @@ -132,6 +132,7 @@ files: | |
| 132 132 | 
             
            - LICENSE.md
         | 
| 133 133 | 
             
            - README.md
         | 
| 134 134 | 
             
            - Rakefile
         | 
| 135 | 
            +
            - documentation/sonarcloud.png
         | 
| 135 136 | 
             
            - lib/rspec_sonarqube_formatter.rb
         | 
| 136 137 | 
             
            - rspec-sonarqube-formatter.gemspec
         | 
| 137 138 | 
             
            - sonar-project.properties
         |