From 4ccd3b1fa90d220a8a706a53195dc57177915f8a Mon Sep 17 00:00:00 2001 From: stbn Date: Sat, 24 Apr 2021 15:03:35 +0200 Subject: [PATCH] add rake tasks to run every module only ci skip --- lib/tasks/test.rake | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 lib/tasks/test.rake diff --git a/lib/tasks/test.rake b/lib/tasks/test.rake new file mode 100644 index 0000000000..254962d6a3 --- /dev/null +++ b/lib/tasks/test.rake @@ -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