Skip to content

Commit

Permalink
Enabled CodeCoverage support
Browse files Browse the repository at this point in the history
  • Loading branch information
mchf authored and mvidner committed Jul 1, 2015
1 parent f424947 commit 4f6820f
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
1 change: 1 addition & 0 deletions .coveralls.yml
@@ -0,0 +1 @@
service_name: travis-ci
4 changes: 2 additions & 2 deletions .travis.yml
Expand Up @@ -5,13 +5,13 @@ before_install:
# disable rvm, use system Ruby
- rvm reset
- wget https://raw.githubusercontent.com/yast/yast-devtools/master/travis-tools/travis_setup.sh
- sh ./travis_setup.sh -p "rake yast2-devtools yast2-testsuite yast2 yast2-storage yast2-proxy yast2-country yast2-packager" -g "rspec:2.14.1 yast-rake gettext rubocop:0.29.1"
- sh ./travis_setup.sh -p "rake yast2-devtools yast2-testsuite yast2 yast2-storage yast2-proxy yast2-country yast2-packager" -g "rspec:2.14.1 yast-rake gettext rubocop:0.29.1 simplecov coveralls"
script:
- rubocop
- rake check:syntax
- rake check:pot
- COVERAGE=1 rake test:unit
- make -f Makefile.cvs
- make
- sudo make install
- make check

1 change: 1 addition & 0 deletions README.md
Expand Up @@ -4,6 +4,7 @@ YaST Network Module
[![Travis Build](https://travis-ci.org/yast/yast-network.svg?branch=master)](https://travis-ci.org/yast/yast-network)
[![Jenkins Build](http://img.shields.io/jenkins/s/https/ci.opensuse.org/yast-network-master.svg)](https://ci.opensuse.org/view/Yast/job/yast-network-master/)
[![Code Climate](https://codeclimate.com/github/yast/yast-network/badges/gpa.svg)](https://codeclimate.com/github/yast/yast-network)
[![Coverage Status](https://coveralls.io/repos/yast/yast-network/badge.png)](https://coveralls.io/r/yast/yast-network)

The YaST2 Network module manages network configuration including device configuration,
DNS, Routing and more
Expand Down
22 changes: 22 additions & 0 deletions test/test_helper.rb
@@ -1,3 +1,25 @@
srcdir = File.expand_path("../../src", __FILE__)
y2dirs = ENV.fetch("Y2DIR", "").split(":")
ENV["Y2DIR"] = y2dirs.unshift(srcdir).join(":")

require "yast"

if ENV["COVERAGE"]
require "simplecov"
SimpleCov.start

# For coverage we need to load all ruby files
# Note that clients/ are excluded because they run too eagerly by design
Dir["#{srcdir}/{include,modules}/**/*.rb"].each do |f|
require_relative f
end

# use coveralls for on-line code coverage reporting at Travis CI
if ENV["TRAVIS"]
require "coveralls"
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
SimpleCov::Formatter::HTMLFormatter,
Coveralls::SimpleCov::Formatter
]
end
end

0 comments on commit 4f6820f

Please sign in to comment.