summaryrefslogtreecommitdiff
path: root/tasks
diff options
context:
space:
mode:
authorJohn Keiser <john@johnkeiser.com>2016-04-19 09:05:59 -0700
committerJohn Keiser <john@johnkeiser.com>2016-04-19 11:38:26 -0700
commit0ce002d47405c0178b1016a8d803e13e5cfd823e (patch)
tree53f021322cdf9e864f700abf478da66027ccb1f5 /tasks
parent02ec1e15c6ca5166161e2a1fb33d8d8ffefa3dc5 (diff)
downloadchef-0ce002d47405c0178b1016a8d803e13e5cfd823e.tar.gz
Re-add activesupport testsjk/activesupport-tests
Diffstat (limited to 'tasks')
-rwxr-xr-xtasks/bin/run_chef_tests12
-rw-r--r--tasks/bundle.rb24
-rw-r--r--tasks/dependencies.rb28
-rw-r--r--tasks/rspec.rb3
4 files changed, 37 insertions, 30 deletions
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|