0

This branch has been created in order to get code coverage using Coveralls:

.coveralls.yml

service_name: travis-ci

spec/spec_helper.rb

require 'coveralls'

Coveralls.wear! do
  add_filter '/spec/fixtures/modules/otto/'
end

A code coverage report is created, but the .pp files seems to be excluded. How to get code coverage using Coveralls?

030
  • 10,842
  • 12
  • 78
  • 123
  • Are you using puppetlabs spec helper? – Matthew Schuchard Jul 06 '16 at 01:24
  • @MattSchuchard [Yes](https://github.com/030/puppet-otto/compare/gh6_code_coverage_coveralls?expand=1#diff-93830fa29d616f7c87903d08b5b1b29aR2). The code coverage is shown when `rspec-puppet` is run, but coveralls seems to run another command. – 030 Jul 06 '16 at 08:17
  • So I haven't really done this before, but I notice you are deviating a good bit from the documentation in puppetlabs spec helper and rspec puppet for how to do this. Is there a reason for that? – Matthew Schuchard Jul 06 '16 at 13:35
  • @MattSchuchard That seems to be changed indeed. I have changed the snippet (see branch), but the issue persists – 030 Jul 11 '16 at 18:00
  • Your Rakefile seems to be missing a `suite` task unless I am mistaken. The direct copy/paste from the RSpec Puppet doc is expecting that task to be executed before performing the manifest code coverage. – Matthew Schuchard Jul 11 '16 at 18:07

0 Answers0