Test specs against more rubies
* Make chef version customisable through ENV
* Add specs on different versions of ruby
The unit test use the latest chef version compatible with the given ruby version. Had to fix some dependencies to make it work.
MODIFY
.circleci/config.yml
.circleci/config.yml
version: 2
jobs:
- test:
+ full-suite:
machine: true
environment:
KITCHEN_LOCAL_YAML: kitchen.docker.yml
steps:
- checkout
- run:
- name: Set Ruby version to 2.5.1
+ name: Set Ruby version to 2.6.3
command: |
- rvm install 2.5.1
- echo . $(rvm 2.5.1 do rvm env --path) >> $BASH_ENV
+ rvm install 2.6.3
+ echo . $(rvm 2.6.3 do rvm env --path) >> $BASH_ENV
- run:
name: Install bundler
command: gem install bundler:1.17.3
@@ -19,7 +19,7 @@ jobs:
command: bundle --version
- run:
name: Install dependencies with bundler
- command: bundle install --path .bundle --without release
+ command: bundle install --path .bundle
- run:
name: Showing gems versions in bundle
command: bundle list
@@ -31,8 +31,65 @@ jobs:
command: bundle exec rake circle
no_output_timeout: 900
+ specs-ruby2.6.3-chef14.10.9: &specs
+ machine: true
+ environment:
+ KITCHEN_LOCAL_YAML: kitchen.docker.yml
+ CHEF_VERSION: '14.10.9'
+ RUBY_VERSION: '2.6.3'
+ steps:
+ - checkout
+ - run:
+ name: Set Ruby version
+ command: |
+ echo "Using $RUBY_VERSION"
+ rvm install $RUBY_VERSION
+ echo . $(rvm $RUBY_VERSION do rvm env --path) >> $BASH_ENV
+ - run:
+ name: Install bundler
+ command: gem install bundler:1.17.3
+ - run:
+ name: Check bundler version
+ command: bundle --version
+ - run:
+ name: Install dependencies with bundler without Gemfile.lock
+ command: |
+ rm Gemfile.lock
+ bundle install --path .bundle
+ - run:
+ name: Showing gems versions in bundle
+ command: bundle list
+ - run:
+ name: Run specs
+ command: bundle exec rake spec
+
+ specs-ruby2.5.1-chef14.10.9:
+ <<: *specs
+ environment:
+ KITCHEN_LOCAL_YAML: kitchen.docker.yml
+ CHEF_VERSION: '14.10.9'
+ RUBY_VERSION: '2.5.1'
+
+ specs-ruby2.4.3-chef13.12.14:
+ <<: *specs
+ environment:
+ KITCHEN_LOCAL_YAML: kitchen.docker.yml
+ CHEF_VERSION: '13.12.14'
+ RUBY_VERSION: '2.4.3'
+
+ specs-ruby2.3.6-chef13.12.14:
+ <<: *specs
+ environment:
+ KITCHEN_LOCAL_YAML: kitchen.docker.yml
+ CHEF_VERSION: '13.12.14'
+ RUBY_VERSION: '2.3.6'
+
workflows:
version: 2
build_and_test:
jobs:
- - test
+ - specs-ruby2.6.3-chef14.10.9
+ - specs-ruby2.5.1-chef14.10.9
+ - specs-ruby2.4.3-chef13.12.14
+ - specs-ruby2.3.6-chef13.12.14
+ - full-suite

MODIFY
Gemfile
Gemfile
source 'https://rubygems.org'
+chef_version = ENV.fetch('CHEF_VERSION', '14.10.9')
+
gem 'rake'
-gem 'chef', '= 14.10.9'
+gem 'chef', "= #{chef_version}"
gem 'foodcritic', '~> 11.4.0'
gem 'cucumber-core', '~> 3.2.1'
gem 'chefspec'
+gem 'berkshelf'
+gem 'fauxhai-ng', '~> 7.5.1'
gem 'cookstyle'
gem 'coveralls', '~> 0.8.19'
gem 'test-kitchen'
gem 'json_spec', '~> 1.1.4'
gem 'kitchen-vagrant'
gem 'kitchen-docker', '~> 2.3.0'
-gem 'berkshelf', '~> 6.3'
+
gem 'rubocop', '~> 0.49.1'

