aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Wilmott <p@p8952.info>2015-02-12 23:54:19 +0000
committerPeter Wilmott <p@p8952.info>2015-02-13 00:12:11 +0000
commitf1773af4f9e933dcc4bd5a23d8f173b2b0b6a214 (patch)
tree653d39a3b20aa487bc8b0299a9e6df9a0b08ff08
parentFix the way empty directories are tracked (diff)
downloadruby-tinderbox-f1773af4f9e933dcc4bd5a23d8f173b2b0b6a214.tar.gz
ruby-tinderbox-f1773af4f9e933dcc4bd5a23d8f173b2b0b6a214.tar.bz2
ruby-tinderbox-f1773af4f9e933dcc4bd5a23d8f173b2b0b6a214.zip
Add a rake task which only runs a limited number of repoman checks
-rw-r--r--web/Rakefile17
-rw-r--r--web/lib/ci.rb2
-rw-r--r--web/lib/repoman.rb8
3 files changed, 19 insertions, 8 deletions
diff --git a/web/Rakefile b/web/Rakefile
index 0140c84..86aa390 100644
--- a/web/Rakefile
+++ b/web/Rakefile
@@ -53,6 +53,9 @@ namespace :db do
end
namespace :docker do
+ num_of_packages = ENV['NUM_OF_PACKAGES'].to_i
+ num_of_packages = 5 if num_of_packages == 0
+
desc 'Build a docker image to use with subsequent tasks'
task :setup do
Docker.options[:read_timeout] = 36_000
@@ -71,8 +74,7 @@ namespace :docker do
run_ci(@docker_image, :all)
end
- desc 'Build and test a fixed number of packages (num_of_packages=5)'
- num_of_packages = ENV['num_of_packages'].to_i
+ desc 'Build and test a fixed number of packages (NUM_OF_PACKAGES=5)'
task :run_ci_some do
run_ci(@docker_image, num_of_packages)
end
@@ -82,8 +84,13 @@ namespace :docker do
run_ci(@docker_image, :untested)
end
- desc 'Run repoman against the current and next targets for all packages'
- task :run_repoman do
- run_repoman(@docker_image)
+ desc 'QA test all packages'
+ task :run_repoman_all do
+ run_repoman(@docker_image, :all)
+ end
+
+ desc 'QA test a fixed number of packages (NUM_OF_PACKAGES=5)'
+ task :run_repoman_some do
+ run_repoman(@docker_image, num_of_packages)
end
end
diff --git a/web/lib/ci.rb b/web/lib/ci.rb
index 153cc2f..300ba53 100644
--- a/web/lib/ci.rb
+++ b/web/lib/ci.rb
@@ -6,8 +6,6 @@ def run_ci(docker_image, num_of_packages)
if num_of_packages == :all
packages = packages
- elsif num_of_packages == 0
- packages = packages.sample(5)
elsif num_of_packages == :untested
packages = []
Package.exclude(tested: true).order { [category, lower(name), version] }.each do |package|
diff --git a/web/lib/repoman.rb b/web/lib/repoman.rb
index ae512fd..6808340 100644
--- a/web/lib/repoman.rb
+++ b/web/lib/repoman.rb
@@ -1,4 +1,4 @@
-def run_repoman(docker_image)
+def run_repoman(docker_image, num_of_packages)
packages = []
Package.order { [category, lower(name), version] }.each do |package|
target = ''
@@ -22,6 +22,12 @@ def run_repoman(docker_image)
packages << "#{category} #{name} #{version}#{revision} #{target} #{next_target}"
end
+ if num_of_packages == :all
+ packages = packages
+ else
+ packages = packages.sample(num_of_packages)
+ end
+
packages = packages.uniq
packages.each do |package|
package = "'" + package + "'"