Skip to content

Commit

Permalink
Build fix for the latest core/ruby-bindings, use Docker at Travis (#277)
Browse files Browse the repository at this point in the history
* Mock missing YaST modules

* Debugging - remove this commit

* Use Docker at Travis

* fix last failed test

* Changes

- 3.2.6
  • Loading branch information
lslezak committed Jan 5, 2017
1 parent d69e73c commit d8c4397
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 27 deletions.
26 changes: 10 additions & 16 deletions .travis.yml
@@ -1,18 +1,12 @@
language: cpp
compiler:
- gcc
sudo: required
language: ruby
services:
- docker

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-xml yast2-transfer yast2-services-manager yast2-installation yast2-installation-control yast2-packager yast2-slp trang" -g "rspec:3.3.0 yast-rake gettext cheetah"
- docker build -t yast-autoyast-image .
script:
- rake check:syntax
- rake check:pot
- rake test:unit
- make -f Makefile.cvs
- make
- sudo make install
- make check
- ./check_schema.sh

# the "yast-travis" script is included in the base yastdevel/ruby-tw image
# see https://github.com/yast/docker-yast-ruby-tw/blob/master/yast-travis
- docker run -it -e TRAVIS_JOB_ID="$TRAVIS_JOB_ID" yast-autoyast-image yast-travis
- docker run -it yast-autoyast-image ./check_schema.sh
7 changes: 7 additions & 0 deletions Dockerfile
@@ -0,0 +1,7 @@
FROM yastdevel/ruby-tw
COPY . /tmp/sources
RUN zypper --gpg-auto-import-keys --non-interactive in --no-recommends \
trang \
libxml2-tools \
libxslt-tools

7 changes: 7 additions & 0 deletions package/autoyast2.changes
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Thu Jan 5 13:56:23 UTC 2017 - lslezak@suse.cz

- Fixed tests to pass with the latest yast2-core and
yast2-ruby-bindings packages (related to the bsc#932331 fix)
- 3.2.6

-------------------------------------------------------------------
Wed Dec 14 15:32:06 CET 2016 - schubi@suse.de

Expand Down
2 changes: 1 addition & 1 deletion package/autoyast2.spec
Expand Up @@ -17,7 +17,7 @@


Name: autoyast2
Version: 3.2.5
Version: 3.2.6
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
10 changes: 0 additions & 10 deletions test/AutoinstPartPlan_test.rb
Expand Up @@ -10,16 +10,6 @@
describe Yast::AutoinstPartPlan do
let(:target_map_path) { File.join(FIXTURES_PATH, "storage", "nfs_root.yml") }
let(:target_map_clone) { File.join(FIXTURES_PATH, "storage", "target_clone.yml") }
let(:default_subvol) { "@" }
let(:filesystems) do
double("filesystems",
default_subvol: default_subvol, read_default_subvol_from_target: default_subvol)
end

before do
allow(Yast).to receive(:import).with("FileSystems").and_return(nil)
stub_const("Yast::FileSystems", filesystems)
end

describe "#read partition target" do

Expand Down
36 changes: 36 additions & 0 deletions test/test_helper.rb
Expand Up @@ -11,3 +11,39 @@
end

FIXTURES_PATH = File.join(File.dirname(__FILE__), 'fixtures')

# mock missing YaST modules, they are needed by an early import call
module Yast
class FileSystemsClass
def default_subvol
"@"
end

def read_default_subvol_from_target
"@"
end

def default_subvol_from_product
"@"
end

def GetAllFileSystems(_add_swap, _add_pseudo, _label)
{}
end
end
FileSystems = FileSystemsClass.new

class KeyboardClass
def dummy
true
end
end
Keyboard = KeyboardClass.new

class TimezoneClass
def dummy
true
end
end
Timezone = TimezoneClass.new
end

0 comments on commit d8c4397

Please sign in to comment.