Skip to content

Commit

Permalink
Merge pull request #23 from yast/docker-SLE-12-SP2
Browse files Browse the repository at this point in the history
add docker to sle12sp2
  • Loading branch information
jreidinger committed Aug 10, 2017
2 parents d7e3019 + 2fb1461 commit e3f8224
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 14 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -23,3 +23,6 @@ mkinstalldirs
stamp-h*
*.pot
*.ami
/coverage
/.yardoc
/doc
23 changes: 12 additions & 11 deletions .travis.yml
@@ -1,13 +1,14 @@
language: cpp
compiler:
- gcc
sudo: required
language: bash
services:
- docker

before_install:
# disable rvm, use system Ruby
- rvm reset
- wget https://raw.githubusercontent.com/yast/yast-devtools/SLE-12-GA/travis-tools/travis_setup.sh
- sh ./travis_setup.sh -p "rake yast2-devtools yast2-testsuite yast2 yast2-bootloader yast2-storage" -g "yast-rake gettext rspec:3.3.0 simplecov coveralls"
- docker build -t yast-tune-image .
# list the installed packages (just for easier debugging)
- docker run --rm -it yast-tune-image rpm -qa | sort

script:
- rake check:syntax
- rake check:pot
- COVERAGE=1 rake test:unit
- sudo rake install
# the "yast-travis-ruby" script is included in the base yastdevel/ruby image
# see https://github.com/yast/docker-yast-ruby/blob/master/yast-travis-ruby
- docker run -it -e TRAVIS=1 -e TRAVIS_JOB_ID="$TRAVIS_JOB_ID" yast-tune-image yast-travis-ruby
3 changes: 3 additions & 0 deletions Dockerfile
@@ -0,0 +1,3 @@
FROM yastdevel/ruby:sle12-sp2
COPY . /usr/src/app

5 changes: 4 additions & 1 deletion test/system_settings_test.rb
Expand Up @@ -9,9 +9,13 @@
KERNEL_SYSRQ_FILE = "/proc/sys/kernel/sysrq"

subject(:settings) { Yast::SystemSettings }
let(:scheduler) { "cfq" }

before do
allow(File).to receive(:exist?).and_return(true)
allow(Yast::Bootloader).to receive(:Read)
allow(Yast::Bootloader).to receive(:kernel_param)
.with(:common, "elevator").and_return(scheduler)
settings.main
end

Expand All @@ -24,7 +28,6 @@
describe "#Read" do
let(:kernel_sysrq) { "1" }
let(:sysctl_sysrq) { "1" }
let(:scheduler) { "cfq" }

before do
allow(Yast::SCR).to receive(:Read).and_call_original
Expand Down
4 changes: 2 additions & 2 deletions test/test_helper.rb
Expand Up @@ -8,9 +8,9 @@
add_filter "/spec/"
end

# for coverage we need to load all ruby files
src_location = File.expand_path("../../src", __FILE__)
Dir["#{src_location}/{modules,lib}/**/*.rb"].each { |f| require_relative f }
# track all ruby files under src
SimpleCov.track_files("#{src_location}/**/*.rb")

# use coveralls for on-line code coverage reporting at Travis CI
if ENV["TRAVIS"]
Expand Down

0 comments on commit e3f8224

Please sign in to comment.