Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conditionally pass test suites #2028

Closed
wants to merge 13 commits into from
52 changes: 26 additions & 26 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,10 @@ jobs:
command: cd spec/decidim_dummy_app && RAILS_ENV=test bundle exec rake db:create db:schema:load
- run:
name: Run core JS tests
command: npm test -- decidim-core
command: ./.circleci/run_tests.sh decidim-core "npm test -- decidim-core"
- run:
name: Run core RSpec
command: cd decidim-core && bundle exec rake
command: ./.circleci/run_tests.sh decidim-core "cd decidim-core && bundle exec rake"
- store_artifacts:
path: /decidim/spec/decidim_dummy_app/tmp/capybara
assemblies:
Expand All @@ -145,10 +145,10 @@ jobs:
command: cd spec/decidim_dummy_app && RAILS_ENV=test bundle exec rake db:create db:schema:load
- run:
name: Run assemblies JS tests
command: npm test -- decidim-assemblies
command: ./.circleci/run_tests.sh decidim-assemblies "npm test -- decidim-assemblies"
- run:
name: Run assemblies RSpec
command: cd decidim-assemblies && bundle exec rake
command: ./.circleci/run_tests.sh decidim-assemblies "cd decidim-assemblies && bundle exec rake"
- store_artifacts:
path: /decidim/spec/decidim_dummy_app/tmp/capybara
api:
Expand All @@ -165,10 +165,10 @@ jobs:
command: cd spec/decidim_dummy_app && RAILS_ENV=test bundle exec rake db:create db:schema:load
- run:
name: Run api JS tests
command: npm test -- decidim-api
command: ./.circleci/run_tests.sh decidim-api "npm test -- decidim-api"
- run:
name: Run api RSpec
command: cd decidim-api && bundle exec rake
command: ./.circleci/run_tests.sh decidim-api "cd decidim-api && bundle exec rake"
- store_artifacts:
path: /decidim/spec/decidim_dummy_app/tmp/capybara
processes:
Expand All @@ -185,10 +185,10 @@ jobs:
command: cd spec/decidim_dummy_app && RAILS_ENV=test bundle exec rake db:create db:schema:load
- run:
name: Run participatory_processes JS tests
command: npm test -- decidim-participatory_processes
command: ./.circleci/run_tests.sh decidim-participatory_processes "npm test -- decidim-participatory_processes"
- run:
name: Run participatory_processes RSpec
command: cd decidim-participatory_processes && bundle exec rake
command: ./.circleci/run_tests.sh decidim-participatory_processes "cd decidim-participatory_processes && bundle exec rake"
- store_artifacts:
path: /decidim/spec/decidim_dummy_app/tmp/capybara
admin:
Expand All @@ -205,10 +205,10 @@ jobs:
command: cd spec/decidim_dummy_app && RAILS_ENV=test bundle exec rake db:create db:schema:load
- run:
name: Run admin JS tests
command: npm test -- decidim-admin
command: ./.circleci/run_tests.sh decidim-admin "npm test -- decidim-admin"
- run:
name: Run admin RSpec
command: cd decidim-admin && bundle exec rake
command: ./.circleci/run_tests.sh decidim-admin "cd decidim-admin && bundle exec rake"
- store_artifacts:
path: /decidim/spec/decidim_dummy_app/tmp/capybara
system:
Expand All @@ -225,10 +225,10 @@ jobs:
command: cd spec/decidim_dummy_app && RAILS_ENV=test bundle exec rake db:create db:schema:load
- run:
name: Run system JS tests
command: npm test -- decidim-system
command: ./.circleci/run_tests.sh decidim-system "npm test -- decidim-system"
- run:
name: Run system RSpec
command: cd decidim-system && bundle exec rake
command: ./.circleci/run_tests.sh decidim-system "cd decidim-system && bundle exec rake"
- store_artifacts:
path: /decidim/spec/decidim_dummy_app/tmp/capybara
proposals:
Expand All @@ -245,10 +245,10 @@ jobs:
command: cd spec/decidim_dummy_app && RAILS_ENV=test bundle exec rake db:create db:schema:load
- run:
name: Run proposals JS tests
command: npm test -- decidim-proposals
command: ./.circleci/run_tests.sh decidim-proposals "npm test -- decidim-proposals"
- run:
name: Run proposals RSpec
command: cd decidim-proposals && bundle exec rake
command: ./.circleci/run_tests.sh decidim-proposals "cd decidim-proposals && bundle exec rake"
- store_artifacts:
path: /decidim/spec/decidim_dummy_app/tmp/capybara
comments:
Expand All @@ -265,10 +265,10 @@ jobs:
command: cd spec/decidim_dummy_app && RAILS_ENV=test bundle exec rake db:create db:schema:load
- run:
name: Run comments JS tests
command: npm test -- decidim-comments
command: ./.circleci/run_tests.sh decidim-comments "npm test -- decidim-comments"
- run:
name: Run comments RSpec
command: cd decidim-comments && bundle exec rake
command: ./.circleci/run_tests.sh decidim-comments "cd decidim-comments && bundle exec rake"
- store_artifacts:
path: /decidim/spec/decidim_dummy_app/tmp/capybara
meetings:
Expand All @@ -285,10 +285,10 @@ jobs:
command: cd spec/decidim_dummy_app && RAILS_ENV=test bundle exec rake db:create db:schema:load
- run:
name: Run meetings JS tests
command: npm test -- decidim-meetings
command: ./.circleci/run_tests.sh decidim-meetings "npm test -- decidim-meetings"
- run:
name: Run meetings RSpec
command: cd decidim-meetings && bundle exec rake
command: ./.circleci/run_tests.sh decidim-meetings "cd decidim-meetings && bundle exec rake"
- store_artifacts:
path: /decidim/spec/decidim_dummy_app/tmp/capybara
pages:
Expand All @@ -305,10 +305,10 @@ jobs:
command: cd spec/decidim_dummy_app && RAILS_ENV=test bundle exec rake db:create db:schema:load
- run:
name: Run pages JS tests
command: npm test -- decidim-pages
command: ./.circleci/run_tests.sh decidim-pages "npm test -- decidim-pages"
- run:
name: Run pages RSpec
command: cd decidim-pages && bundle exec rake
command: ./.circleci/run_tests.sh decidim-pages "cd decidim-pages && bundle exec rake"
- store_artifacts:
path: /decidim/spec/decidim_dummy_app/tmp/capybara
accountability:
Expand All @@ -325,10 +325,10 @@ jobs:
command: cd spec/decidim_dummy_app && RAILS_ENV=test bundle exec rake db:create db:schema:load
- run:
name: Run accountability JS tests
command: npm test -- decidim-accountability
command: ./.circleci/run_tests.sh decidim-accountability "npm test -- decidim-accountability"
- run:
name: Run accountability RSpec
command: cd decidim-accountability && bundle exec rake
command: ./.circleci/run_tests.sh decidim-accountability "cd decidim-accountability && bundle exec rake"
- store_artifacts:
path: /decidim/spec/decidim_dummy_app/tmp/capybara
budgets:
Expand All @@ -345,10 +345,10 @@ jobs:
command: cd spec/decidim_dummy_app && RAILS_ENV=test bundle exec rake db:create db:schema:load
- run:
name: Run budgets JS tests
command: npm test -- decidim-budgets
command: ./.circleci/run_tests.sh decidim-budgets "npm test -- decidim-budgets"
- run:
name: Run budgets RSpec
command: cd decidim-budgets && bundle exec rake
command: ./.circleci/run_tests.sh decidim-budgets "cd decidim-budgets && bundle exec rake"
- store_artifacts:
path: /decidim/spec/decidim_dummy_app/tmp/capybara
surveys:
Expand All @@ -365,10 +365,10 @@ jobs:
command: cd spec/decidim_dummy_app && RAILS_ENV=test bundle exec rake db:create db:schema:load
- run:
name: Run surveys JS tests
command: npm test -- decidim-surveys
command: ./.circleci/run_tests.sh decidim-surveys "npm test -- decidim-surveys"
- run:
name: Run surveys RSpec
command: cd decidim-surveys && bundle exec rake
command: ./.circleci/run_tests.sh decidim-surveys "cd decidim-surveys && bundle exec rake"
- store_artifacts:
path: /decidim/spec/decidim_dummy_app/tmp/capybara

