summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2019-12-29 17:59:26 -0800
committerGitHub <noreply@github.com>2019-12-29 17:59:26 -0800
commita8206d6c6f03de1fde15c49f6fe9ddb1d0071b7a (patch)
tree11cee58a353eeb40c042e41714952e4ce6af8a4e
parent0778c7c2629e519b02842123fdbaa766911b79cd (diff)
parentd311508d5263467e6909a322544995c0e1ec451e (diff)
downloadchef-zero-a8206d6c6f03de1fde15c49f6fe9ddb1d0071b7a.tar.gz
Merge pull request #297 from chef/testing
Move testing to Buildkite
-rw-r--r--.expeditor/config.yml9
-rwxr-xr-x.expeditor/run_linux_tests.sh53
-rw-r--r--.expeditor/verify.pipeline.yml52
-rw-r--r--.rspec2
-rw-r--r--Gemfile4
-rw-r--r--Rakefile4
6 files changed, 117 insertions, 7 deletions
diff --git a/.expeditor/config.yml b/.expeditor/config.yml
index 94d1e13..ff7ad8a 100644
--- a/.expeditor/config.yml
+++ b/.expeditor/config.yml
@@ -1,8 +1,9 @@
# Documentation available at https://expeditor.chef.io/docs/getting-started/
---
+
# Slack channel in Chef Software slack to send notifications about build failures, etc
slack:
- notify_channel: chef-notify
+ notify_channel: chef-infra-notify
# This publish is triggered by the `built_in:publish_rubygems` artifact_action.
rubygems:
@@ -16,6 +17,7 @@ github:
# allow bumping the minor release via label
minor_bump_labels:
- "Expeditor: Bump Version Minor"
+ # allow bumping the major release via label
major_bump_labels:
- "Expeditor: Bump Version Major"
@@ -41,3 +43,8 @@ promote:
actions:
- built_in:rollover_changelog
- built_in:publish_rubygems
+
+pipelines:
+ - verify:
+ description: Pull Request validation tests
+ public: true
diff --git a/.expeditor/run_linux_tests.sh b/.expeditor/run_linux_tests.sh
new file mode 100755
index 0000000..4c14c80
--- /dev/null
+++ b/.expeditor/run_linux_tests.sh
@@ -0,0 +1,53 @@
+#!/bin/bash
+#
+# This script runs a passed in command, but first setups up the bundler caching on the repo
+
+set -ue
+
+export USER="root"
+
+echo "--- dependencies"
+export LANG=C.UTF-8 LANGUAGE=C.UTF-8
+S3_URL="s3://public-cd-buildkite-cache/${BUILDKITE_PIPELINE_SLUG}/${BUILDKITE_LABEL}"
+
+pull_s3_file() {
+ aws s3 cp "${S3_URL}/$1" "$1" || echo "Could not pull $1 from S3"
+}
+
+push_s3_file() {
+ if [ -f "$1" ]; then
+ aws s3 cp "$1" "${S3_URL}/$1" || echo "Could not push $1 to S3 for caching."
+ fi
+}
+
+apt-get update -y
+apt-get install awscli -y
+
+echo "--- bundle install"
+pull_s3_file "bundle.tar.gz"
+pull_s3_file "bundle.sha256"
+
+if [ -f bundle.tar.gz ]; then
+ tar -xzf bundle.tar.gz
+fi
+
+if [ -n "${RESET_BUNDLE_CACHE:-}" ]; then
+ rm bundle.sha256
+fi
+
+bundle config --local path vendor/bundle
+bundle install --jobs=7 --retry=3
+
+echo "--- bundle cache"
+if test -f bundle.sha256 && shasum --check bundle.sha256 --status; then
+ echo "Bundled gems have not changed. Skipping upload to s3"
+else
+ echo "Bundled gems have changed. Uploading to s3"
+ shasum -a 256 Gemfile.lock > bundle.sha256
+ tar -czf bundle.tar.gz vendor/
+ push_s3_file bundle.tar.gz
+ push_s3_file bundle.sha256
+fi
+
+echo "+++ bundle exec task"
+bundle exec $1
diff --git a/.expeditor/verify.pipeline.yml b/.expeditor/verify.pipeline.yml
new file mode 100644
index 0000000..ba9f28a
--- /dev/null
+++ b/.expeditor/verify.pipeline.yml
@@ -0,0 +1,52 @@
+---
+expeditor:
+ defaults:
+ buildkite:
+ timeout_in_minutes: 30
+
+steps:
+
+- label: run-lint-and-specs-ruby-2.4
+ command:
+ - apt-get update
+ - .expeditor/run_linux_tests.sh rake spec style
+ expeditor:
+ executor:
+ docker:
+ image: ruby:2.4-buster
+
+- label: run-lint-and-specs-ruby-2.5
+ command:
+ - apt-get update
+ - .expeditor/run_linux_tests.sh rake spec style
+ expeditor:
+ executor:
+ docker:
+ image: ruby:2.5-buster
+
+- label: run-lint-and-specs-ruby-2.6
+ command:
+ - apt-get update
+ - .expeditor/run_linux_tests.sh rake spec style
+ expeditor:
+ executor:
+ docker:
+ image: ruby:2.6-buster
+
+- label: run-lint-and-specs-ruby-2.7
+ command:
+ - apt-get update
+ - .expeditor/run_linux_tests.sh rake spec style
+ expeditor:
+ executor:
+ docker:
+ image: ruby:2.7-buster
+
+- label: run-specs-windows
+ command:
+ - bundle install --jobs=7 --retry=3 --without docs debug
+ - bundle exec rake spec
+ expeditor:
+ executor:
+ docker:
+ host_os: windows
diff --git a/.rspec b/.rspec
index eb3ef03..8c18f1a 100644
--- a/.rspec
+++ b/.rspec
@@ -1,2 +1,2 @@
+--format documentation
--color
--fd
diff --git a/Gemfile b/Gemfile
index 1f63641..cad38a6 100644
--- a/Gemfile
+++ b/Gemfile
@@ -25,7 +25,3 @@ group :debug do
gem "pry-byebug"
gem "pry-stack_explorer"
end
-
-# If you want to load debugging tools into the bundle exec sandbox,
-# add these additional dependencies into Gemfile.local
-eval_gemfile(__FILE__ + ".local") if File.exist?(__FILE__ + ".local")
diff --git a/Rakefile b/Rakefile
index 5e7f57b..3c80588 100644
--- a/Rakefile
+++ b/Rakefile
@@ -52,9 +52,11 @@ end
begin
require "chefstyle"
require "rubocop/rake_task"
+ desc "Run Chefstyle tests"
RuboCop::RakeTask.new(:style) do |task|
task.options += ["--display-cop-names", "--no-color"]
end
rescue LoadError
- puts "chefstyle/rubocop is not available. bundle install first to make sure all dependencies are installed."
+ puts "chefstyle gem is not installed. bundle install first to make sure all dependencies are installed."
end
+