Skip to content

Commit

Permalink
Re-add activesupport tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jkeiser committed Apr 19, 2016
1 parent 02ec1e1 commit 0ce002d
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 45 deletions.
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
#
Expand Down
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 0 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -411,7 +407,6 @@ PLATFORMS
x86-mingw32

DEPENDENCIES
activesupport (< 4.0.0)
appbundler
bundler
bundler-audit!
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 9 additions & 3 deletions tasks/bin/run_chef_tests
Original file line number Diff line number Diff line change
Expand Up @@ -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
24 changes: 24 additions & 0 deletions tasks/bundle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,30 @@
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."
Expand Down
28 changes: 2 additions & 26 deletions tasks/dependencies.rb
Original file line number Diff line number Diff line change
Expand Up @@ -141,31 +141,7 @@ def berksfile_lock_task(task_name, dirs: [])
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"]
3 changes: 2 additions & 1 deletion tasks/rspec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@
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|
Expand Down
7 changes: 4 additions & 3 deletions version_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,12 @@
# 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
Expand Down Expand Up @@ -98,7 +100,6 @@
#
INSTALL_WITHOUT_GROUPS = %w{
changelog
compat_testing
development
docgen
guard
Expand Down

0 comments on commit 0ce002d

Please sign in to comment.