From b1d5091670a96f815fc51ae6dc3a88b17f7864ad Mon Sep 17 00:00:00 2001 From: Miah Johnson Date: Fri, 26 Apr 2019 13:05:53 -0700 Subject: [PATCH] Add Coveralls.io support to InSpec Tie coveralls into simplecov formatters Add coveralls badge to README Signed-off-by: Miah Johnson --- Gemfile | 1 + README.md | 1 + test/helper.rb | 10 ++++++++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index ada08962c..bbf77f063 100644 --- a/Gemfile +++ b/Gemfile @@ -13,6 +13,7 @@ group :omnibus do end group :test do + gem 'coveralls', require: false gem 'minitest', '~> 5.5' gem 'rake', '>= 10' gem 'rubocop', '= 0.49.1' diff --git a/README.md b/README.md index 2746afd69..8614aad5d 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [![Slack](https://community-slack.chef.io/badge.svg)](https://community-slack.chef.io/) [![Build Status Master](https://travis-ci.org/inspec/inspec.svg?branch=master)](https://travis-ci.org/inspec/inspec) [![Build Status Master](https://ci.appveyor.com/api/projects/status/github/inspec/inspec?branch=master&svg=true&passingText=master%20-%20Ok&pendingText=master%20-%20Pending&failingText=master%20-%20Failing)](https://ci.appveyor.com/project/Chef/inspec/branch/master) +[![Coverage Status](https://coveralls.io/repos/github/inspec/inspec/badge.svg?branch=master)](https://coveralls.io/github/inspec/inspec?branch=master) InSpec is an open-source testing framework for infrastructure with a human- and machine-readable language for specifying compliance, security and policy requirements. diff --git a/test/helper.rb b/test/helper.rb index 729e682ae..6c32d6ca9 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -1,7 +1,13 @@ # encoding: utf-8 -# author: Dominik Richter -# author: Christoph Hartmann + require 'simplecov' +require 'coveralls' + +SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new([ + SimpleCov::Formatter::HTMLFormatter, + Coveralls::SimpleCov::Formatter +]) + SimpleCov.start do add_filter '/test/' add_group 'Resources', 'lib/resources'