Skip to content

Commit

Permalink
add rake tasks to run every module only
Browse files Browse the repository at this point in the history
ci skip
  • Loading branch information
stbnrivas committed Apr 27, 2021
1 parent 2308085 commit 4ccd3b1
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions lib/tasks/test.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# frozen_string_literal: true

namespace :test do
modules = %w{
gobierto_admin
gobierto_attachments
gobierto_budgets
gobierto_calendars
gobierto_cms gobierto_common
gobierto_core
gobierto_dashboards
gobierto_data
gobierto_exports
gobierto_indicators
gobierto_investments
gobierto_observatory
gobierto_people
gobierto_plans
gobierto_visualizations
gobierto_others
gobierto_engines
}

modules.each do |mod|
desc "run test for module #{mod}.safe_constantize "
task "#{mod}".to_sym, [:fail_fast_enable] => :environment do |_t, args|
files = `find test -path '*#{mod}*' -name '*_test.rb' | grep -v '#{mod}\/gobierto_'`.gsub("\n"," ")
cmd = "bin/rails test #{files} #{"--fail-fast" if args[:fail_fast_enable]}"
puts cmd
puts `#{cmd}`
end
end
end

0 comments on commit 4ccd3b1

Please sign in to comment.