Skip to content

Commit 4ccd3b1

Browse files
committed
add rake tasks to run every module only
ci skip
1 parent 2308085 commit 4ccd3b1

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

‎lib/tasks/test.rake‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# frozen_string_literal: true
2+
3+
namespace :test do
4+
modules = %w{
5+
gobierto_admin
6+
gobierto_attachments
7+
gobierto_budgets
8+
gobierto_calendars
9+
gobierto_cms gobierto_common
10+
gobierto_core
11+
gobierto_dashboards
12+
gobierto_data
13+
gobierto_exports
14+
gobierto_indicators
15+
gobierto_investments
16+
gobierto_observatory
17+
gobierto_people
18+
gobierto_plans
19+
gobierto_visualizations
20+
gobierto_others
21+
gobierto_engines
22+
}
23+
24+
modules.each do |mod|
25+
desc "run test for module #{mod}.safe_constantize "
26+
task "#{mod}".to_sym, [:fail_fast_enable] => :environment do |_t, args|
27+
files = `find test -path '*#{mod}*' -name '*_test.rb' | grep -v '#{mod}\/gobierto_'`.gsub("\n"," ")
28+
cmd = "bin/rails test #{files} #{"--fail-fast" if args[:fail_fast_enable]}"
29+
puts cmd
30+
puts `#{cmd}`
31+
end
32+
end
33+
end

0 commit comments

Comments
 (0)