diff options
author | Jeremiah Snapp <jeremiah@chef.io> | 2019-06-24 16:11:09 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-24 16:11:09 -0400 |
commit | cf743e1152c54cf616a5266025cd278306f1b0db (patch) | |
tree | dc1378d14989e9899a95d6e93cb2a6ba65702ff6 | |
parent | 66a100217e0338a2809146d0fca0ffa84b9fd9c9 (diff) | |
parent | 0a69943f3e5f24cbcbfef518a8e4ad0e078b2cc7 (diff) | |
download | chef-cf743e1152c54cf616a5266025cd278306f1b0db.tar.gz |
Merge pull request #8686 from chef/snappj/chef-14/replace-jenkins-with-buildkite
Replace jenkins with buildkite for chef-14 branch
-rw-r--r-- | .expeditor/config.yml | 2 | ||||
-rwxr-xr-x | ci/verify-chef.bat | 100 | ||||
-rwxr-xr-x | ci/verify-chef.sh | 113 | ||||
-rw-r--r-- | omnibus/omnibus-test.ps1 | 14 | ||||
-rw-r--r-- | omnibus/omnibus-test.sh | 19 | ||||
-rw-r--r-- | spec/functional/resource/insserv_spec.rb | 1 |
6 files changed, 35 insertions, 214 deletions
diff --git a/.expeditor/config.yml b/.expeditor/config.yml index fccf8d7b51..95afe24a47 100644 --- a/.expeditor/config.yml +++ b/.expeditor/config.yml @@ -72,7 +72,7 @@ merge_actions: - "Expeditor: Skip Build" - "Expeditor: Skip All" only_if: built_in:bump_version - - built_in:trigger_omnibus_release_build: + - trigger_pipeline:omnibus/release: ignore_labels: - "Expeditor: Skip Omnibus" - "Expeditor: Skip All" diff --git a/ci/verify-chef.bat b/ci/verify-chef.bat deleted file mode 100755 index 7160b7b2f0..0000000000 --- a/ci/verify-chef.bat +++ /dev/null @@ -1,100 +0,0 @@ - -@ECHO OFF - -REM ; %PROJECT_NAME% is set by Jenkins, this allows us to use the same script to verify -REM ; Chef and Angry Chef -cd C:\opscode\%PROJECT_NAME%\bin - -REM ; We don't want to add the embedded bin dir to the main PATH as this -REM ; could mask issues in our binstub shebangs. -SET EMBEDDED_BIN_DIR=C:\opscode\%PROJECT_NAME%\embedded\bin - -ECHO. - -REM ; Set the temporary directory to a custom location, and wipe it before -REM ; and after the tests run. -SET TEMP=%TEMP%\cheftest -SET TMP=%TMP%\cheftest -RMDIR /S /Q %TEMP% -MKDIR %TEMP% - -REM ; FIXME: we should really use Bundler.with_clean_env in the caller instead of re-inventing it here -set _ORIGINAL_GEM_PATH= -set BUNDLE_BIN_PATH= -set BUNDLE_GEMFILE= -set GEM_HOME= -set GEM_PATH= -set GEM_ROOT= -set RUBYLIB= -set RUBYOPT= -set RUBY_ENGINE= -set RUBY_ROOT= -set RUBY_VERSION= -set BUNDLER_VERSION= - -FOR %%b IN ( - chef-client - knife - chef-solo - ohai -) DO ( - - - ECHO Checking for existence of binfile `%%b`... - - IF EXIST %%b ( - ECHO ...FOUND IT! - ) ELSE ( - GOTO :error - ) - ECHO. -) - -call chef-client --version - -REM ; Exercise various packaged tools to validate binstub shebangs -call %EMBEDDED_BIN_DIR%\ruby --version -call %EMBEDDED_BIN_DIR%\gem --version -call %EMBEDDED_BIN_DIR%\bundle --version -call %EMBEDDED_BIN_DIR%\rspec --version - -SET PATH=C:\opscode\%PROJECT_NAME%\bin;C:\opscode\%PROJECT_NAME%\embedded\bin;%PATH% - -REM ; Test against the vendored chef gem (cd into the output of "gem which chef") -for /f "delims=" %%a in ('gem which chef') do set CHEFDIR=%%a -call :dirname "%CHEFDIR%" CHEFDIR -call :dirname "%CHEFDIR%" CHEFDIR -cd %CHEFDIR% - -cd - -type Gemfile.lock - -IF NOT EXIST "Gemfile.lock" ( - ECHO "Chef gem does not contain a Gemfile.lock! This is needed to run any tests." - GOTO :error -) - -IF "%PIPELINE_NAME%" == "chef-fips" ( - set CHEF_FIPS=1 -) - -REM ; ffi-yajl must run in c-extension mode for perf, so force it so we don't accidentally fall back to ffi -set FORCE_FFI_YAJL=ext - -set -REM ; we should use bundler, but aren't because of a bug -REM ; this should be `bundle exec rspec yadda yadda...` -REM ; the bug is here: https://github.com/bundler/bundler/issues/5644 -REM ; while this opens us up to some testing edge conditions if we're doing our job right to build the omnibus package and its gems correct that shouldn't matter -REM ; since that assumption has gone wrong before we should really go back to using bundler at some point -call %EMBEDDED_BIN_DIR%\rspec -r rspec_junit_formatter -f RspecJunitFormatter -o %WORKSPACE%\test.xml -f documentation spec/functional - -GOTO :EOF - -:dirname file varName - setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION - SET _dir=%~dp1 - SET _dir=%_dir:~0,-1% - endlocal & set %2=%_dir% -GOTO thout:EOF diff --git a/ci/verify-chef.sh b/ci/verify-chef.sh deleted file mode 100755 index b6dafa33e4..0000000000 --- a/ci/verify-chef.sh +++ /dev/null @@ -1,113 +0,0 @@ -#!/bin/sh - -set -evx - -# Our tests hammer YUM pretty hard and the EL6 testers get corrupted -# after some period of time. Rebuilding the RPM database clears -# up the underlying corruption. We'll do this each test run just to -# be safe. -if [ -f /etc/redhat-release ]; then - major_version=`sed 's/^.\+ release \([0-9]\+\).*/\1/' /etc/redhat-release` - if [ "$major_version" -lt "7" ]; then - sudo rm -rf /var/lib/rpm/__db* - sudo db_verify /var/lib/rpm/Packages - sudo rpm --rebuilddb - sudo yum clean all - fi -fi - -# Set up a custom tmpdir, and clean it up before and after the tests -TMPDIR="${TMPDIR:-/tmp}/cheftest" -export TMPDIR -sudo rm -rf $TMPDIR -mkdir -p $TMPDIR - -# Verify that we kill any orphaned test processes. Kill any orphaned rspec processes. -ps ax | egrep 'rspec' | grep -v grep | awk '{ print $1 }' | xargs sudo kill -s KILL || true - -# $PROJECT_NAME is set by Jenkins, this allows us to use the same script to verify -# Chef and Angry Chef -PATH=/opt/$PROJECT_NAME/bin:$PATH -export PATH - -BIN_DIR=/opt/$PROJECT_NAME/bin -export BIN_DIR - -# We don't want to add the embedded bin dir to the main PATH as this -# could mask issues in our binstub shebangs. -EMBEDDED_BIN_DIR=/opt/$PROJECT_NAME/embedded/bin -export EMBEDDED_BIN_DIR - -# If we are on Mac our symlinks are located under /usr/local/bin -# otherwise they are under /usr/bin -if [ -f /usr/bin/sw_vers ]; then - USR_BIN_DIR="/usr/local/bin" -else - USR_BIN_DIR="/usr/bin" -fi -export USR_BIN_DIR - -# sanity check that we're getting the correct symlinks from the pre-install script -# solaris doesn't have readlink or test -e. ls -n is different on BSD. proceed with caution. -if [ ! -L $USR_BIN_DIR/chef-client ] || [ `ls -l $USR_BIN_DIR/chef-client | awk '{print$NF}'` != "$BIN_DIR/chef-client" ]; then - echo "$USR_BIN_DIR/chef-client symlink to $BIN_DIR/chef-client was not correctly created by the pre-install script!" - exit 1 -fi - -if [ ! -L $USR_BIN_DIR/knife ] || [ `ls -l $USR_BIN_DIR/knife | awk '{print$NF}'` != "$BIN_DIR/knife" ]; then - echo "$USR_BIN_DIR/knife symlink to $BIN_DIR/knife was not correctly created by the pre-install script!" - exit 1 -fi - -if [ ! -L $USR_BIN_DIR/chef-solo ] || [ `ls -l $USR_BIN_DIR/chef-solo | awk '{print$NF}'` != "$BIN_DIR/chef-solo" ]; then - echo "$USR_BIN_DIR/chef-solo symlink to $BIN_DIR/chef-solo was not correctly created by the pre-install script!" - exit 1 -fi - -if [ ! -L $USR_BIN_DIR/ohai ] || [ `ls -l $USR_BIN_DIR/ohai | awk '{print$NF}'` != "$BIN_DIR/ohai" ]; then - echo "$USR_BIN_DIR/ohai symlink to $BIN_DIR/ohai was not correctly created by the pre-install script!" - exit 1 -fi - -# Ensure the calling environment (disapproval look Bundler) does not -# infect our Ruby environment created by the `chef-client` cli. -for ruby_env_var in _ORIGINAL_GEM_PATH \ - BUNDLE_BIN_PATH \ - BUNDLE_GEMFILE \ - GEM_HOME \ - GEM_PATH \ - GEM_ROOT \ - RUBYLIB \ - RUBYOPT \ - RUBY_ENGINE \ - RUBY_ROOT \ - RUBY_VERSION \ - BUNDLER_VERSION - -do - unset $ruby_env_var -done - -chef-client --version - -# Exercise various packaged tools to validate binstub shebangs -$EMBEDDED_BIN_DIR/ruby --version -$EMBEDDED_BIN_DIR/gem --version -$EMBEDDED_BIN_DIR/bundle --version -$EMBEDDED_BIN_DIR/rspec --version - -# ffi-yajl must run in c-extension mode or we take perf hits, so we force it -# before running rspec so that we don't wind up testing the ffi mode -FORCE_FFI_YAJL=ext -export FORCE_FFI_YAJL - -OLD_PATH=$PATH -PATH=/opt/$PROJECT_NAME/bin:/opt/$PROJECT_NAME/embedded/bin:$PATH - -gem_list=`gem which chef` -lib_dir=`dirname $gem_list` -CHEF_GEM=`dirname $lib_dir` - - -cd $CHEF_GEM -sudo bundle exec rspec -r rspec_junit_formatter -f RspecJunitFormatter -o $WORKSPACE/test.xml -f documentation spec/functional diff --git a/omnibus/omnibus-test.ps1 b/omnibus/omnibus-test.ps1 index 8e826cfb77..b6f054370c 100644 --- a/omnibus/omnibus-test.ps1 +++ b/omnibus/omnibus-test.ps1 @@ -28,6 +28,20 @@ $Env:TMP = "C:\cheftest" Remove-Item -Recurse -Force $Env:TEMP -ErrorAction SilentlyContinue New-Item -ItemType directory -Path $Env:TEMP +# FIXME: we should really use Bundler.with_clean_env in the caller instead of re-inventing it here +Remove-Item Env:_ORIGINAL_GEM_PATH -ErrorAction SilentlyContinue +Remove-Item Env:BUNDLE_BIN_PATH -ErrorAction SilentlyContinue +Remove-Item Env:BUNDLE_GEMFILE -ErrorAction SilentlyContinue +Remove-Item Env:GEM_HOME -ErrorAction SilentlyContinue +Remove-Item Env:GEM_PATH -ErrorAction SilentlyContinue +Remove-Item Env:GEM_ROOT -ErrorAction SilentlyContinue +Remove-Item Env:RUBYLIB -ErrorAction SilentlyContinue +Remove-Item Env:RUBYOPT -ErrorAction SilentlyContinue +Remove-Item Env:RUBY_ENGINE -ErrorAction SilentlyContinue +Remove-Item Env:RUBY_ROOT -ErrorAction SilentlyContinue +Remove-Item Env:RUBY_VERSION -ErrorAction SilentlyContinue +Remove-Item Env:BUNDLER_VERSION -ErrorAction SilentlyContinue + ForEach ($b in "chef-client", "knife", diff --git a/omnibus/omnibus-test.sh b/omnibus/omnibus-test.sh index 4b5ca82895..95ac30bec4 100644 --- a/omnibus/omnibus-test.sh +++ b/omnibus/omnibus-test.sh @@ -93,6 +93,25 @@ if [[ ! -L $USR_BIN_DIR/ohai ]] || [[ $(ls -l $USR_BIN_DIR/ohai | awk '{print$NF exit 1 fi +# Ensure the calling environment (disapproval look Bundler) does not +# infect our Ruby environment created by the `chef-client` cli. +for ruby_env_var in _ORIGINAL_GEM_PATH \ + BUNDLE_BIN_PATH \ + BUNDLE_GEMFILE \ + GEM_HOME \ + GEM_PATH \ + GEM_ROOT \ + RUBYLIB \ + RUBYOPT \ + RUBY_ENGINE \ + RUBY_ROOT \ + RUBY_VERSION \ + BUNDLER_VERSION + +do + unset $ruby_env_var +done + chef-client --version # Exercise various packaged tools to validate binstub shebangs diff --git a/spec/functional/resource/insserv_spec.rb b/spec/functional/resource/insserv_spec.rb index a923753019..55a803d431 100644 --- a/spec/functional/resource/insserv_spec.rb +++ b/spec/functional/resource/insserv_spec.rb @@ -75,6 +75,7 @@ describe Chef::Resource::Service, :requires_root, :sles11 do before(:all) do File.delete("/etc/init.d/inittest") if File.exists?("/etc/init.d/inittest") FileUtils.cp((File.join(File.dirname(__FILE__), "/../assets/inittest")).to_s, "/etc/init.d/inittest") + FileUtils.chmod(0755, "/etc/init.d/inittest") end after(:all) do |