From 0ce002d47405c0178b1016a8d803e13e5cfd823e Mon Sep 17 00:00:00 2001 From: John Keiser Date: Tue, 19 Apr 2016 09:05:59 -0700 Subject: Re-add activesupport tests --- .travis.yml | 10 +++++----- Gemfile | 1 - Gemfile.lock | 5 ----- appveyor.yml | 2 +- tasks/bin/run_chef_tests | 12 +++++++++--- tasks/bundle.rb | 24 ++++++++++++++++++++++++ tasks/dependencies.rb | 28 ++-------------------------- tasks/rspec.rb | 3 ++- version_policy.rb | 7 ++++--- 9 files changed, 47 insertions(+), 45 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4294f3865e..0bbbbe579a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ before_install: - gem install bundler -v $(grep bundler omnibus_overrides.rb | cut -d'"' -f2) - rm -f .bundle/config -bundler_args: --without changelog compat_testing development docgen guard maintenance omnibus_package tools aix bsd mac_os_x solaris windows --frozen +bundler_args: --without changelog development docgen guard maintenance omnibus_package tools aix bsd mac_os_x solaris windows --frozen # do not run expensive spec tests on PRs, only on branches branches: @@ -26,19 +26,19 @@ matrix: - rvm: 2.1 sudo: true script: tasks/bin/run_chef_tests - bundler_args: --without changelog compat_testing development docgen guard integration maintenance omnibus_package tools aix bsd mac_os_x solaris windows --frozen + bundler_args: --without changelog development docgen guard integration maintenance omnibus_package tools aix bsd mac_os_x solaris windows --frozen - rvm: 2.2 sudo: true script: tasks/bin/run_chef_tests - bundler_args: --without changelog compat_testing development docgen guard integration maintenance omnibus_package tools aix bsd mac_os_x solaris windows --frozen + bundler_args: --without changelog development docgen guard integration maintenance omnibus_package tools aix bsd mac_os_x solaris windows --frozen - rvm: 2.3.0 sudo: true script: tasks/bin/run_chef_tests - bundler_args: --without changelog compat_testing development docgen guard integration maintenance omnibus_package tools aix bsd mac_os_x solaris windows --frozen + bundler_args: --without changelog development docgen guard integration maintenance omnibus_package tools aix bsd mac_os_x solaris windows --frozen - rvm: rbx sudo: true script: tasks/bin/run_chef_tests - bundler_args: --without changelog compat_testing development docgen guard integration maintenance omnibus_package tools aix bsd mac_os_x solaris windows --frozen + bundler_args: --without changelog development docgen guard integration maintenance omnibus_package tools aix bsd mac_os_x solaris windows --frozen # # External tests # diff --git a/Gemfile b/Gemfile index dd097652c2..c3a40d179d 100644 --- a/Gemfile +++ b/Gemfile @@ -16,7 +16,6 @@ Dir.glob("chef-*.gemspec").each do |gemspec_filename| end gemspec name: gemspec_name -gem "activesupport", "< 4.0.0", group: :compat_testing, platform: "ruby" gem "chef-config", path: File.expand_path("../chef-config", __FILE__) if File.exist?(File.expand_path("../chef-config", __FILE__)) # Ensure that we can always install rake, regardless of gem groups gem "rake" diff --git a/Gemfile.lock b/Gemfile.lock index c865e0f042..eeb6e2fc41 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -93,9 +93,6 @@ PATH GEM remote: https://rubygems.org/ specs: - activesupport (3.2.22.2) - i18n (~> 0.6, >= 0.6.4) - multi_json (~> 1.0) addressable (2.4.0) appbundler (0.9.0) mixlib-cli (~> 1.4) @@ -204,7 +201,6 @@ GEM hashie (3.4.3) highline (1.7.8) httpclient (2.7.1) - i18n (0.7.0) inifile (3.0.0) iniparse (1.4.2) ipaddress (0.8.3) @@ -411,7 +407,6 @@ PLATFORMS x86-mingw32 DEPENDENCIES - activesupport (< 4.0.0) appbundler bundler bundler-audit! diff --git a/appveyor.yml b/appveyor.yml index 108794c865..7d89df1eb3 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -30,7 +30,7 @@ install: - bundler --version - SET BUNDLE_IGNORE_CONFIG=true - SET BUNDLE_FROZEN=1 - - SET BUNDLE_WITHOUT=development:guard:maintenance:tools:integration:changelog:compat_testing:docgen:travis:style:omnibus_package:aix:bsd:linux:mac_os_x:solaris + - SET BUNDLE_WITHOUT=development:guard:maintenance:tools:integration:changelog:docgen:travis:style:omnibus_package:aix:bsd:linux:mac_os_x:solaris build_script: - bundle install || bundle install || bundle install diff --git a/tasks/bin/run_chef_tests b/tasks/bin/run_chef_tests index 567c6a9587..ea5c5beeff 100755 --- a/tasks/bin/run_chef_tests +++ b/tasks/bin/run_chef_tests @@ -5,7 +5,13 @@ set -evx echo --color > .rspec echo -fp >> .rspec + sudo sed -i -e 's/^Defaults\tsecure_path.*$//' /etc/sudoers; -sudo -E $(which bundle) exec rake spec; -bundle exec rake style; -bundle exec bundle-audit check --update; +# If we have any args, just run the given command +if [ -n "$1" ]; then + sudo -E $(which bundle) exec $@; +else + sudo -E $(which bundle) exec rake spec; + bundle exec rake style; + bundle exec bundle-audit check --update; +fi diff --git a/tasks/bundle.rb b/tasks/bundle.rb index 9de4529d1a..059b926f14 100644 --- a/tasks/bundle.rb +++ b/tasks/bundle.rb @@ -52,6 +52,30 @@ namespace :bundle do end end end + + # Find out if we're using the latest gems we can (so we don't regress versions) + desc "Check for gems that are not at the latest released version, and report if anything not in ACCEPTABLE_OUTDATED_GEMS (version_policy.rb) is out of date." + task :outdated do + extend BundleUtil + puts "" + puts "-------------------------------------------------------------------" + puts "Checking for outdated gems ..." + puts "-------------------------------------------------------------------" + # TODO check for outdated windows gems too + with_bundle_unfrozen do + bundle_outdated = bundle("outdated", extract_output: true) + puts bundle_outdated + outdated_gems = parse_bundle_outdated(bundle_outdated).map { |line, gem_name| gem_name } + # Weed out the acceptable ones + outdated_gems = outdated_gems.reject { |gem_name| ACCEPTABLE_OUTDATED_GEMS.include?(gem_name) } + if outdated_gems.empty? + puts "" + puts "SUCCESS!" + else + raise "ERROR: outdated gems: #{outdated_gems.join(", ")}. Either fix them or add them to ACCEPTABLE_OUTDATED_GEMS in #{__FILE__}." + end + end + end end desc "Run bundle with arbitrary args against the given platform; e.g. rake bundle[show]. No platform to run against the main bundle; bundle[show,windows] to run the windows one; bundle[show,*] to run against all non-default platforms." diff --git a/tasks/dependencies.rb b/tasks/dependencies.rb index eb5b20d1bb..2faf3b883a 100644 --- a/tasks/dependencies.rb +++ b/tasks/dependencies.rb @@ -141,31 +141,7 @@ namespace :dependencies do end end end - - # Find out if we're using the latest gems we can (so we don't regress versions) - desc "Check for gems that are not at the latest released version, and report if anything not in ACCEPTABLE_OUTDATED_GEMS (version_policy.rb) is out of date." - task :check_outdated do - extend BundleUtil - puts "" - puts "-------------------------------------------------------------------" - puts "Checking for outdated gems ..." - puts "-------------------------------------------------------------------" - # TODO check for outdated windows gems too - with_bundle_unfrozen do - bundle_outdated = bundle("outdated", extract_output: true) - puts bundle_outdated - outdated_gems = parse_bundle_outdated(bundle_outdated).map { |line, gem_name| gem_name } - # Weed out the acceptable ones - outdated_gems = outdated_gems.reject { |gem_name| ACCEPTABLE_OUTDATED_GEMS.include?(gem_name) } - if outdated_gems.empty? - puts "" - puts "SUCCESS!" - else - raise "ERROR: outdated gems: #{outdated_gems.join(", ")}. Either fix them or add them to ACCEPTABLE_OUTDATED_GEMS in #{__FILE__}." - end - end - end end desc "Update all dependencies and check for outdated gems. Call dependencies[conservative] to update as little as possible." -task :dependencies, [:conservative] => [ "dependencies:update", "dependencies:check_outdated" ] -task :update, [:conservative] => [ "dependencies:update", "dependencies:check_outdated"] +task :dependencies, [:conservative] => [ "dependencies:update", "bundle:outdated" ] +task :update, [:conservative] => [ "dependencies:update", "bundle:outdated"] diff --git a/tasks/rspec.rb b/tasks/rspec.rb index a52960f165..616a68f09e 100644 --- a/tasks/rspec.rb +++ b/tasks/rspec.rb @@ -73,7 +73,8 @@ begin desc "Run the specs under spec/unit with activesupport loaded" RSpec::Core::RakeTask.new(:activesupport) do |t| t.rspec_opts = %w{--require active_support/core_ext --profile} - t.pattern = FileList["spec/unit/**/*_spec.rb"] + # Only node_spec and role_spec specifically have issues, target those tests + t.pattern = FileList["spec/unit/node_spec.rb", "spec/unit/role_spec.rb"] end [:unit, :functional, :integration, :stress].each do |sub| diff --git a/version_policy.rb b/version_policy.rb index eab7382d7f..59ebd58160 100644 --- a/version_policy.rb +++ b/version_policy.rb @@ -67,10 +67,12 @@ OMNIBUS_RUBYGEMS_AT_LATEST_VERSION = { # add gems to the output of bundle outdated here and we'll parse it to get the # list of outdated gems. # -# We're starting with debt here, but don't want it to get worse. +# gherkin - expected to update with new cucumber (and foodcritic?) release +# jwt - expected to update with new oauth2 release +# mini_portile2 - should go away *entirely* with new nokogiri release (not a dep anymore) +# slop - expected to disappear with new pry release # ACCEPTABLE_OUTDATED_GEMS = %w{ - activesupport gherkin jwt mini_portile2 @@ -98,7 +100,6 @@ GEMS_ALLOWED_TO_FLOAT = [ # INSTALL_WITHOUT_GROUPS = %w{ changelog - compat_testing development docgen guard -- cgit v1.2.1