MODIFY
Gemfile.lock
Gemfile.lock
@@ -4,38 +4,22 @@ GEM
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
ast (2.4.0)
- backports (3.15.0)
+ backports (3.17.0)
bcrypt_pbkdf (1.0.1)
- berkshelf (6.3.1)
- buff-config (~> 2.0)
- buff-extensions (~> 2.0)
- chef (>= 12.7.2)
+ berkshelf (7.0.9)
+ chef (>= 13.6.52)
+ chef-config
cleanroom (~> 1.0)
concurrent-ruby (~> 1.0)
- faraday (~> 0.9)
- httpclient (~> 2.7)
- minitar (~> 0.5, >= 0.5.4)
- mixlib-archive (~> 0.4)
- mixlib-shellout (~> 2.0)
+ minitar (>= 0.6)
+ mixlib-archive (>= 0.4, < 2.0)
+ mixlib-config (>= 2.2.5)
+ mixlib-shellout (>= 2.0, < 4.0)
octokit (~> 4.0)
- retryable (~> 2.0)
- ridley (~> 5.0)
+ retryable (>= 2.0, < 4.0)
solve (~> 4.0)
- thor (~> 0.19, < 0.19.2)
- buff-config (2.0.0)
- buff-extensions (~> 2.0)
- varia_model (~> 0.6)
- buff-extensions (2.0.0)
- buff-ignore (1.2.0)
- buff-ruby_engine (1.0.0)
- buff-shell_out (1.1.0)
- buff-ruby_engine (~> 1.0)
+ thor (>= 0.20)
builder (3.2.4)
- celluloid (0.16.0)
- timers (~> 4.0.0)
- celluloid-io (0.16.2)
- celluloid (>= 0.16.0)
- nio4r (>= 1.1.0)
chef (14.10.9)
addressable
bundler (>= 1.10)
@@ -84,28 +68,28 @@ GEM
mixlib-config (>= 2.2.12, < 3.0)
mixlib-shellout (~> 2.0)
tomlrb (~> 1.2)
- chef-zero (14.0.13)
+ chef-zero (15.0.0)
ffi-yajl (~> 2.2)
- hashie (>= 2.0, < 4.0)
+ hashie (>= 2.0, < 5.0)
mixlib-log (>= 2.0, < 4.0)
rack (~> 2.0, >= 2.0.6)
uuidtools (~> 2.1)
- chefspec (9.0.0)
+ chefspec (9.1.0)
chef (>= 14)
chef-cli
fauxhai-ng (>= 7.5)
rspec (~> 3.0)
cleanroom (1.0.0)
- concurrent-ruby (1.1.5)
- cookbook-omnifetch (0.9.0)
+ concurrent-ruby (1.1.6)
+ cookbook-omnifetch (0.9.1)
mixlib-archive (>= 0.4, < 2.0)
cookstyle (2.1.0)
rubocop (= 0.49.1)
- coveralls (0.8.19)
+ coveralls (0.8.23)
json (>= 1.8, < 3)
- simplecov (~> 0.12.0)
+ simplecov (~> 0.16.1)
term-ansicolor (~> 1.3)
- thor (~> 0.19.1)
+ thor (>= 0.19.4, < 2.0)
tins (~> 1.6)
cucumber-core (3.2.1)
backports (>= 3.8.0)
@@ -113,17 +97,17 @@ GEM
gherkin (~> 5.0)
cucumber-tag_expressions (1.1.1)
diff-lcs (1.3)
- docile (1.1.5)
+ docile (1.3.2)
ed25519 (1.2.4)
equatable (0.6.1)
erubi (1.9.0)
erubis (2.7.0)
- faraday (0.17.1)
+ faraday (1.0.0)
multipart-post (>= 1.2, < 3)
fauxhai-ng (7.5.1)
net-ssh
- ffi (1.11.3)
- ffi-yajl (2.3.1)
+ ffi (1.12.2)
+ ffi-yajl (2.3.3)
libyajl2 (~> 1.2)
foodcritic (11.4.0)
cucumber-core (>= 1.3)
@@ -139,11 +123,10 @@ GEM
ffi (>= 1.0.1)
gyoku (1.3.1)
builder (>= 2.1.2)
- hashie (3.6.0)
+ hashie (4.1.0)
highline (1.7.10)
- hitimes (2.0.0)
httpclient (2.8.3)
- iniparse (1.4.4)
+ iniparse (1.5.0)
ipaddress (0.8.3)
json (2.3.0)
json_spec (1.1.5)
@@ -151,7 +134,7 @@ GEM
rspec (>= 2.0, < 4.0)
kitchen-docker (2.3.0)
test-kitchen (>= 1.0.0)
- kitchen-vagrant (1.6.0)
+ kitchen-vagrant (1.6.1)
test-kitchen (>= 1.4, < 3)
libyajl2 (1.2.0)
license-acceptance (1.0.13)
@@ -165,19 +148,19 @@ GEM
multi_json (~> 1.10)
mini_portile2 (2.4.0)
minitar (0.9)
- mixlib-archive (0.4.20)
+ mixlib-archive (1.0.5)
mixlib-log
mixlib-authentication (2.1.1)
mixlib-cli (1.7.0)
mixlib-config (2.2.18)
tomlrb
- mixlib-install (3.11.24)
+ mixlib-install (3.11.29)
mixlib-shellout
mixlib-versioning
thor
mixlib-log (2.0.9)
mixlib-shellout (2.4.4)
- mixlib-versioning (1.2.7)
+ mixlib-versioning (1.2.12)
molinillo (0.6.6)
multi_json (1.14.1)
multipart-post (2.1.1)
@@ -193,11 +176,11 @@ GEM
net-ssh (>= 2.6.5)
net-ssh-gateway (>= 1.2.0)
net-telnet (0.1.1)
- nio4r (2.5.2)
- nokogiri (1.10.8)
+ nokogiri (1.10.9)
mini_portile2 (~> 2.4.0)
nori (2.6.0)
- octokit (4.14.0)
+ octokit (4.17.0)
+ faraday (>= 0.9)
sawyer (~> 0.8.0, >= 0.5.3)
ohai (14.14.0)
chef-config (>= 12.8, < 15)
@@ -213,7 +196,7 @@ GEM
wmi-lite (~> 1.0)
paint (1.0.1)
parallel (1.19.1)
- parser (2.7.0.0)
+ parser (2.7.0.4)
ast (~> 2.4.0)
pastel (0.7.3)
equatable (~> 0.6)
@@ -223,45 +206,27 @@ GEM
powerpack (0.1.2)
proxifier (1.0.3)
public_suffix (3.1.1)
- rack (2.0.8)
+ rack (2.2.2)
rainbow (2.2.2)
rake
rake (13.0.1)
- retryable (2.0.4)
- ridley (5.1.1)
- addressable
- buff-config (~> 2.0)
- buff-extensions (~> 2.0)
- buff-ignore (~> 1.2)
- buff-shell_out (~> 1.0)
- celluloid (~> 0.16.0)
- celluloid-io (~> 0.16.1)
- chef-config (>= 12.5.0)
- erubis
- faraday (~> 0.9)
- hashie (>= 2.0.2, < 4.0.0)
- httpclient (~> 2.7)
- json (>= 1.7.7)
- mixlib-authentication (>= 1.3.0)
- retryable (~> 2.0)
- semverse (~> 2.0)
- varia_model (~> 0.6)
+ retryable (3.0.5)
rspec (3.9.0)
rspec-core (~> 3.9.0)
rspec-expectations (~> 3.9.0)
rspec-mocks (~> 3.9.0)
- rspec-core (3.9.0)
- rspec-support (~> 3.9.0)
+ rspec-core (3.9.1)
+ rspec-support (~> 3.9.1)
rspec-expectations (3.9.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0)
rspec-its (1.3.0)
rspec-core (>= 3.0.0)
rspec-expectations (>= 3.0.0)
- rspec-mocks (3.9.0)
+ rspec-mocks (3.9.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0)
- rspec-support (3.9.0)
+ rspec-support (3.9.2)
rspec_junit_formatter (0.2.3)
builder (< 4)
rspec-core (>= 2, < 4, != 2.12.0)
@@ -274,27 +239,27 @@ GEM
unicode-display_width (~> 1.0, >= 1.0.1)
ruby-progressbar (1.10.1)
rubyntlm (0.6.2)
- rubyzip (2.0.0)
+ rubyzip (2.2.0)
rufus-lru (1.1.0)
sawyer (0.8.2)
addressable (>= 2.3.5)
faraday (> 0.8, < 2.0)
- semverse (2.0.0)
+ semverse (3.0.0)
serverspec (2.41.5)
multi_json
rspec (~> 3.0)
rspec-its
specinfra (~> 2.72)
sfl (2.3)
- simplecov (0.12.0)
- docile (~> 1.1.0)
+ simplecov (0.16.1)
+ docile (~> 1.1)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
- solve (4.0.2)
+ solve (4.0.3)
molinillo (~> 0.6)
semverse (>= 1.1, < 4.0)
- specinfra (2.82.4)
+ specinfra (2.82.12)
net-scp
net-ssh (>= 2.7)
net-telnet (= 0.1.1)
@@ -304,11 +269,12 @@ GEM
unicode-display_width (~> 1.5)
unicode_utils (~> 1.4)
strings-ansi (0.2.0)
+ sync (0.5.0)
syslog-logger (1.6.8)
systemu (2.6.5)
term-ansicolor (1.7.1)
tins (~> 1.0)
- test-kitchen (2.3.4)
+ test-kitchen (2.4.0)
bcrypt_pbkdf (~> 1.0)
ed25519 (~> 1.2)
license-acceptance (~> 1.0, >= 1.0.11)
@@ -321,10 +287,9 @@ GEM
winrm (~> 2.0)
winrm-elevated (~> 1.0)
winrm-fs (~> 1.1)
- thor (0.19.1)
- timers (4.0.4)
- hitimes
- tins (1.22.2)
+ thor (0.20.3)
+ tins (1.24.1)
+ sync
tomlrb (1.2.9)
treetop (1.6.10)
polyglot (~> 0.3)
@@ -332,9 +297,9 @@ GEM
pastel (~> 0.7.2)
strings (~> 0.1.6)
tty-cursor (~> 0.7)
- tty-color (0.5.0)
- tty-cursor (0.7.0)
- tty-prompt (0.20.0)
+ tty-color (0.5.1)
+ tty-cursor (0.7.1)
+ tty-prompt (0.21.0)
necromancer (~> 0.5.0)
pastel (~> 0.7.0)
tty-reader (~> 0.7.0)
@@ -342,14 +307,11 @@ GEM
tty-cursor (~> 0.7)
tty-screen (~> 0.7)
wisper (~> 2.0.0)
- tty-screen (0.7.0)
- unicode-display_width (1.6.0)
+ tty-screen (0.7.1)
+ unicode-display_width (1.6.1)
unicode_utils (1.4.0)
uuidtools (2.1.5)
- varia_model (0.6.0)
- buff-extensions (~> 2.0)
- hashie (>= 2.0.2, < 4.0.0)
- winrm (2.3.3)
+ winrm (2.3.4)
builder (>= 2.1.2)
erubi (~> 1.8)
gssapi (~> 1.2)
@@ -358,7 +320,7 @@ GEM
logging (>= 1.6.1, < 3.0)
nori (~> 2.0)
rubyntlm (~> 0.6.0, >= 0.6.1)
- winrm-elevated (1.1.2)
+ winrm-elevated (1.2.1)
erubi (~> 1.8)
winrm (~> 2.0)
winrm-fs (~> 1.0)
@@ -368,18 +330,19 @@ GEM
rubyzip (~> 2.0)
winrm (~> 2.0)
wisper (2.0.1)
- wmi-lite (1.0.2)
+ wmi-lite (1.0.5)
PLATFORMS
ruby
DEPENDENCIES
- berkshelf (~> 6.3)
+ berkshelf
chef (= 14.10.9)
chefspec
cookstyle
coveralls (~> 0.8.19)
cucumber-core (~> 3.2.1)
+ fauxhai-ng (~> 7.5.1)
foodcritic (~> 11.4.0)
json_spec (~> 1.1.4)
kitchen-docker (~> 2.3.0)

Test specs against more rubies (#703)

* Make chef version customisable through ENV

* Add specs on different versions of ruby

The unit test use the latest chef version compatible with the given ruby version. Had to fix some dependencies to make it work.

Co-authored-by: Karim Bogtob <karim.bogtob@datadoghq.com>