Expand Down
18 changes: 18 additions & 0 deletions .circleci/run_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

engine=$1
testCommand=$2
branch=`git rev-parse --abbrev-ref HEAD`

if [ "$branch" = "master" ]; then
echo "YES, IT'S MASTER!!"
eval $testCommand
elif git diff --name-only origin/master...$branch | grep "^decidim-core" ; then
echo "YES, CORE IS BEING MODIFIED"
eval $testCommand
elif git diff --name-only origin/master...$branch | grep "^${engine}" ; then
echo "YES, THIS ENGINE IS BEING MODIFIED"
eval $testCommand
else
echo "NO"
fi
13 changes: 13 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,41 +65,54 @@ ignore:

flags:
core:
assume: true
paths:
- decidim-core/
assemblies:
assume: true
paths:
- decidim-assemblies/
api:
assume: true
paths:
- decidim-api/
processes:
assume: true
paths:
- decidim-participatory_processes/
admin:
assume: true
paths:
- decidim-admin/
system:
assume: true
paths:
- decidim-system/
proposals:
assume: true
paths:
- decidim-proposals/
comments:
assume: true
paths:
- decidim-comments/
meetings:
assume: true
paths:
- decidim-meetings/
pages:
assume: true
paths:
- decidim-pages/
accountability:
assume: true
paths:
- decidim-accountability/
budgets:
assume: true
paths:
- decidim-budgets/
surveys:
assume: true
paths:
- decidim-surveys/
Empty file added decidim-proposals/fake_file
Empty file.