summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaymala Sinha <jsinha@chef.io>2019-05-30 14:34:13 -0400
committerJaymala Sinha <jsinha@chef.io>2019-05-31 21:52:15 -0400
commit1515580fbbb72823e0ca4ccb66376b13540d5972 (patch)
treef84559f39056b0c399514dc6626f7ca5e2342a02
parentb29e4a695a7087bf50cfe066af7e05447a059d4a (diff)
downloadchef-jsinha/migrate_travis.tar.gz
Enable Kitchen testsjsinha/migrate_travis
Signed-off-by: Jaymala Sinha <jsinha@chef.io>
-rw-r--r--.expeditor/verify.pipeline.yml227
-rw-r--r--kitchen-tests/kitchen.yml2
-rwxr-xr-xscripts/bk_tests/bk_linux_exec.sh38
3 files changed, 249 insertions, 18 deletions
diff --git a/.expeditor/verify.pipeline.yml b/.expeditor/verify.pipeline.yml
index a23963307a..5da4f489c9 100644
--- a/.expeditor/verify.pipeline.yml
+++ b/.expeditor/verify.pipeline.yml
@@ -74,6 +74,7 @@ steps:
- /workdir/scripts/bk_tests/bk_install.sh
- bundle install --jobs=3 --retry=3 --deployment --path=vendor/bundle
- bundle exec tasks/bin/run_external_test chef/chef-zero master rake pedant
+ timeout_in_minutes: 30
expeditor:
executor:
docker:
@@ -168,20 +169,212 @@ steps:
# START TEST KITCHEN ONLY
#########################################################################
-# - label: "Kitchen Tests :ruby: 2.5"
-# commands:
-# - /workdir/scripts/bk_tests/bk_install.sh
-# - asdf local ruby 2.5.5
-# - sed '/ip6/d' /etc/hosts > /etc/hosts.noip6
-# - cp /etc/hosts.noip6 /etc/hosts
-# - cd /workdir/kitchen-tests
-# - bundle install --jobs=3 --retry=3 --path=vendor/bundle
-# - bundle exec kitchen test end-to-end-amazonlinux-2
-# expeditor:
-# executor:
-# docker:
-# privileged: true
-# environment:
-# - AMAZON=2
-# - KITCHEN_YAML=/workdir/kitchen-tests/kitchen.bk.yml
-# - BUNDLE_GEMFILE=/workdir/kitchen-tests/Gemfile
+- label: "Kitchen Tests :amazon: 2 :ruby: 2.5"
+ commands:
+ - scripts/bk_tests/bk_linux_exec.sh
+ - cd kitchen-tests
+ - ~/.asdf/shims/bundle exec kitchen test end-to-end-amazonlinux-2
+ artifact_paths:
+ - $PWD/.kitchen/logs/kitchen.log
+ env:
+ AMAZON: "2"
+ KITCHEN_YAML: kitchen.yml
+ expeditor:
+ executor:
+ linux:
+ privileged: true
+ single-use: true
+
+- label: "Kitchen Tests :amazon: 201X :ruby: 2.5"
+ commands:
+ - scripts/bk_tests/bk_linux_exec.sh
+ - cd kitchen-tests
+ - ~/.asdf/shims/bundle exec kitchen test end-to-end-amazonlinux-2
+ artifact_paths:
+ - $PWD/.kitchen/logs/kitchen.log
+ env:
+ AMAZON: 201X
+ KITCHEN_YAML: kitchen.yml
+ expeditor:
+ executor:
+ linux:
+ privileged: true
+ single-use: true
+
+- label: "Kitchen Tests Ubuntu: 16.04 :ruby: 2.5"
+ commands:
+ - scripts/bk_tests/bk_linux_exec.sh
+ - cd kitchen-tests
+ - ~/.asdf/shims/bundle exec kitchen test end-to-end-ubuntu-1604
+ artifact_paths:
+ - $PWD/.kitchen/logs/kitchen.log
+ env:
+ UBUNTU: "16.04"
+ KITCHEN_YAML: kitchen.yml
+ expeditor:
+ executor:
+ linux:
+ privileged: true
+ single-use: true
+
+- label: "Kitchen Tests Ubuntu: 18.04 :ruby: 2.5"
+ commands:
+ - scripts/bk_tests/bk_linux_exec.sh
+ - cd kitchen-tests
+ - ~/.asdf/shims/bundle exec kitchen test end-to-end-ubuntu-1804
+ artifact_paths:
+ - $PWD/.kitchen/logs/kitchen.log
+ env:
+ UBUNTU: "18.04"
+ KITCHEN_YAML: kitchen.yml
+ expeditor:
+ executor:
+ linux:
+ privileged: true
+ single-use: true
+
+- label: "Kitchen Tests Debian: 8 :ruby: 2.5"
+ commands:
+ - scripts/bk_tests/bk_linux_exec.sh
+ - cd kitchen-tests
+ - ~/.asdf/shims/bundle exec kitchen test end-to-end-debian-8
+ artifact_paths:
+ - $PWD/.kitchen/logs/kitchen.log
+ env:
+ DEBIAN: "8"
+ KITCHEN_YAML: kitchen.yml
+ expeditor:
+ executor:
+ linux:
+ privileged: true
+ single-use: true
+
+- label: "Kitchen Tests Debian: 9 :ruby: 2.5"
+ commands:
+ - scripts/bk_tests/bk_linux_exec.sh
+ - cd kitchen-tests
+ - ~/.asdf/shims/bundle exec kitchen test end-to-end-debian-9
+ artifact_paths:
+ - $PWD/.kitchen/logs/kitchen.log
+ env:
+ DEBIAN: "9"
+ KITCHEN_YAML: kitchen.yml
+ expeditor:
+ executor:
+ linux:
+ privileged: true
+ single-use: true
+
+- label: "Kitchen Tests Debian: 10 :ruby: 2.5"
+ commands:
+ - scripts/bk_tests/bk_linux_exec.sh
+ - cd kitchen-tests
+ - ~/.asdf/shims/bundle exec kitchen test end-to-end-debian-10
+ artifact_paths:
+ - $PWD/.kitchen/logs/kitchen.log
+ env:
+ DEBIAN: "10"
+ KITCHEN_YAML: kitchen.yml
+ expeditor:
+ executor:
+ linux:
+ privileged: true
+ single-use: true
+
+- label: "Kitchen Tests Centos: 6 :ruby: 2.5"
+ commands:
+ - scripts/bk_tests/bk_linux_exec.sh
+ - cd kitchen-tests
+ - ~/.asdf/shims/bundle exec kitchen test end-to-end-centos-6
+ artifact_paths:
+ - $PWD/.kitchen/logs/kitchen.log
+ env:
+ CENTOS: "6"
+ KITCHEN_YAML: kitchen.yml
+ expeditor:
+ executor:
+ linux:
+ privileged: true
+ single-use: true
+
+- label: "Kitchen Tests Centos: 7 :ruby: 2.5"
+ commands:
+ - scripts/bk_tests/bk_linux_exec.sh
+ - cd kitchen-tests
+ - ~/.asdf/shims/bundle exec kitchen test end-to-end-centos-7
+ artifact_paths:
+ - $PWD/.kitchen/logs/kitchen.log
+ env:
+ CENTOS: "7"
+ KITCHEN_YAML: kitchen.yml
+ expeditor:
+ executor:
+ linux:
+ privileged: true
+ single-use: true
+
+- label: "Kitchen Tests Fedora: latest :ruby: 2.5"
+ commands:
+ - scripts/bk_tests/bk_linux_exec.sh
+ - cd kitchen-tests
+ - ~/.asdf/shims/bundle exec kitchen test end-to-end-fedora-latest
+ artifact_paths:
+ - $PWD/.kitchen/logs/kitchen.log
+ env:
+ FEDORA: "latest"
+ KITCHEN_YAML: kitchen.yml
+ expeditor:
+ executor:
+ linux:
+ privileged: true
+ single-use: true
+
+- label: "Kitchen Tests OPENSUSELEAP: 42 :ruby: 2.5"
+ commands:
+ - scripts/bk_tests/bk_linux_exec.sh
+ - cd kitchen-tests
+ - ~/.asdf/shims/bundle exec kitchen test end-to-end-opensuse-leap
+ artifact_paths:
+ - $PWD/.kitchen/logs/kitchen.log
+ env:
+ OPENSUSELEAP: "42"
+ KITCHEN_YAML: kitchen.yml
+ expeditor:
+ executor:
+ linux:
+ privileged: true
+ single-use: true
+
+- label: "Kitchen Tests Rspec Centos: 7 :ruby: 2.5"
+ commands:
+ - scripts/bk_tests/bk_linux_exec.sh
+ - cd kitchen-tests
+ - ~/.asdf/shims/bundle exec kitchen test rspec-centos-7
+ timeout_in_minutes: 30
+ artifact_paths:
+ - $PWD/.kitchen/logs/kitchen.log
+ env:
+ RSPEC_CENTOS: "7"
+ KITCHEN_YAML: kitchen.yml
+ expeditor:
+ executor:
+ linux:
+ privileged: true
+ single-use: true
+
+- label: "Kitchen Tests Rspec OPENSUSELEAP: 42 :ruby: 2.5"
+ commands:
+ - scripts/bk_tests/bk_linux_exec.sh
+ - cd kitchen-tests
+ - ~/.asdf/shims/bundle exec kitchen test rspec-opensuse-leap
+ timeout_in_minutes: 30
+ artifact_paths:
+ - $PWD/.kitchen/logs/kitchen.log
+ env:
+ RSPEC_OPENSUSELEAP: "42"
+ KITCHEN_YAML: kitchen.yml
+ expeditor:
+ executor:
+ linux:
+ privileged: true
+ single-use: true
diff --git a/kitchen-tests/kitchen.yml b/kitchen-tests/kitchen.yml
index ee157926f6..944767eada 100644
--- a/kitchen-tests/kitchen.yml
+++ b/kitchen-tests/kitchen.yml
@@ -21,7 +21,7 @@ lifecycle:
- remote: /opt/chef/embedded/bin/ohai -v
- remote: /opt/chef/embedded/bin/gem install appbundler appbundle-updater
- remote: /opt/chef/embedded/bin/appbundle-updater chef ohai <%= File.readlines('../Gemfile.lock', File.expand_path(File.dirname(__FILE__))).find { |l| l =~ /^\s+ohai \((\d+\.\d+\.\d+)\)/ }; 'v' + $1 %> --tarball --github chef/ohai
- - remote: /opt/chef/embedded/bin/appbundle-updater chef chef <%= ENV['TRAVIS_COMMIT'] || %x(git rev-parse HEAD).chomp %> --tarball --github chef/chef
+ - remote: /opt/chef/embedded/bin/appbundle-updater chef chef <%= ENV['BUILDKITE_COMMIT'] || %x(git rev-parse HEAD).chomp %> --tarball --github chef/chef
- remote: echo "Installed Chef / Ohai release:"
- remote: /opt/chef/embedded/bin/chef-client -v
- remote: /opt/chef/embedded/bin/ohai -v
diff --git a/scripts/bk_tests/bk_linux_exec.sh b/scripts/bk_tests/bk_linux_exec.sh
new file mode 100755
index 0000000000..368dd7fae8
--- /dev/null
+++ b/scripts/bk_tests/bk_linux_exec.sh
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+# Verify Docker Is Running
+docker version
+sudo service docker status
+
+# Install C and C++
+sudo yum install -y gcc gcc-c++ openssl-devel readline-devel zlib-devel
+
+# Install omnibus-toolchain for git bundler and gem
+curl -fsSL https://chef.io/chef/install.sh | sudo bash -s -- -P omnibus-toolchain
+
+# Set Environment Variables
+export BUNDLE_GEMFILE=$PWD/kitchen-tests/Gemfile
+export FORCE_FFI_YAJL=ext
+export CHEF_LICENSE="accept-silent"
+export PATH=$PATH:~/.asdf/shims:/opt/asdf/bin:/opt/asdf/shims:/opt/omnibus-toolchain/embedded/bin
+
+# Install ASDF software manager
+echo "--- Installing ASDF software version manager from master"
+sudo git clone https://github.com/asdf-vm/asdf.git /opt/asdf
+. /opt/asdf/asdf.sh
+. /opt/asdf/completions/asdf.bash
+
+echo "--- Installing Ruby ASDF plugin"
+/opt/asdf/bin/asdf plugin-add ruby https://github.com/asdf-vm/asdf-ruby.git
+
+echo "--- Installing Ruby 2.5.5"
+/opt/asdf/bin/asdf install ruby 2.5.5
+/opt/asdf/bin/asdf global ruby 2.5.5
+
+# Update Gems
+gem update --system $(grep rubygems omnibus_overrides.rb | cut -d'"' -f2)
+gem install bundler -v $(grep :bundler omnibus_overrides.rb | cut -d'"' -f2) --force --no-document
+sudo iptables -L DOCKER || ( echo "DOCKER iptables chain missing" ; sudo iptables -N DOCKER )
+ruby --version
+which bundle
+bundle install --jobs=3 --retry=3 --path=vendor/bundle \ No newline at end of file