New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

rspec-sonarqube-formatter

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rspec-sonarqube-formatter

  • 1.6.3
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

RSpec SonarQube Formatter

RSpec 3 formatter that generates an XML file for SonarQube and SonarCloud️, using the Generic Test Data format.

Gem Version Gem Downloads GitHub issues License Codecov Sonar Tests Sonar Quality Gate Violations Code Climate maintainability

Features 🌈

This formatter generates an XML report that can be read by SonarQube and SonarCloud️.

Out of the box, SonarQube 6.2+ and SonarCloud support generic formats for test coverage and test execution import. Using the XML file generated by this gem, you get an overview of test executions (passed, skipped, failed) and the time in milliseconds it took to execute these.

Sonarcloud.io

Installation 🚀

Add the gem to your application's Gemfile:

# RSpec formatters
gem 'rspec-sonarqube-formatter', '~> 1.6', require: false

Then, update your bundle:

$ bundle install

Or install it manually using:

$ gem install rspec-sonarqube-formatter

Usage 🛠

Add the following code to your spec_helper.rb:

RSpec.configure do |c|
  c.formatter = 'documentation'
  c.add_formatter('RspecSonarqubeFormatter', 'out/test-report.xml')
  ...
end

Alternatively, edit your .rspec file to define your formatters there:

# .rspec
--require spec_helper
--color
--format RspecSonarqubeFormatter
--out out/test-report.xml
--format documentation

To make SonarQube read the test report, specify the path to the generated XML in your sonar-project.properties or configure it in the SonarQube GUI.

# sonar-project.properties
sonar.testExecutionReportPaths=out/test-report.xml

Inspiration 💅

The only existing formatter does not work out of the box and is not published to RubyGems.org, so I created my own.

Thank you to @witjoh for the original work ♥️!

Contributing 🚧

Bug reports and pull requests are welcome on GitHub at otherguy/rspec-sonarqube-formatter.

After checking out the repository, you need to install dependencies:

gem install bundler
bundle install

Then, run bundle exec rake spec to run the test suite.

To install this gem on your local machine, run bundle exec rake install.

Please check your contributions with RuboCop by running bundle exec rubocop.

Releases are built from tags automatically and pushed to RubyGems.org.

FAQs

Package last updated on 13 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc