From 80a58919a2c86eacc6178df5586831383fc8cfcd Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Thu, 20 Jul 2023 15:16:15 -0300 Subject: [PATCH 001/160] Add knapsack gem --- Gemfile | 1 + Gemfile.lock | 3 +++ Rakefile | 2 ++ knapsack_rspec_report.json | 31 +++++++++++++++++++++++++++++++ spec/spec_helper.rb | 3 +++ 5 files changed, 40 insertions(+) create mode 100644 knapsack_rspec_report.json diff --git a/Gemfile b/Gemfile index 72a531a1..88e064cf 100644 --- a/Gemfile +++ b/Gemfile @@ -38,6 +38,7 @@ group :development, :test do gem 'annotate', '~> 3.2', '>= 3.0.3' gem 'dotenv-rails', '~> 2.7.6' gem 'factory_bot_rails', '~> 5.1', '>= 5.1.1' + gem 'knapsack', '~> 4.0.0', '>= 4.0.0' gem 'pry-byebug', '~> 3.9', platform: :mri gem 'pry-rails', '~> 0.3.9' gem 'rspec_api_documentation', '~> 6.1.0' diff --git a/Gemfile.lock b/Gemfile.lock index 46c957a8..76b840a3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -245,6 +245,8 @@ GEM activerecord kaminari-core (= 1.2.2) kaminari-core (1.2.2) + knapsack (4.0.0) + rake kwalify (0.7.2) launchy (2.5.0) addressable (~> 2.7) @@ -497,6 +499,7 @@ DEPENDENCIES flipper-ui (~> 0.28.0) i18n-tasks (~> 0.9.30) jbuilder (~> 2.10) + knapsack (~> 4.0.0, >= 4.0.0) letter_opener (~> 1.7) listen (~> 3.2) oj (~> 3.9, >= 3.9.2) diff --git a/Rakefile b/Rakefile index e85f9139..ab7fb4ce 100644 --- a/Rakefile +++ b/Rakefile @@ -4,3 +4,5 @@ require_relative 'config/application' Rails.application.load_tasks + +Knapsack.load_tasks if defined?(Knapsack) diff --git a/knapsack_rspec_report.json b/knapsack_rspec_report.json new file mode 100644 index 00000000..76cb2392 --- /dev/null +++ b/knapsack_rspec_report.json @@ -0,0 +1,31 @@ +{ + "spec/requests/api/v1/passwords/edit_spec.rb": 0.18011699999988195, + "spec/requests/api/v1/sessions/destroy_spec.rb": 0.3005360000006476, + "spec/acceptance/settings_spec.rb": 0.16657500000110304, + "spec/routing/registrations_routing_spec.rb": 0.003090999998676125, + "spec/requests/api/v1/users/update_spec.rb": 0.9995309999994788, + "spec/policies/admin_user_policy_spec.rb": 0.01673800000025949, + "spec/requests/api/v1/passwords/create_spec.rb": 0.14932799999951385, + "spec/routing/sessions_routing_spec.rb": 0.0020789999998669373, + "spec/routing/user_routing_spec.rb": 0.0018849999996746192, + "spec/requests/api/v1/passwords/update_spec.rb": 0.44218199999886565, + "spec/acceptance/sessions_spec.rb": 0.5352300000013201, + "spec/requests/api/v1/status_spec.rb": 0.019486999999571708, + "spec/policies/admin/application_policy_spec.rb": 0.009938999999576481, + "spec/acceptance/passwords_spec.rb": 0.6204920000000129, + "spec/policies/admin/user_policy_spec.rb": 0.009479000000283122, + "spec/policies/application_policy_spec.rb": 0.008241999999881955, + "spec/policies/user_policy_spec.rb": 0.015247999999701278, + "spec/requests/api/v1/users/create_spec.rb": 0.4823369999994611, + "spec/policies/admin/page_policy_spec.rb": 0.01077400000031048, + "spec/acceptance/status_spec.rb": 0.009255000000848668, + "spec/acceptance/users_spec.rb": 0.5125680000001012, + "spec/decorators/user_decorator_spec.rb": 0.005363000000215834, + "spec/models/user_spec.rb": 0.05257699999856413, + "spec/requests/api/v1/sessions/create_spec.rb": 0.5477680000003602, + "spec/requests/api/v1/users/show_spec.rb": 0.5338000000010652, + "spec/mailers/application_mailer_spec.rb": 0.0028139999994891696, + "spec/requests/api/v1/feature_flags_spec.rb": 0.04056499999933294, + "spec/policies/admin/admin_user_policy_spec.rb": 0.004445000000487198, + "spec/requests/api/v1/settings_spec.rb": 0.04358700000011595 +} \ No newline at end of file diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index a0cf45ab..10539563 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -4,10 +4,13 @@ require 'factory_bot_rails' require 'helpers' +require 'knapsack' require 'webmock/rspec' require 'shoulda/matchers' require 'pundit/rspec' +Knapsack::Adapters::RSpecAdapter.bind + FactoryBot.factories.clear FactoryBot.reload From d4672b1bbf9b6c5824611572f840c74c0526616b Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Thu, 20 Jul 2023 15:22:20 -0300 Subject: [PATCH 002/160] Add total nodes to ci workflow --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 69920bc6..5d630b4a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,6 +23,8 @@ jobs: env: RAILS_ENV: test CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} + CI_NODE_TOTAL: 2 + CI_NODE_INDEX: 0 steps: - name: Checkout code From c0f6052488028d30756bb37eba2e0a43e8fbba3d Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Thu, 20 Jul 2023 15:24:53 -0300 Subject: [PATCH 003/160] empty commit to run CI From 62f8ea906f90b5161c817ae8242050ece7b4fd62 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Thu, 20 Jul 2023 15:39:58 -0300 Subject: [PATCH 004/160] empty commit to run CI --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5d630b4a..d530f988 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: env: RAILS_ENV: test CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} - CI_NODE_TOTAL: 2 + CI_NODE_TOTAL: 10 CI_NODE_INDEX: 0 steps: From 18f2c6c80a3effcaa4698ab74479fd74e122ce70 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Thu, 20 Jul 2023 15:51:56 -0300 Subject: [PATCH 005/160] empty commit to run CI --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d530f988..e2e3fba8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: env: RAILS_ENV: test CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} - CI_NODE_TOTAL: 10 + CI_NODE_TOTAL: 0 CI_NODE_INDEX: 0 steps: From a40547cce9e145e93dfc13ef4f50440a6dae79a8 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Thu, 20 Jul 2023 15:59:47 -0300 Subject: [PATCH 006/160] empty commit to run CI --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e2e3fba8..92ada062 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: env: RAILS_ENV: test CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} - CI_NODE_TOTAL: 0 + CI_NODE_TOTAL: 1 CI_NODE_INDEX: 0 steps: From 691f400b07288c1cf1016a5a021a32bea9e9e1d4 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Thu, 20 Jul 2023 16:25:51 -0300 Subject: [PATCH 007/160] Update CI setup --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 92ada062..ddd5de97 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,7 +53,7 @@ jobs: bundle exec rake code:analysis - name: Run Tests run: | - bundle exec rspec + bundle exec rake knapsack:rspec - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From 2e624f074dec28f3e6d4d0a0ff49b185a82ab98b Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Tue, 1 Aug 2023 09:56:56 -0300 Subject: [PATCH 008/160] Move CI_NODE_TOTAL to secrets --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ddd5de97..498b1a0c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: env: RAILS_ENV: test CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} - CI_NODE_TOTAL: 1 + CI_NODE_TOTAL: ${{ secrets.CI_NODE_TOTAL }} CI_NODE_INDEX: 0 steps: From 27a4dc0c7ad4a7b466b4c1c63543f6c8bee3dae9 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Tue, 1 Aug 2023 10:00:03 -0300 Subject: [PATCH 009/160] Move CI_NODE_TOTAL to secrets --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 498b1a0c..5f1a257c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: env: RAILS_ENV: test CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} - CI_NODE_TOTAL: ${{ secrets.CI_NODE_TOTAL }} + CI_NODE_TOTAL: ${{ secrets.CI_NODE_TOTAL }} || "1" CI_NODE_INDEX: 0 steps: From fc2d158eb4e8c68b4f4d39660f843a88119224a3 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Tue, 1 Aug 2023 10:06:17 -0300 Subject: [PATCH 010/160] Move CI_NODE_TOTAL to secrets --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f1a257c..23349081 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: env: RAILS_ENV: test CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} - CI_NODE_TOTAL: ${{ secrets.CI_NODE_TOTAL }} || "1" + CI_NODE_TOTAL: ${{ secrets.CI_NODE_TOTAL }} | "1" CI_NODE_INDEX: 0 steps: From 0ebfcb9a1e31ef2e6d428bd753a0a876ceab24c9 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Tue, 1 Aug 2023 10:09:05 -0300 Subject: [PATCH 011/160] Move CI_NODE_TOTAL to secrets --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 23349081..c92afbe1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,8 +23,8 @@ jobs: env: RAILS_ENV: test CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} - CI_NODE_TOTAL: ${{ secrets.CI_NODE_TOTAL }} | "1" - CI_NODE_INDEX: 0 + CI_NODE_TOTAL: ${{ secrets.CI_NODE_TOTAL }} + CI_NODE_INDEX: 1 steps: - name: Checkout code From 51eb9f87ca8a84671a69254b235cf29ff7b7f56e Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Tue, 1 Aug 2023 10:11:02 -0300 Subject: [PATCH 012/160] Move CI_NODE_TOTAL to secrets --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c92afbe1..5e637be3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,8 +23,8 @@ jobs: env: RAILS_ENV: test CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} - CI_NODE_TOTAL: ${{ secrets.CI_NODE_TOTAL }} - CI_NODE_INDEX: 1 + CI_NODE_TOTAL: ${{ secrets.CI_NODE_TOTAL }} + CI_NODE_INDEX: 0 steps: - name: Checkout code From a23f5ec1556a91ea051b6fdcf06132f6fd99b337 Mon Sep 17 00:00:00 2001 From: Juan Pascual Date: Mon, 7 Aug 2023 15:39:36 -0300 Subject: [PATCH 013/160] split tests and linters --- .github/workflows/ci.yml | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 69920bc6..c79517b7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,23 @@ name: CI on: [push] jobs: - build: + linters: + name: Linters + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + - name: I18n Health + run: bundle exec i18n-tasks health + - name: Run Code Analysis + run: | + bundle exec rake code_analysis + tests: + name: Tests runs-on: ubuntu-latest services: @@ -19,7 +35,7 @@ jobs: --health-interval 10s --health-timeout 5s --health-retries 5 - + env: RAILS_ENV: test CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} @@ -35,7 +51,7 @@ jobs: run: | curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter chmod +x ./cc-test-reporter - ./cc-test-reporter before-build + ./cc-test-reporter before-build - name: Setup Database run: | cp .github/test_db/config/database.yml config/database.yml @@ -44,11 +60,6 @@ jobs: uses: rootstrap/check_untracked_changes@v1 with: path: "./db/schema.rb" - - name: I18n Health - run: bundle exec i18n-tasks health - - name: Run Code Analysis - run: | - bundle exec rake code:analysis - name: Run Tests run: | bundle exec rspec From b685aa8fc57ce3d661fe00065b265768f31f81b0 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Tue, 8 Aug 2023 12:24:35 -0300 Subject: [PATCH 014/160] Fix --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5e637be3..ddd5de97 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: env: RAILS_ENV: test CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} - CI_NODE_TOTAL: ${{ secrets.CI_NODE_TOTAL }} + CI_NODE_TOTAL: 1 CI_NODE_INDEX: 0 steps: From 57e4b7aaef1c015d19dce6bfcd4d2221727611a0 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Tue, 8 Aug 2023 16:25:03 -0300 Subject: [PATCH 015/160] Remove advertisements and warning when running CI --- Gemfile | 2 +- Gemfile.lock | 2 +- knapsack_rspec_report.json | 58 +++++++++++++++++++------------------- spec/spec_helper.rb | 2 ++ 4 files changed, 33 insertions(+), 31 deletions(-) diff --git a/Gemfile b/Gemfile index 88e064cf..4c6a26db 100644 --- a/Gemfile +++ b/Gemfile @@ -38,7 +38,7 @@ group :development, :test do gem 'annotate', '~> 3.2', '>= 3.0.3' gem 'dotenv-rails', '~> 2.7.6' gem 'factory_bot_rails', '~> 5.1', '>= 5.1.1' - gem 'knapsack', '~> 4.0.0', '>= 4.0.0' + gem 'knapsack', '~> 4.0.0' gem 'pry-byebug', '~> 3.9', platform: :mri gem 'pry-rails', '~> 0.3.9' gem 'rspec_api_documentation', '~> 6.1.0' diff --git a/Gemfile.lock b/Gemfile.lock index 76b840a3..68d26d56 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -499,7 +499,7 @@ DEPENDENCIES flipper-ui (~> 0.28.0) i18n-tasks (~> 0.9.30) jbuilder (~> 2.10) - knapsack (~> 4.0.0, >= 4.0.0) + knapsack (~> 4.0.0) letter_opener (~> 1.7) listen (~> 3.2) oj (~> 3.9, >= 3.9.2) diff --git a/knapsack_rspec_report.json b/knapsack_rspec_report.json index 76cb2392..4f0d72b1 100644 --- a/knapsack_rspec_report.json +++ b/knapsack_rspec_report.json @@ -1,31 +1,31 @@ { - "spec/requests/api/v1/passwords/edit_spec.rb": 0.18011699999988195, - "spec/requests/api/v1/sessions/destroy_spec.rb": 0.3005360000006476, - "spec/acceptance/settings_spec.rb": 0.16657500000110304, - "spec/routing/registrations_routing_spec.rb": 0.003090999998676125, - "spec/requests/api/v1/users/update_spec.rb": 0.9995309999994788, - "spec/policies/admin_user_policy_spec.rb": 0.01673800000025949, - "spec/requests/api/v1/passwords/create_spec.rb": 0.14932799999951385, - "spec/routing/sessions_routing_spec.rb": 0.0020789999998669373, - "spec/routing/user_routing_spec.rb": 0.0018849999996746192, - "spec/requests/api/v1/passwords/update_spec.rb": 0.44218199999886565, - "spec/acceptance/sessions_spec.rb": 0.5352300000013201, - "spec/requests/api/v1/status_spec.rb": 0.019486999999571708, - "spec/policies/admin/application_policy_spec.rb": 0.009938999999576481, - "spec/acceptance/passwords_spec.rb": 0.6204920000000129, - "spec/policies/admin/user_policy_spec.rb": 0.009479000000283122, - "spec/policies/application_policy_spec.rb": 0.008241999999881955, - "spec/policies/user_policy_spec.rb": 0.015247999999701278, - "spec/requests/api/v1/users/create_spec.rb": 0.4823369999994611, - "spec/policies/admin/page_policy_spec.rb": 0.01077400000031048, - "spec/acceptance/status_spec.rb": 0.009255000000848668, - "spec/acceptance/users_spec.rb": 0.5125680000001012, - "spec/decorators/user_decorator_spec.rb": 0.005363000000215834, - "spec/models/user_spec.rb": 0.05257699999856413, - "spec/requests/api/v1/sessions/create_spec.rb": 0.5477680000003602, - "spec/requests/api/v1/users/show_spec.rb": 0.5338000000010652, - "spec/mailers/application_mailer_spec.rb": 0.0028139999994891696, - "spec/requests/api/v1/feature_flags_spec.rb": 0.04056499999933294, - "spec/policies/admin/admin_user_policy_spec.rb": 0.004445000000487198, - "spec/requests/api/v1/settings_spec.rb": 0.04358700000011595 + "spec/policies/admin/page_policy_spec.rb": 0.038240999972913414, + "spec/routing/sessions_routing_spec.rb": 0.006703999999444932, + "spec/requests/api/v1/users/create_spec.rb": 0.5093869999982417, + "spec/acceptance/settings_spec.rb": 0.17437299998709932, + "spec/acceptance/sessions_spec.rb": 0.5090029999846593, + "spec/acceptance/status_spec.rb": 0.009465000010095537, + "spec/requests/api/v1/sessions/destroy_spec.rb": 0.2923869999940507, + "spec/policies/admin/user_policy_spec.rb": 0.020087999990209937, + "spec/routing/registrations_routing_spec.rb": 0.001361000002361834, + "spec/policies/admin/application_policy_spec.rb": 0.011096000031102449, + "spec/policies/admin_user_policy_spec.rb": 0.009194999991450459, + "spec/routing/user_routing_spec.rb": 0.0026309999520890415, + "spec/requests/api/v1/passwords/update_spec.rb": 0.4883949999930337, + "spec/requests/api/v1/feature_flags_spec.rb": 0.040616000012960285, + "spec/requests/api/v1/settings_spec.rb": 0.0425929999910295, + "spec/requests/api/v1/passwords/create_spec.rb": 0.15221400000154972, + "spec/acceptance/users_spec.rb": 0.5729850000352599, + "spec/policies/user_policy_spec.rb": 0.015309000038541853, + "spec/requests/api/v1/users/update_spec.rb": 0.9842829999979585, + "spec/requests/api/v1/status_spec.rb": 0.01666500000283122, + "spec/policies/application_policy_spec.rb": 0.008917000028304756, + "spec/policies/admin/admin_user_policy_spec.rb": 0.005394000036176294, + "spec/requests/api/v1/sessions/create_spec.rb": 0.49404099996900186, + "spec/decorators/user_decorator_spec.rb": 0.005971000005956739, + "spec/requests/api/v1/passwords/edit_spec.rb": 0.08089700003620237, + "spec/acceptance/passwords_spec.rb": 0.6197870000032708, + "spec/models/user_spec.rb": 0.09392800001660362, + "spec/mailers/application_mailer_spec.rb": 0.0020680000307038426, + "spec/requests/api/v1/users/show_spec.rb": 0.5047900000354275 } \ No newline at end of file diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 10539563..195c9cdb 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -9,6 +9,8 @@ require 'shoulda/matchers' require 'pundit/rspec' +Knapsack.tracker.config(enable_time_offset_warning: false) + Knapsack::Adapters::RSpecAdapter.bind FactoryBot.factories.clear From 316918a121e5fd48db07a4f30787d833bad1fdb9 Mon Sep 17 00:00:00 2001 From: Rodrigo Eizmendi Date: Thu, 10 Aug 2023 12:10:06 -0300 Subject: [PATCH 016/160] move harcoded values to secrets with a default value --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ddd5de97..d331f8fc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,8 +23,8 @@ jobs: env: RAILS_ENV: test CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} - CI_NODE_TOTAL: 1 - CI_NODE_INDEX: 0 + CI_NODE_TOTAL: ${{ secrets.CI_NODE_TOTAL || 1 }} + CI_NODE_INDEX: ${{ secrets.CI_NODE_INDEX || 0 }} steps: - name: Checkout code From 682e2efacba0d6feb7d75e80357d58ac9a681366 Mon Sep 17 00:00:00 2001 From: Juan Pascual Date: Thu, 10 Aug 2023 16:18:20 -0300 Subject: [PATCH 017/160] move I18n Health check to code:analysis --- .github/workflows/ci.yml | 9 ++++++--- lib/tasks/code_analysis.rake | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c79517b7..74b4b0f5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,8 @@ jobs: linters: name: Linters runs-on: ubuntu-latest + env: + RAILS_ENV: test steps: - name: Checkout code uses: actions/checkout@v3 @@ -13,11 +15,12 @@ jobs: uses: ruby/setup-ruby@v1 with: bundler-cache: true - - name: I18n Health - run: bundle exec i18n-tasks health + - name: Setup Database + run: | + cp .github/test_db/config/database.yml config/database.yml - name: Run Code Analysis run: | - bundle exec rake code_analysis + bundle exec rake code:analysis tests: name: Tests runs-on: ubuntu-latest diff --git a/lib/tasks/code_analysis.rake b/lib/tasks/code_analysis.rake index 2cd62e2a..65b4e813 100644 --- a/lib/tasks/code_analysis.rake +++ b/lib/tasks/code_analysis.rake @@ -5,5 +5,6 @@ namespace :code do sh 'bundle exec rubocop .' sh 'bundle exec reek .' sh 'bundle exec rails_best_practices .' + sh 'bundle exec i18n-tasks health' end end From bda5acaa2a02dfa25b680fe6307dbad84b825a0c Mon Sep 17 00:00:00 2001 From: Rodrigo Eizmendi Date: Fri, 11 Aug 2023 15:32:31 -0300 Subject: [PATCH 018/160] try to set matrix strategy --- .github/workflows/ci.yml | 17 +++++++++++++++-- knapsack_rspec_report.json | 2 +- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d331f8fc..853ee7ef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,11 +20,20 @@ jobs: --health-timeout 5s --health-retries 5 + strategy: + fail-fast: false + matrix: + # Set N number of parallel jobs you want to run tests on. + # Use higher number if you have slow tests to split them on more parallel jobs. + # Remember to update ci_node_index below to 0..N-1 + ci_node_total: [4] + # set N-1 indexes for parallel jobs + # When you run 2 parallel jobs then first job will have index 0, the second job will have index 1 etc + ci_node_index: [0, 1, 2, 3] + env: RAILS_ENV: test CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} - CI_NODE_TOTAL: ${{ secrets.CI_NODE_TOTAL || 1 }} - CI_NODE_INDEX: ${{ secrets.CI_NODE_INDEX || 0 }} steps: - name: Checkout code @@ -52,6 +61,10 @@ jobs: run: | bundle exec rake code:analysis - name: Run Tests + env: + KNAPSACK_CI_NODE_TOTAL: ${{ matrix.ci_node_total }} + KNAPSACK_CI_NODE_INDEX: ${{ matrix.ci_node_index }} + KNAPSACK_PRO_LOG_LEVEL: info run: | bundle exec rake knapsack:rspec - name: Check for missing annotations diff --git a/knapsack_rspec_report.json b/knapsack_rspec_report.json index 4f0d72b1..cde01527 100644 --- a/knapsack_rspec_report.json +++ b/knapsack_rspec_report.json @@ -28,4 +28,4 @@ "spec/models/user_spec.rb": 0.09392800001660362, "spec/mailers/application_mailer_spec.rb": 0.0020680000307038426, "spec/requests/api/v1/users/show_spec.rb": 0.5047900000354275 -} \ No newline at end of file +} From fa62ac798b8d284171989c21bfcfe9d57716a0be Mon Sep 17 00:00:00 2001 From: Rodrigo Eizmendi Date: Fri, 11 Aug 2023 15:59:44 -0300 Subject: [PATCH 019/160] queue mode works? --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 853ee7ef..10339e96 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,9 +64,10 @@ jobs: env: KNAPSACK_CI_NODE_TOTAL: ${{ matrix.ci_node_total }} KNAPSACK_CI_NODE_INDEX: ${{ matrix.ci_node_index }} - KNAPSACK_PRO_LOG_LEVEL: info + KNAPSACK_FIXED_QUEUE_SPLIT: true + KNAPSACK_LOG_LEVEL: info run: | - bundle exec rake knapsack:rspec + bundle exec rake knapsack:queue:rspec - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From 8b6591e67013e06cdc819162a58458285c9f231e Mon Sep 17 00:00:00 2001 From: Rodrigo Eizmendi Date: Fri, 11 Aug 2023 16:14:10 -0300 Subject: [PATCH 020/160] vars --- .github/workflows/ci.yml | 7 +++---- spec/spec_helper.rb | 1 - 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 10339e96..77510ddf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,12 +62,11 @@ jobs: bundle exec rake code:analysis - name: Run Tests env: - KNAPSACK_CI_NODE_TOTAL: ${{ matrix.ci_node_total }} - KNAPSACK_CI_NODE_INDEX: ${{ matrix.ci_node_index }} - KNAPSACK_FIXED_QUEUE_SPLIT: true + CI_NODE_TOTAL: ${{ matrix.ci_node_total }} + CI_NODE_INDEX: ${{ matrix.ci_node_index }} KNAPSACK_LOG_LEVEL: info run: | - bundle exec rake knapsack:queue:rspec + bundle exec rake knapsack:rspec - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 195c9cdb..26d70c98 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -10,7 +10,6 @@ require 'pundit/rspec' Knapsack.tracker.config(enable_time_offset_warning: false) - Knapsack::Adapters::RSpecAdapter.bind FactoryBot.factories.clear From 62e0105503ae188e4219d065a7528ae40d621e9a Mon Sep 17 00:00:00 2001 From: grosendo2006 Date: Tue, 25 Jul 2023 19:40:32 -0300 Subject: [PATCH 021/160] add parallel gem --- Gemfile | 1 + Gemfile.lock | 3 +++ config/database.yml.example | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 72a531a1..20f00542 100644 --- a/Gemfile +++ b/Gemfile @@ -38,6 +38,7 @@ group :development, :test do gem 'annotate', '~> 3.2', '>= 3.0.3' gem 'dotenv-rails', '~> 2.7.6' gem 'factory_bot_rails', '~> 5.1', '>= 5.1.1' + gem 'parallel_tests', '~> 4.2' gem 'pry-byebug', '~> 3.9', platform: :mri gem 'pry-rails', '~> 0.3.9' gem 'rspec_api_documentation', '~> 6.1.0' diff --git a/Gemfile.lock b/Gemfile.lock index 46c957a8..330136d2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -285,6 +285,8 @@ GEM orm_adapter (0.5.0) pagy (4.11.0) parallel (1.22.1) + parallel_tests (4.2.1) + parallel parser (3.1.2.1) ast (~> 2.4.1) pg (1.4.3) @@ -501,6 +503,7 @@ DEPENDENCIES listen (~> 3.2) oj (~> 3.9, >= 3.9.2) pagy (~> 4.0) + parallel_tests (~> 4.2) pg (~> 1.1, >= 1.1.4) pg_query (~> 4.2.1) prosopite (~> 1.3.2) diff --git a/config/database.yml.example b/config/database.yml.example index 3c404d9e..4e838b3d 100644 --- a/config/database.yml.example +++ b/config/database.yml.example @@ -13,7 +13,7 @@ development: test: <<: *default - database: sample_project_test + database: sample_project_test<%= ENV['TEST_ENV_NUMBER'] %> production: <<: *default From 413a8c02c9b65998c652098661252d8962a00e6a Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Thu, 20 Jul 2023 15:16:15 -0300 Subject: [PATCH 022/160] Add knapsack gem --- Gemfile | 1 + Gemfile.lock | 3 +++ Rakefile | 2 ++ knapsack_rspec_report.json | 31 +++++++++++++++++++++++++++++++ spec/spec_helper.rb | 3 +++ 5 files changed, 40 insertions(+) create mode 100644 knapsack_rspec_report.json diff --git a/Gemfile b/Gemfile index 3ce02be0..f13fe734 100644 --- a/Gemfile +++ b/Gemfile @@ -40,6 +40,7 @@ group :development, :test do gem 'annotate', '~> 3.2', '>= 3.0.3' gem 'dotenv-rails', '~> 2.7.6' gem 'factory_bot_rails', '~> 6.2' + gem 'knapsack', '~> 4.0.0', '>= 4.0.0' gem 'pry-byebug', '~> 3.9', platform: :mri gem 'pry-rails', '~> 0.3.9' gem 'rspec_api_documentation', '~> 6.1.0' diff --git a/Gemfile.lock b/Gemfile.lock index 30c477e6..ac86b843 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -248,6 +248,8 @@ GEM activerecord kaminari-core (= 1.2.2) kaminari-core (1.2.2) + knapsack (4.0.0) + rake kwalify (0.7.2) language_server-protocol (3.17.0.3) launchy (2.5.0) @@ -517,6 +519,7 @@ DEPENDENCIES flipper-ui (~> 0.28.0) i18n-tasks (~> 1.0.12) jbuilder (~> 2.10) + knapsack (~> 4.0.0, >= 4.0.0) letter_opener (~> 1.7) listen (~> 3.8) oj (~> 3.9, >= 3.9.2) diff --git a/Rakefile b/Rakefile index 488c551f..34b92f93 100644 --- a/Rakefile +++ b/Rakefile @@ -6,3 +6,5 @@ require_relative 'config/application' Rails.application.load_tasks + +Knapsack.load_tasks if defined?(Knapsack) diff --git a/knapsack_rspec_report.json b/knapsack_rspec_report.json new file mode 100644 index 00000000..76cb2392 --- /dev/null +++ b/knapsack_rspec_report.json @@ -0,0 +1,31 @@ +{ + "spec/requests/api/v1/passwords/edit_spec.rb": 0.18011699999988195, + "spec/requests/api/v1/sessions/destroy_spec.rb": 0.3005360000006476, + "spec/acceptance/settings_spec.rb": 0.16657500000110304, + "spec/routing/registrations_routing_spec.rb": 0.003090999998676125, + "spec/requests/api/v1/users/update_spec.rb": 0.9995309999994788, + "spec/policies/admin_user_policy_spec.rb": 0.01673800000025949, + "spec/requests/api/v1/passwords/create_spec.rb": 0.14932799999951385, + "spec/routing/sessions_routing_spec.rb": 0.0020789999998669373, + "spec/routing/user_routing_spec.rb": 0.0018849999996746192, + "spec/requests/api/v1/passwords/update_spec.rb": 0.44218199999886565, + "spec/acceptance/sessions_spec.rb": 0.5352300000013201, + "spec/requests/api/v1/status_spec.rb": 0.019486999999571708, + "spec/policies/admin/application_policy_spec.rb": 0.009938999999576481, + "spec/acceptance/passwords_spec.rb": 0.6204920000000129, + "spec/policies/admin/user_policy_spec.rb": 0.009479000000283122, + "spec/policies/application_policy_spec.rb": 0.008241999999881955, + "spec/policies/user_policy_spec.rb": 0.015247999999701278, + "spec/requests/api/v1/users/create_spec.rb": 0.4823369999994611, + "spec/policies/admin/page_policy_spec.rb": 0.01077400000031048, + "spec/acceptance/status_spec.rb": 0.009255000000848668, + "spec/acceptance/users_spec.rb": 0.5125680000001012, + "spec/decorators/user_decorator_spec.rb": 0.005363000000215834, + "spec/models/user_spec.rb": 0.05257699999856413, + "spec/requests/api/v1/sessions/create_spec.rb": 0.5477680000003602, + "spec/requests/api/v1/users/show_spec.rb": 0.5338000000010652, + "spec/mailers/application_mailer_spec.rb": 0.0028139999994891696, + "spec/requests/api/v1/feature_flags_spec.rb": 0.04056499999933294, + "spec/policies/admin/admin_user_policy_spec.rb": 0.004445000000487198, + "spec/requests/api/v1/settings_spec.rb": 0.04358700000011595 +} \ No newline at end of file diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index cde9663e..9d0f9a82 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -6,10 +6,13 @@ require 'factory_bot_rails' require 'helpers' +require 'knapsack' require 'webmock/rspec' require 'shoulda/matchers' require 'pundit/rspec' +Knapsack::Adapters::RSpecAdapter.bind + FactoryBot.factories.clear FactoryBot.reload From e1bee9deea94daf8ff56a37a8152e4f1511a2eca Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Thu, 20 Jul 2023 15:22:20 -0300 Subject: [PATCH 023/160] Add total nodes to ci workflow --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2e7b9ccb..f79f67dc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,6 +23,8 @@ jobs: env: RAILS_ENV: test CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} + CI_NODE_TOTAL: 2 + CI_NODE_INDEX: 0 steps: - name: Checkout code From 2a8e9501b6fc98cecfa8e152d5a9232a825231aa Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Thu, 20 Jul 2023 15:24:53 -0300 Subject: [PATCH 024/160] empty commit to run CI From d9d162d5d458366f87170fb8556ea475529a57c5 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Thu, 20 Jul 2023 15:39:58 -0300 Subject: [PATCH 025/160] empty commit to run CI --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f79f67dc..577a4bda 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: env: RAILS_ENV: test CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} - CI_NODE_TOTAL: 2 + CI_NODE_TOTAL: 10 CI_NODE_INDEX: 0 steps: From a7488adb043ffc2f53abf9d12c7704c42d4ad8b4 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Thu, 20 Jul 2023 15:51:56 -0300 Subject: [PATCH 026/160] empty commit to run CI --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 577a4bda..0c6391f8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: env: RAILS_ENV: test CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} - CI_NODE_TOTAL: 10 + CI_NODE_TOTAL: 0 CI_NODE_INDEX: 0 steps: From 3701c411fda8c160a71530dbdfb7a291d7444cc7 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Thu, 20 Jul 2023 15:59:47 -0300 Subject: [PATCH 027/160] empty commit to run CI --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0c6391f8..3087bbf7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: env: RAILS_ENV: test CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} - CI_NODE_TOTAL: 0 + CI_NODE_TOTAL: 1 CI_NODE_INDEX: 0 steps: From 0189a643d4161957227ce19e62eeee20db7ed8cd Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Thu, 20 Jul 2023 16:25:51 -0300 Subject: [PATCH 028/160] Update CI setup --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3087bbf7..6b0c0346 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,7 +51,7 @@ jobs: bundle exec rake code:analysis - name: Run Tests run: | - bundle exec rspec + bundle exec rake knapsack:rspec - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From cef0b0a5b5b926729ee9a4f04fe0c404f75102bb Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Tue, 1 Aug 2023 09:56:56 -0300 Subject: [PATCH 029/160] Move CI_NODE_TOTAL to secrets --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6b0c0346..773edb3e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: env: RAILS_ENV: test CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} - CI_NODE_TOTAL: 1 + CI_NODE_TOTAL: ${{ secrets.CI_NODE_TOTAL }} CI_NODE_INDEX: 0 steps: From 203f6f629917e8a3ed7bc13422fce3fe73539c87 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Tue, 1 Aug 2023 10:00:03 -0300 Subject: [PATCH 030/160] Move CI_NODE_TOTAL to secrets --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 773edb3e..2f06f5f5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: env: RAILS_ENV: test CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} - CI_NODE_TOTAL: ${{ secrets.CI_NODE_TOTAL }} + CI_NODE_TOTAL: ${{ secrets.CI_NODE_TOTAL }} || "1" CI_NODE_INDEX: 0 steps: From 00cd67e3447953be7a86ad491efa17af7f1081cb Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Tue, 1 Aug 2023 10:06:17 -0300 Subject: [PATCH 031/160] Move CI_NODE_TOTAL to secrets --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2f06f5f5..0824590e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: env: RAILS_ENV: test CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} - CI_NODE_TOTAL: ${{ secrets.CI_NODE_TOTAL }} || "1" + CI_NODE_TOTAL: ${{ secrets.CI_NODE_TOTAL }} | "1" CI_NODE_INDEX: 0 steps: From c81d622119203aacf34fd057b73f07f8d68c3af3 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Tue, 1 Aug 2023 10:09:05 -0300 Subject: [PATCH 032/160] Move CI_NODE_TOTAL to secrets --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0824590e..8e14444b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,8 +23,8 @@ jobs: env: RAILS_ENV: test CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} - CI_NODE_TOTAL: ${{ secrets.CI_NODE_TOTAL }} | "1" - CI_NODE_INDEX: 0 + CI_NODE_TOTAL: ${{ secrets.CI_NODE_TOTAL }} + CI_NODE_INDEX: 1 steps: - name: Checkout code From f530cc929d6e68e3a1e14553783755d704810e2b Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Tue, 1 Aug 2023 10:11:02 -0300 Subject: [PATCH 033/160] Move CI_NODE_TOTAL to secrets --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8e14444b..f9424e95 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,8 +23,8 @@ jobs: env: RAILS_ENV: test CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} - CI_NODE_TOTAL: ${{ secrets.CI_NODE_TOTAL }} - CI_NODE_INDEX: 1 + CI_NODE_TOTAL: ${{ secrets.CI_NODE_TOTAL }} + CI_NODE_INDEX: 0 steps: - name: Checkout code From bab4613acd21c558345b2ef48fd1bb9047de46e3 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Tue, 8 Aug 2023 12:24:35 -0300 Subject: [PATCH 034/160] Fix --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f9424e95..6b0c0346 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: env: RAILS_ENV: test CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} - CI_NODE_TOTAL: ${{ secrets.CI_NODE_TOTAL }} + CI_NODE_TOTAL: 1 CI_NODE_INDEX: 0 steps: From 219693973bc132c25a44c7968a7a36c4f918b75a Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Tue, 8 Aug 2023 16:25:03 -0300 Subject: [PATCH 035/160] Remove advertisements and warning when running CI --- Gemfile.lock | 2 +- knapsack_rspec_report.json | 58 +++++++++++++++++++------------------- spec/spec_helper.rb | 2 ++ 3 files changed, 32 insertions(+), 30 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index ac86b843..a85b7d17 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -519,7 +519,7 @@ DEPENDENCIES flipper-ui (~> 0.28.0) i18n-tasks (~> 1.0.12) jbuilder (~> 2.10) - knapsack (~> 4.0.0, >= 4.0.0) + knapsack (~> 4.0.0) letter_opener (~> 1.7) listen (~> 3.8) oj (~> 3.9, >= 3.9.2) diff --git a/knapsack_rspec_report.json b/knapsack_rspec_report.json index 76cb2392..4f0d72b1 100644 --- a/knapsack_rspec_report.json +++ b/knapsack_rspec_report.json @@ -1,31 +1,31 @@ { - "spec/requests/api/v1/passwords/edit_spec.rb": 0.18011699999988195, - "spec/requests/api/v1/sessions/destroy_spec.rb": 0.3005360000006476, - "spec/acceptance/settings_spec.rb": 0.16657500000110304, - "spec/routing/registrations_routing_spec.rb": 0.003090999998676125, - "spec/requests/api/v1/users/update_spec.rb": 0.9995309999994788, - "spec/policies/admin_user_policy_spec.rb": 0.01673800000025949, - "spec/requests/api/v1/passwords/create_spec.rb": 0.14932799999951385, - "spec/routing/sessions_routing_spec.rb": 0.0020789999998669373, - "spec/routing/user_routing_spec.rb": 0.0018849999996746192, - "spec/requests/api/v1/passwords/update_spec.rb": 0.44218199999886565, - "spec/acceptance/sessions_spec.rb": 0.5352300000013201, - "spec/requests/api/v1/status_spec.rb": 0.019486999999571708, - "spec/policies/admin/application_policy_spec.rb": 0.009938999999576481, - "spec/acceptance/passwords_spec.rb": 0.6204920000000129, - "spec/policies/admin/user_policy_spec.rb": 0.009479000000283122, - "spec/policies/application_policy_spec.rb": 0.008241999999881955, - "spec/policies/user_policy_spec.rb": 0.015247999999701278, - "spec/requests/api/v1/users/create_spec.rb": 0.4823369999994611, - "spec/policies/admin/page_policy_spec.rb": 0.01077400000031048, - "spec/acceptance/status_spec.rb": 0.009255000000848668, - "spec/acceptance/users_spec.rb": 0.5125680000001012, - "spec/decorators/user_decorator_spec.rb": 0.005363000000215834, - "spec/models/user_spec.rb": 0.05257699999856413, - "spec/requests/api/v1/sessions/create_spec.rb": 0.5477680000003602, - "spec/requests/api/v1/users/show_spec.rb": 0.5338000000010652, - "spec/mailers/application_mailer_spec.rb": 0.0028139999994891696, - "spec/requests/api/v1/feature_flags_spec.rb": 0.04056499999933294, - "spec/policies/admin/admin_user_policy_spec.rb": 0.004445000000487198, - "spec/requests/api/v1/settings_spec.rb": 0.04358700000011595 + "spec/policies/admin/page_policy_spec.rb": 0.038240999972913414, + "spec/routing/sessions_routing_spec.rb": 0.006703999999444932, + "spec/requests/api/v1/users/create_spec.rb": 0.5093869999982417, + "spec/acceptance/settings_spec.rb": 0.17437299998709932, + "spec/acceptance/sessions_spec.rb": 0.5090029999846593, + "spec/acceptance/status_spec.rb": 0.009465000010095537, + "spec/requests/api/v1/sessions/destroy_spec.rb": 0.2923869999940507, + "spec/policies/admin/user_policy_spec.rb": 0.020087999990209937, + "spec/routing/registrations_routing_spec.rb": 0.001361000002361834, + "spec/policies/admin/application_policy_spec.rb": 0.011096000031102449, + "spec/policies/admin_user_policy_spec.rb": 0.009194999991450459, + "spec/routing/user_routing_spec.rb": 0.0026309999520890415, + "spec/requests/api/v1/passwords/update_spec.rb": 0.4883949999930337, + "spec/requests/api/v1/feature_flags_spec.rb": 0.040616000012960285, + "spec/requests/api/v1/settings_spec.rb": 0.0425929999910295, + "spec/requests/api/v1/passwords/create_spec.rb": 0.15221400000154972, + "spec/acceptance/users_spec.rb": 0.5729850000352599, + "spec/policies/user_policy_spec.rb": 0.015309000038541853, + "spec/requests/api/v1/users/update_spec.rb": 0.9842829999979585, + "spec/requests/api/v1/status_spec.rb": 0.01666500000283122, + "spec/policies/application_policy_spec.rb": 0.008917000028304756, + "spec/policies/admin/admin_user_policy_spec.rb": 0.005394000036176294, + "spec/requests/api/v1/sessions/create_spec.rb": 0.49404099996900186, + "spec/decorators/user_decorator_spec.rb": 0.005971000005956739, + "spec/requests/api/v1/passwords/edit_spec.rb": 0.08089700003620237, + "spec/acceptance/passwords_spec.rb": 0.6197870000032708, + "spec/models/user_spec.rb": 0.09392800001660362, + "spec/mailers/application_mailer_spec.rb": 0.0020680000307038426, + "spec/requests/api/v1/users/show_spec.rb": 0.5047900000354275 } \ No newline at end of file diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 9d0f9a82..7d30cef6 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -11,6 +11,8 @@ require 'shoulda/matchers' require 'pundit/rspec' +Knapsack.tracker.config(enable_time_offset_warning: false) + Knapsack::Adapters::RSpecAdapter.bind FactoryBot.factories.clear From 5f3744c8190d55a3e25b9f94ea4b6eb99c0526f5 Mon Sep 17 00:00:00 2001 From: Rodrigo Eizmendi Date: Thu, 10 Aug 2023 12:10:06 -0300 Subject: [PATCH 036/160] move harcoded values to secrets with a default value --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6b0c0346..a1f3b8b0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,8 +23,8 @@ jobs: env: RAILS_ENV: test CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} - CI_NODE_TOTAL: 1 - CI_NODE_INDEX: 0 + CI_NODE_TOTAL: ${{ secrets.CI_NODE_TOTAL || 1 }} + CI_NODE_INDEX: ${{ secrets.CI_NODE_INDEX || 0 }} steps: - name: Checkout code From 873b7475eca2a4bf681c8a4bdc6b022be7ca5f6a Mon Sep 17 00:00:00 2001 From: Rodrigo Eizmendi Date: Fri, 11 Aug 2023 15:32:31 -0300 Subject: [PATCH 037/160] try to set matrix strategy --- .github/workflows/ci.yml | 17 +++++++++++++++-- knapsack_rspec_report.json | 2 +- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a1f3b8b0..58c72327 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,11 +20,20 @@ jobs: --health-timeout 5s --health-retries 5 + strategy: + fail-fast: false + matrix: + # Set N number of parallel jobs you want to run tests on. + # Use higher number if you have slow tests to split them on more parallel jobs. + # Remember to update ci_node_index below to 0..N-1 + ci_node_total: [4] + # set N-1 indexes for parallel jobs + # When you run 2 parallel jobs then first job will have index 0, the second job will have index 1 etc + ci_node_index: [0, 1, 2, 3] + env: RAILS_ENV: test CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} - CI_NODE_TOTAL: ${{ secrets.CI_NODE_TOTAL || 1 }} - CI_NODE_INDEX: ${{ secrets.CI_NODE_INDEX || 0 }} steps: - name: Checkout code @@ -50,6 +59,10 @@ jobs: run: | bundle exec rake code:analysis - name: Run Tests + env: + KNAPSACK_CI_NODE_TOTAL: ${{ matrix.ci_node_total }} + KNAPSACK_CI_NODE_INDEX: ${{ matrix.ci_node_index }} + KNAPSACK_PRO_LOG_LEVEL: info run: | bundle exec rake knapsack:rspec - name: Check for missing annotations diff --git a/knapsack_rspec_report.json b/knapsack_rspec_report.json index 4f0d72b1..cde01527 100644 --- a/knapsack_rspec_report.json +++ b/knapsack_rspec_report.json @@ -28,4 +28,4 @@ "spec/models/user_spec.rb": 0.09392800001660362, "spec/mailers/application_mailer_spec.rb": 0.0020680000307038426, "spec/requests/api/v1/users/show_spec.rb": 0.5047900000354275 -} \ No newline at end of file +} From 07aec0c7fce8340024a029146a8a4e314d388d42 Mon Sep 17 00:00:00 2001 From: Rodrigo Eizmendi Date: Fri, 11 Aug 2023 15:59:44 -0300 Subject: [PATCH 038/160] queue mode works? --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 58c72327..62d6b9ae 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,9 +62,10 @@ jobs: env: KNAPSACK_CI_NODE_TOTAL: ${{ matrix.ci_node_total }} KNAPSACK_CI_NODE_INDEX: ${{ matrix.ci_node_index }} - KNAPSACK_PRO_LOG_LEVEL: info + KNAPSACK_FIXED_QUEUE_SPLIT: true + KNAPSACK_LOG_LEVEL: info run: | - bundle exec rake knapsack:rspec + bundle exec rake knapsack:queue:rspec - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From bf4e1a9e2a85042748d8b43959df3f69771582f2 Mon Sep 17 00:00:00 2001 From: Rodrigo Eizmendi Date: Fri, 11 Aug 2023 16:14:10 -0300 Subject: [PATCH 039/160] vars --- .github/workflows/ci.yml | 7 +++---- spec/spec_helper.rb | 1 - 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 62d6b9ae..0283be0e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,12 +60,11 @@ jobs: bundle exec rake code:analysis - name: Run Tests env: - KNAPSACK_CI_NODE_TOTAL: ${{ matrix.ci_node_total }} - KNAPSACK_CI_NODE_INDEX: ${{ matrix.ci_node_index }} - KNAPSACK_FIXED_QUEUE_SPLIT: true + CI_NODE_TOTAL: ${{ matrix.ci_node_total }} + CI_NODE_INDEX: ${{ matrix.ci_node_index }} KNAPSACK_LOG_LEVEL: info run: | - bundle exec rake knapsack:queue:rspec + bundle exec rake knapsack:rspec - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 7d30cef6..0c5d6c63 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -12,7 +12,6 @@ require 'pundit/rspec' Knapsack.tracker.config(enable_time_offset_warning: false) - Knapsack::Adapters::RSpecAdapter.bind FactoryBot.factories.clear From 38a097cd46bd428462539b3058cb2540d1552ec8 Mon Sep 17 00:00:00 2001 From: Juan Pascual Date: Mon, 7 Aug 2023 15:39:36 -0300 Subject: [PATCH 040/160] split tests and linters --- .github/workflows/ci.yml | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0283be0e..90bc1617 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,23 @@ name: CI on: [push] jobs: - build: + linters: + name: Linters + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + - name: I18n Health + run: bundle exec i18n-tasks health + - name: Run Code Analysis + run: | + bundle exec rake code_analysis + tests: + name: Tests runs-on: ubuntu-latest services: @@ -46,18 +62,13 @@ jobs: run: | curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter chmod +x ./cc-test-reporter - ./cc-test-reporter before-build + ./cc-test-reporter before-build - name: Setup Database run: bundle exec rails db:create db:migrate - name: Check for untracked changes in schema.rb uses: rootstrap/check_untracked_changes@v1 with: path: "./db/schema.rb" - - name: I18n Health - run: bundle exec i18n-tasks health - - name: Run Code Analysis - run: | - bundle exec rake code:analysis - name: Run Tests env: CI_NODE_TOTAL: ${{ matrix.ci_node_total }} From 23442ec0fecf3e831f80510b5d76a84fe76ee2c5 Mon Sep 17 00:00:00 2001 From: Juan Pascual Date: Thu, 10 Aug 2023 16:18:20 -0300 Subject: [PATCH 041/160] move I18n Health check to code:analysis --- .github/workflows/ci.yml | 9 ++++++--- lib/tasks/code_analysis.rake | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 90bc1617..7f446508 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,8 @@ jobs: linters: name: Linters runs-on: ubuntu-latest + env: + RAILS_ENV: test steps: - name: Checkout code uses: actions/checkout@v3 @@ -13,11 +15,12 @@ jobs: uses: ruby/setup-ruby@v1 with: bundler-cache: true - - name: I18n Health - run: bundle exec i18n-tasks health + - name: Setup Database + run: | + cp .github/test_db/config/database.yml config/database.yml - name: Run Code Analysis run: | - bundle exec rake code_analysis + bundle exec rake code:analysis tests: name: Tests runs-on: ubuntu-latest diff --git a/lib/tasks/code_analysis.rake b/lib/tasks/code_analysis.rake index e6dc69d8..d9e5020a 100644 --- a/lib/tasks/code_analysis.rake +++ b/lib/tasks/code_analysis.rake @@ -7,5 +7,6 @@ namespace :code do sh 'bundle exec rubocop .' sh 'bundle exec reek .' sh 'bundle exec rails_best_practices .' + sh 'bundle exec i18n-tasks health' end end From abb1b68518b732691c0083f3bea571b426dd8b25 Mon Sep 17 00:00:00 2001 From: grosendo2006 Date: Tue, 25 Jul 2023 19:40:32 -0300 Subject: [PATCH 042/160] add parallel gem --- .github/workflows/ci.yml | 2 +- Gemfile | 1 + Gemfile.lock | 11 ++++++++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7f446508..1afeaf58 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: bundler-cache: true - name: Setup Database run: | - cp .github/test_db/config/database.yml config/database.yml + bundle exec rails db:create db:migrate - name: Run Code Analysis run: | bundle exec rake code:analysis diff --git a/Gemfile b/Gemfile index f13fe734..f113b146 100644 --- a/Gemfile +++ b/Gemfile @@ -41,6 +41,7 @@ group :development, :test do gem 'dotenv-rails', '~> 2.7.6' gem 'factory_bot_rails', '~> 6.2' gem 'knapsack', '~> 4.0.0', '>= 4.0.0' + gem 'parallel_tests', '~> 4.2' gem 'pry-byebug', '~> 3.9', platform: :mri gem 'pry-rails', '~> 0.3.9' gem 'rspec_api_documentation', '~> 6.1.0' diff --git a/Gemfile.lock b/Gemfile.lock index a85b7d17..33fef2e2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -118,6 +118,7 @@ GEM aws-sigv4 (~> 1.4) aws-sigv4 (1.5.2) aws-eventstream (~> 1, >= 1.0.2) + base64 (0.1.1) bcrypt (3.1.18) better_errors (2.9.1) coderay (>= 1.0.0) @@ -290,7 +291,9 @@ GEM oj (3.13.21) orm_adapter (0.5.0) pagy (4.11.0) - parallel (1.23.0) + parallel (1.22.1) + parallel_tests (4.2.1) + parallel parser (3.2.2.3) ast (~> 2.4.1) racc @@ -404,7 +407,8 @@ GEM activesupport (>= 3.0.0) mustache (~> 1.0, >= 0.99.4) rspec (~> 3.0) - rubocop (1.55.0) + rubocop (1.56.0) + base64 (~> 0.1.1) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -519,11 +523,12 @@ DEPENDENCIES flipper-ui (~> 0.28.0) i18n-tasks (~> 1.0.12) jbuilder (~> 2.10) - knapsack (~> 4.0.0) + knapsack (~> 4.0.0, >= 4.0.0) letter_opener (~> 1.7) listen (~> 3.8) oj (~> 3.9, >= 3.9.2) pagy (~> 4.0) + parallel_tests (~> 4.2) pg (~> 1.5) pg_query (~> 4.2.1) prosopite (~> 1.3.2) From c77ab37b3e73958c79db8db5b597e1c3a3e82d0d Mon Sep 17 00:00:00 2001 From: Rodrigo Eizmendi Date: Mon, 21 Aug 2023 15:12:25 -0300 Subject: [PATCH 043/160] remove unnecesary database step --- .github/workflows/ci.yml | 3 --- Gemfile | 2 +- Gemfile.lock | 12 ++++++------ 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1afeaf58..2b06f1f8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,9 +15,6 @@ jobs: uses: ruby/setup-ruby@v1 with: bundler-cache: true - - name: Setup Database - run: | - bundle exec rails db:create db:migrate - name: Run Code Analysis run: | bundle exec rake code:analysis diff --git a/Gemfile b/Gemfile index 771cd201..8c55bdf3 100644 --- a/Gemfile +++ b/Gemfile @@ -39,7 +39,7 @@ gem 'yaaf', '~> 2.2' group :development, :test do gem 'annotate', '~> 3.2', '>= 3.0.3' gem 'dotenv-rails', '~> 2.7.6' - gem 'factory_bot_rails', '~> 5.1', '>= 5.1.1' + gem 'factory_bot_rails', '~> 6.2' gem 'knapsack', '~> 4.0.0' gem 'parallel_tests', '~> 4.2' gem 'pry-byebug', '~> 3.9', platform: :mri diff --git a/Gemfile.lock b/Gemfile.lock index 9551254a..9f272d80 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -178,11 +178,11 @@ GEM erubi (1.12.0) erubis (2.7.0) execjs (2.8.1) - factory_bot (5.2.0) - activesupport (>= 4.2.0) - factory_bot_rails (5.2.0) - factory_bot (~> 5.2.0) - railties (>= 4.2.0) + factory_bot (6.2.1) + activesupport (>= 5.0.0) + factory_bot_rails (6.2.0) + factory_bot (~> 6.2.0) + railties (>= 5.0.0) faker (2.23.0) i18n (>= 1.8.11, < 2) ffi (1.15.5) @@ -516,7 +516,7 @@ DEPENDENCIES dotenv-rails (~> 2.7.6) draper (~> 4.0, >= 4.0.1) exception_hunter! - factory_bot_rails (~> 5.1, >= 5.1.1) + factory_bot_rails (~> 6.2) faker (~> 2.13) flipper (~> 0.28.3) flipper-active_record (~> 0.28.0) From ada40545be07fd29aa450f4b11fffe52092840b1 Mon Sep 17 00:00:00 2001 From: Rodrigo Eizmendi Date: Mon, 21 Aug 2023 15:18:39 -0300 Subject: [PATCH 044/160] update knapsack version --- Gemfile | 2 +- Gemfile.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index 8c55bdf3..6e4fd605 100644 --- a/Gemfile +++ b/Gemfile @@ -40,7 +40,7 @@ group :development, :test do gem 'annotate', '~> 3.2', '>= 3.0.3' gem 'dotenv-rails', '~> 2.7.6' gem 'factory_bot_rails', '~> 6.2' - gem 'knapsack', '~> 4.0.0' + gem 'knapsack', '~> 4.0' gem 'parallel_tests', '~> 4.2' gem 'pry-byebug', '~> 3.9', platform: :mri gem 'pry-rails', '~> 0.3.9' diff --git a/Gemfile.lock b/Gemfile.lock index 9f272d80..4449b915 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -523,7 +523,7 @@ DEPENDENCIES flipper-ui (~> 0.28.0) i18n-tasks (~> 1.0.12) jbuilder (~> 2.10) - knapsack (~> 4.0.0) + knapsack (~> 4.0) letter_opener (~> 1.7) listen (~> 3.8) oj (~> 3.9, >= 3.9.2) From 47a19a27bf24c2b972e065743b54c8949c414709 Mon Sep 17 00:00:00 2001 From: Rodrigo Eizmendi Date: Mon, 21 Aug 2023 12:02:16 -0300 Subject: [PATCH 045/160] create a workflow to update knapsack report --- .github/workflows/update_knapsack_report.yml | 40 ++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/update_knapsack_report.yml diff --git a/.github/workflows/update_knapsack_report.yml b/.github/workflows/update_knapsack_report.yml new file mode 100644 index 00000000..6bafcba1 --- /dev/null +++ b/.github/workflows/update_knapsack_report.yml @@ -0,0 +1,40 @@ +name: Create Knapsack Report + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Ruby 3.1.2 + uses: actions/setup-ruby@v1 + with: + ruby-version: 3.1 + github_token: ${{ secrets.GITHUB_TOKEN }} + - name: Generate new Knapsack report + run: | + gem install bundler + bundle install --jobs 4 --retry 3 + KNAPSACK=true KNAPSACK_GENERATE_REPORT=true bundle exec rspec + - name: Commit files + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add knapsack_rspec_report.json + git commit -m "Update knapsack_rspec_report.json" + - name: Push changes + run: git push origin HEAD:update-knapsack-report + - name: Initialize Pull Request + uses: gha-utilities/init-pull-request@v0.1.2 + with: + verbose: true + pull_request_token: ${{ secrets.GITHUB_TOKEN }} + head: update-knapsack-report + base: release/improve-ci + title: 'Update Knapsack report' + maintainer_can_modify: true + debug: true + draft: false + body: > + This is a automated PR From 5e300479a06db7efdd10d5f125e76f4269e262a4 Mon Sep 17 00:00:00 2001 From: Rodrigo Eizmendi Date: Tue, 22 Aug 2023 11:18:30 -0300 Subject: [PATCH 046/160] add database step --- .github/workflows/update_knapsack_report.yml | 25 ++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update_knapsack_report.yml b/.github/workflows/update_knapsack_report.yml index 6bafcba1..67e4976f 100644 --- a/.github/workflows/update_knapsack_report.yml +++ b/.github/workflows/update_knapsack_report.yml @@ -5,9 +5,27 @@ on: [push] jobs: build: runs-on: ubuntu-latest + + services: + db: + image: postgres:9.4 + env: + POSTGRES_USER: postgres + POSTGRES_HOST_AUTH_METHOD: trust + ports: + - 5432:5432 + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + + env: + RAILS_ENV: test + steps: - uses: actions/checkout@v2 - - name: Set up Ruby 3.1.2 + - name: Set up Ruby 3.1 uses: actions/setup-ruby@v1 with: ruby-version: 3.1 @@ -16,7 +34,10 @@ jobs: run: | gem install bundler bundle install --jobs 4 --retry 3 - KNAPSACK=true KNAPSACK_GENERATE_REPORT=true bundle exec rspec + - name: Setup Database + run: bundle exec rails db:create db:migrate + - name: Generate Report + run: KNAPSACK=true KNAPSACK_GENERATE_REPORT=true bundle exec rspec - name: Commit files run: | git config --local user.email "action@github.com" From 5b81a181b2d95061eb9244685a0413e159ea3bb7 Mon Sep 17 00:00:00 2001 From: Rodrigo Eizmendi Date: Tue, 22 Aug 2023 11:54:16 -0300 Subject: [PATCH 047/160] update pull request step --- .github/workflows/update_knapsack_report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update_knapsack_report.yml b/.github/workflows/update_knapsack_report.yml index 67e4976f..f0fad468 100644 --- a/.github/workflows/update_knapsack_report.yml +++ b/.github/workflows/update_knapsack_report.yml @@ -47,7 +47,7 @@ jobs: - name: Push changes run: git push origin HEAD:update-knapsack-report - name: Initialize Pull Request - uses: gha-utilities/init-pull-request@v0.1.2 + uses: gha-utilities/init-pull-request with: verbose: true pull_request_token: ${{ secrets.GITHUB_TOKEN }} From 07b971eb3fdf13ff5b12f1e0c27c6afa0d54357f Mon Sep 17 00:00:00 2001 From: Rodrigo Eizmendi Date: Tue, 22 Aug 2023 12:13:50 -0300 Subject: [PATCH 048/160] ci --- .github/workflows/update_knapsack_report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update_knapsack_report.yml b/.github/workflows/update_knapsack_report.yml index f0fad468..ddb590f1 100644 --- a/.github/workflows/update_knapsack_report.yml +++ b/.github/workflows/update_knapsack_report.yml @@ -47,7 +47,7 @@ jobs: - name: Push changes run: git push origin HEAD:update-knapsack-report - name: Initialize Pull Request - uses: gha-utilities/init-pull-request + uses: peter-evans/create-pull-request@v3 with: verbose: true pull_request_token: ${{ secrets.GITHUB_TOKEN }} From c6f6fe4359365bc7612aa6ea06df459c2272c9db Mon Sep 17 00:00:00 2001 From: Rodrigo Eizmendi Date: Tue, 22 Aug 2023 14:40:35 -0300 Subject: [PATCH 049/160] improvements --- .github/workflows/update_knapsack_report.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/update_knapsack_report.yml b/.github/workflows/update_knapsack_report.yml index ddb590f1..2e5e18cd 100644 --- a/.github/workflows/update_knapsack_report.yml +++ b/.github/workflows/update_knapsack_report.yml @@ -1,6 +1,10 @@ -name: Create Knapsack Report +name: Update Knapsack Report -on: [push] +# This workflow should be scheduled at certain intervals +# for example, the following configuration would schedule it every 3 months +# on: +# schedule: +# - cron: '0 0 1 */3 *' jobs: build: @@ -30,13 +34,13 @@ jobs: with: ruby-version: 3.1 github_token: ${{ secrets.GITHUB_TOKEN }} - - name: Generate new Knapsack report + - name: Ruby gems run: | gem install bundler bundle install --jobs 4 --retry 3 - name: Setup Database run: bundle exec rails db:create db:migrate - - name: Generate Report + - name: Update Knapsack Report run: KNAPSACK=true KNAPSACK_GENERATE_REPORT=true bundle exec rspec - name: Commit files run: | @@ -58,4 +62,6 @@ jobs: debug: true draft: false body: > - This is a automated PR + This is a automated PR. Knapsack uses the report file to distribute tests across different nodes + so that they all have similar execution times. It's advisable to update the report periodically, + especially if many test files have been added, for better distribution. From 9e8bac5bd7b95d160f5e4a71d1f73f12791f249d Mon Sep 17 00:00:00 2001 From: Juan Pascual Date: Tue, 22 Aug 2023 15:36:30 -0300 Subject: [PATCH 050/160] fix parallel coverage --- .github/workflows/ci.yml | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2b06f1f8..2f2ed569 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,7 +35,7 @@ jobs: --health-interval 10s --health-timeout 5s --health-retries 5 - + strategy: fail-fast: false matrix: @@ -84,4 +84,27 @@ jobs: path: "./app/ ./spec/" - name: Report to CodeClimate run: | - ./cc-test-reporter after-build --exit-code 0 + ./cc-test-reporter format-coverage --output "coverage/coverage.${{ matrix.ci_node_index }}.json" + - name: Upload partial converage + uses: actions/upload-artifact@v2 + with: + name: coverage + path: "coverage/coverage.${{ matrix.ci_node_index }}.json" + coverage: + name: Coverage + runs-on: ubuntu-latest + needs: tests + steps: + - name: Setup Code Climate test-reporter + run: | + curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter + chmod +x ./cc-test-reporter + - name: download coverage reports + uses: actions/download-artifact@v2 + with: + name: coverage + path: coverage/coverage.*.json + - name: report coverage + run: | + ./cc-test-reporter sum-coverage coverage/coverage.*.json -o coverage/report.total.json + ./cc-test-reporter upload-coverage -i coverage/report.total.json From 1aee50dd0060dceeaaddf704e3bfef2f9d928bcb Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Tue, 22 Aug 2023 16:22:36 -0300 Subject: [PATCH 051/160] Merge parallel with knapsack --- .github/workflows/ci.yml | 3 ++- bin/parallel_tests | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 bin/parallel_tests diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2b06f1f8..e0a958dc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,11 +71,12 @@ jobs: path: "./db/schema.rb" - name: Run Tests env: + PARALLEL_TESTS_CONCURRENCY: 8 CI_NODE_TOTAL: ${{ matrix.ci_node_total }} CI_NODE_INDEX: ${{ matrix.ci_node_index }} KNAPSACK_LOG_LEVEL: info run: | - bundle exec rake knapsack:rspec + bundle exec parallel_rspec --first-is-1 -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories diff --git a/bin/parallel_tests b/bin/parallel_tests new file mode 100644 index 00000000..fdbd945f --- /dev/null +++ b/bin/parallel_tests @@ -0,0 +1,18 @@ +#!/bin/bash +# This file should be in bin/parallel_tests + +# updates CI node total based on parallel_tests concurrency +KNAPSACK_CI_NODE_TOTAL=$(( $PARALLEL_TESTS_CONCURRENCY * $KNAPSACK_CI_NODE_TOTAL )) + +if [ "$TEST_ENV_NUMBER" == "" ]; then + PARALLEL_TESTS_CONCURRENCY_INDEX=0 +else + PARALLEL_TESTS_CONCURRENCY_INDEX=$(( $TEST_ENV_NUMBER - 1 )) +fi + +KNAPSACK_CI_NODE_INDEX=$(( $PARALLEL_TESTS_CONCURRENCY_INDEX + ($PARALLEL_TESTS_CONCURRENCY * $KNAPSACK_CI_NODE_INDEX) )) + +# logs info about ENVs to ensure everything works +echo KNAPSACK_CI_NODE_TOTAL=$KNAPSACK_CI_NODE_TOTAL KNAPSACK_CI_NODE_INDEX=$KNAPSACK_CI_NODE_INDEX PARALLEL_TESTS_CONCURRENCY=$PARALLEL_TESTS_CONCURRENCY + +CI_NODE_TOTAL=$KNAPSACK_CI_NODE_TOTAL CI_NODE_INDEX=$KNAPSACK_CI_NODE_INDEX bundle exec rake knapsack:rspec From 7d3024d87741b08e23a9590af3b7d977326f07c2 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Tue, 22 Aug 2023 16:25:30 -0300 Subject: [PATCH 052/160] Merge parallel with knapsack --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e0a958dc..40de65b6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,7 +76,7 @@ jobs: CI_NODE_INDEX: ${{ matrix.ci_node_index }} KNAPSACK_LOG_LEVEL: info run: | - bundle exec parallel_rspec --first-is-1 -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' + bundle exec parallel_test -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From 46b70791c09b09a07d382e72d05330a7a1294cf1 Mon Sep 17 00:00:00 2001 From: Laura Peralta Date: Tue, 22 Aug 2023 16:31:20 -0300 Subject: [PATCH 053/160] no path --- .github/workflows/ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2f2ed569..466b7448 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -103,8 +103,6 @@ jobs: uses: actions/download-artifact@v2 with: name: coverage - path: coverage/coverage.*.json - name: report coverage run: | - ./cc-test-reporter sum-coverage coverage/coverage.*.json -o coverage/report.total.json - ./cc-test-reporter upload-coverage -i coverage/report.total.json + ./cc-test-reporter sum-coverage --output coverage/coverage.*.json | ./cc-test-reporter upload-coverage From 93f1c3a03410172063d04de86409eee423f72b53 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Tue, 22 Aug 2023 16:33:08 -0300 Subject: [PATCH 054/160] Merge parallel with knapsack --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 40de65b6..abc3dc19 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,12 +71,12 @@ jobs: path: "./db/schema.rb" - name: Run Tests env: - PARALLEL_TESTS_CONCURRENCY: 8 + PARALLEL_TESTS_CONCURRENCY: 2 CI_NODE_TOTAL: ${{ matrix.ci_node_total }} CI_NODE_INDEX: ${{ matrix.ci_node_index }} KNAPSACK_LOG_LEVEL: info run: | - bundle exec parallel_test -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' + bundle exec parallel:test -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From 34706619670a2f30fe1bca80c3139cf1da85ee43 Mon Sep 17 00:00:00 2001 From: Juan Pascual Date: Tue, 22 Aug 2023 15:36:30 -0300 Subject: [PATCH 055/160] fix parallel coverage --- .github/workflows/ci.yml | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2b06f1f8..73bc27ef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,7 +35,7 @@ jobs: --health-interval 10s --health-timeout 5s --health-retries 5 - + strategy: fail-fast: false matrix: @@ -84,4 +84,27 @@ jobs: path: "./app/ ./spec/" - name: Report to CodeClimate run: | - ./cc-test-reporter after-build --exit-code 0 + ./cc-test-reporter format-coverage --output "coverage/coverage.${{ matrix.ci_node_index }}.json" + - name: Upload partial converage + uses: actions/upload-artifact@v2 + with: + name: coverage + path: "coverage/coverage.${{ matrix.ci_node_index }}.json" + coverage: + name: Coverage + runs-on: ubuntu-latest + needs: tests + steps: + - name: Setup Code Climate test-reporter + run: | + curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter + chmod +x ./cc-test-reporter + - name: download coverage reports + uses: actions/download-artifact@v2 + with: + name: coverage + path: coverage/coverage.*.json + - name: report coverage + run: | + ./cc-test-reporter sum-coverage coverage/**/*.json -o coverage/report.total.json + ./cc-test-reporter upload-coverage -i coverage/report.total.json From 9ddc256b881630ce20e0a196c9140aa049e22e55 Mon Sep 17 00:00:00 2001 From: Juan Pascual Date: Tue, 22 Aug 2023 15:36:30 -0300 Subject: [PATCH 056/160] fix parallel coverage --- .github/workflows/ci.yml | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2b06f1f8..483ab8c1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,6 +2,10 @@ name: CI on: [push] +env: + RAILS_ENV: test + CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} + jobs: linters: name: Linters @@ -35,7 +39,7 @@ jobs: --health-interval 10s --health-timeout 5s --health-retries 5 - + strategy: fail-fast: false matrix: @@ -47,10 +51,6 @@ jobs: # When you run 2 parallel jobs then first job will have index 0, the second job will have index 1 etc ci_node_index: [0, 1, 2, 3] - env: - RAILS_ENV: test - CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} - steps: - name: Checkout code uses: actions/checkout@v3 @@ -84,4 +84,27 @@ jobs: path: "./app/ ./spec/" - name: Report to CodeClimate run: | - ./cc-test-reporter after-build --exit-code 0 + ./cc-test-reporter format-coverage --output "coverage/coverage.${{ matrix.ci_node_index }}.json" + - name: Upload partial converage + uses: actions/upload-artifact@v2 + with: + name: coverage + path: "coverage/coverage.${{ matrix.ci_node_index }}.json" + coverage: + name: Coverage + runs-on: ubuntu-latest + needs: tests + steps: + - name: Setup Code Climate test-reporter + run: | + curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter + chmod +x ./cc-test-reporter + - name: download coverage reports + uses: actions/download-artifact@v2 + with: + name: coverage + path: coverage/coverage.*.json + - name: report coverage + run: | + ./cc-test-reporter sum-coverage coverage/**/*.json -o coverage/report.total.json + ./cc-test-reporter upload-coverage -i coverage/report.total.json From a78cabea60ba8499fe4d830c9c25bcd8e7e394d7 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Tue, 22 Aug 2023 16:49:25 -0300 Subject: [PATCH 057/160] Merge parallel with knapsack --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index abc3dc19..dca75c78 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,7 +76,7 @@ jobs: CI_NODE_INDEX: ${{ matrix.ci_node_index }} KNAPSACK_LOG_LEVEL: info run: | - bundle exec parallel:test -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' + bundle exec rake parallel:spec -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From 6ad4d8ed8afad0f7d33c0106d49f9a9949770045 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Tue, 22 Aug 2023 16:53:37 -0300 Subject: [PATCH 058/160] Merge parallel with knapsack --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dca75c78..cedc202d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,7 +76,7 @@ jobs: CI_NODE_INDEX: ${{ matrix.ci_node_index }} KNAPSACK_LOG_LEVEL: info run: | - bundle exec rake parallel:spec -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' + RAILS_ENV=test bundle exec rake parallel:spec -n $PARALLEL_TESTS_CONCURRENCY - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From 719fac85d82802f3e68b8a5b7ad99caf9fb9b585 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Tue, 22 Aug 2023 16:54:59 -0300 Subject: [PATCH 059/160] Merge parallel with knapsack --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cedc202d..e788c9d4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,7 +76,7 @@ jobs: CI_NODE_INDEX: ${{ matrix.ci_node_index }} KNAPSACK_LOG_LEVEL: info run: | - RAILS_ENV=test bundle exec rake parallel:spec -n $PARALLEL_TESTS_CONCURRENCY + RAILS_ENV=test bundle exec rake parallel:spec -n $PARALLEL_TESTS_CONCURRENCY -e 'bin/parallel_tests' - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From 9d3195534b22d8b3942f15057c9db504451ef717 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Tue, 22 Aug 2023 16:57:34 -0300 Subject: [PATCH 060/160] Merge parallel with knapsack --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e788c9d4..4d7e4889 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,12 +71,13 @@ jobs: path: "./db/schema.rb" - name: Run Tests env: - PARALLEL_TESTS_CONCURRENCY: 2 CI_NODE_TOTAL: ${{ matrix.ci_node_total }} CI_NODE_INDEX: ${{ matrix.ci_node_index }} KNAPSACK_LOG_LEVEL: info + PARALLEL_TESTS_CONCURRENCY: 2 + RAILS_ENV: test run: | - RAILS_ENV=test bundle exec rake parallel:spec -n $PARALLEL_TESTS_CONCURRENCY -e 'bin/parallel_tests' + bundle exec parallel_test -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From 25022bd7da37f283e664db81c3d2a0d8ca1d82d6 Mon Sep 17 00:00:00 2001 From: Laura Peralta Date: Tue, 22 Aug 2023 17:02:05 -0300 Subject: [PATCH 061/160] name codeclimate --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 483ab8c1..fd400d88 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -106,5 +106,5 @@ jobs: path: coverage/coverage.*.json - name: report coverage run: | - ./cc-test-reporter sum-coverage coverage/**/*.json -o coverage/report.total.json - ./cc-test-reporter upload-coverage -i coverage/report.total.json + ./cc-test-reporter sum-coverage coverage/**/*.json + ./cc-test-reporter upload-coverage From 250250d17da6a7d98e73e7f2c3cf5f12dbad94ee Mon Sep 17 00:00:00 2001 From: Rodrigo Eizmendi Date: Tue, 22 Aug 2023 17:02:53 -0300 Subject: [PATCH 062/160] remove filenames --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 483ab8c1..fd400d88 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -106,5 +106,5 @@ jobs: path: coverage/coverage.*.json - name: report coverage run: | - ./cc-test-reporter sum-coverage coverage/**/*.json -o coverage/report.total.json - ./cc-test-reporter upload-coverage -i coverage/report.total.json + ./cc-test-reporter sum-coverage coverage/**/*.json + ./cc-test-reporter upload-coverage From fdb9f034afa199da8ebfdf30b1878bef72d09a98 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Tue, 22 Aug 2023 17:03:02 -0300 Subject: [PATCH 063/160] Merge parallel with knapsack --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4d7e4889..9ea7b528 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,8 +71,8 @@ jobs: path: "./db/schema.rb" - name: Run Tests env: - CI_NODE_TOTAL: ${{ matrix.ci_node_total }} - CI_NODE_INDEX: ${{ matrix.ci_node_index }} + KNAPSACK_CI_NODE_TOTAL: ${{ matrix.ci_node_total }} + KNAPSACK_CI_NODE_INDEX: ${{ matrix.ci_node_index }} KNAPSACK_LOG_LEVEL: info PARALLEL_TESTS_CONCURRENCY: 2 RAILS_ENV: test From 28a711d611f873a793c9efe2054b48af2c402e14 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Tue, 22 Aug 2023 17:05:30 -0300 Subject: [PATCH 064/160] Merge parallel with knapsack --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9ea7b528..ae180df6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,7 +77,7 @@ jobs: PARALLEL_TESTS_CONCURRENCY: 2 RAILS_ENV: test run: | - bundle exec parallel_test -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' + bundle exec parallel:test -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From e4ab033a9f4b232311f7e4dd7a5d2f67c7154c45 Mon Sep 17 00:00:00 2001 From: Rodrigo Eizmendi Date: Tue, 22 Aug 2023 17:02:53 -0300 Subject: [PATCH 065/160] remove filenames --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 483ab8c1..7526e9ea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,7 +62,7 @@ jobs: run: | curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter chmod +x ./cc-test-reporter - ./cc-test-reporter before-build + ./cc-test-reporter - name: Setup Database run: bundle exec rails db:create db:migrate - name: Check for untracked changes in schema.rb @@ -106,5 +106,5 @@ jobs: path: coverage/coverage.*.json - name: report coverage run: | - ./cc-test-reporter sum-coverage coverage/**/*.json -o coverage/report.total.json - ./cc-test-reporter upload-coverage -i coverage/report.total.json + ./cc-test-reporter sum-coverage coverage/**/*.json + ./cc-test-reporter upload-coverage From cd8dd1687b06c999c2be8c720b153af81d9950ed Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Tue, 22 Aug 2023 17:09:23 -0300 Subject: [PATCH 066/160] Add install dependencies --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ae180df6..49c4206f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,6 +65,8 @@ jobs: ./cc-test-reporter before-build - name: Setup Database run: bundle exec rails db:create db:migrate + - name: Install dependencies + run: bundle install - name: Check for untracked changes in schema.rb uses: rootstrap/check_untracked_changes@v1 with: @@ -77,7 +79,7 @@ jobs: PARALLEL_TESTS_CONCURRENCY: 2 RAILS_ENV: test run: | - bundle exec parallel:test -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' + bundle exec parallel_rspec -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From 237ddb2445c200ea8f59e11938f89e872f5fdcf3 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Tue, 22 Aug 2023 17:11:19 -0300 Subject: [PATCH 067/160] Add install dependencies --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 49c4206f..7ea0f32b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,7 +79,7 @@ jobs: PARALLEL_TESTS_CONCURRENCY: 2 RAILS_ENV: test run: | - bundle exec parallel_rspec -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' + bundle exec parallel:rspec -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From 56400bb2ab80e7fdfeb6ca1e0dc215ebf92e3936 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Tue, 22 Aug 2023 17:16:55 -0300 Subject: [PATCH 068/160] Add parallel database creation --- .github/workflows/ci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7ea0f32b..b4b9c10c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,7 +64,12 @@ jobs: chmod +x ./cc-test-reporter ./cc-test-reporter before-build - name: Setup Database - run: bundle exec rails db:create db:migrate + env: + RAILS_ENV: test + run: | + bundle exec rails parallel:create + bundle exec rails parallel:load_schema + bundle exec rails db:create db:migrate - name: Install dependencies run: bundle install - name: Check for untracked changes in schema.rb From 7a4be73ba1396b3fc4696f4e5875f3452cc0d2ce Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Tue, 22 Aug 2023 17:19:32 -0300 Subject: [PATCH 069/160] Add parallel database creation --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b4b9c10c..2c149cd6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,7 +68,6 @@ jobs: RAILS_ENV: test run: | bundle exec rails parallel:create - bundle exec rails parallel:load_schema bundle exec rails db:create db:migrate - name: Install dependencies run: bundle install From 72b522374852d93ab56c64140849434d4f958c73 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Tue, 22 Aug 2023 17:26:24 -0300 Subject: [PATCH 070/160] Add parallel database creation --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2c149cd6..7354eca7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,7 +68,7 @@ jobs: RAILS_ENV: test run: | bundle exec rails parallel:create - bundle exec rails db:create db:migrate + bundle exec rails db:migrate - name: Install dependencies run: bundle install - name: Check for untracked changes in schema.rb From d1600f0ac90bcac7de28e7eb269d884e5e41489d Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Tue, 22 Aug 2023 17:28:30 -0300 Subject: [PATCH 071/160] Add parallel database creation --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7354eca7..728d5948 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,7 +68,6 @@ jobs: RAILS_ENV: test run: | bundle exec rails parallel:create - bundle exec rails db:migrate - name: Install dependencies run: bundle install - name: Check for untracked changes in schema.rb From 27aa44e6a8b248340662564fb2ce6541d8fb012e Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Tue, 22 Aug 2023 17:32:50 -0300 Subject: [PATCH 072/160] Add parallel database creation --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 728d5948..5530c616 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,13 +63,14 @@ jobs: curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter chmod +x ./cc-test-reporter ./cc-test-reporter before-build + - name: Install dependencies + run: bundle install - name: Setup Database env: RAILS_ENV: test run: | bundle exec rails parallel:create - - name: Install dependencies - run: bundle install + bundle exec rails parallel:load_schema - name: Check for untracked changes in schema.rb uses: rootstrap/check_untracked_changes@v1 with: From 49196c506c8488cec73c729485665d0d67f96571 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Tue, 22 Aug 2023 17:34:09 -0300 Subject: [PATCH 073/160] Trying to run parallel in CI --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5530c616..9b306b08 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,7 +70,6 @@ jobs: RAILS_ENV: test run: | bundle exec rails parallel:create - bundle exec rails parallel:load_schema - name: Check for untracked changes in schema.rb uses: rootstrap/check_untracked_changes@v1 with: From 3b4d2c753943aa5194db9dc1e210c60c9ee997a5 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Tue, 22 Aug 2023 17:36:16 -0300 Subject: [PATCH 074/160] Trying to run parallel in CI --- .github/workflows/ci.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9b306b08..aa3a527d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,10 +66,7 @@ jobs: - name: Install dependencies run: bundle install - name: Setup Database - env: - RAILS_ENV: test - run: | - bundle exec rails parallel:create + run: bundle exec rails db:create db:migrate - name: Check for untracked changes in schema.rb uses: rootstrap/check_untracked_changes@v1 with: From 067ac44143ed2fd3a4481a0d9d2cd4fa2b69236d Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Tue, 22 Aug 2023 17:38:39 -0300 Subject: [PATCH 075/160] Trying to run parallel in CI --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aa3a527d..39ee9e63 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,6 +66,8 @@ jobs: - name: Install dependencies run: bundle install - name: Setup Database + env: + RAILS_ENV: test run: bundle exec rails db:create db:migrate - name: Check for untracked changes in schema.rb uses: rootstrap/check_untracked_changes@v1 From 66bd3f8438112c0b2edced47d906c6b390320bd4 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Tue, 22 Aug 2023 17:41:24 -0300 Subject: [PATCH 076/160] Trying to run parallel in CI --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 39ee9e63..5530c616 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,7 +68,9 @@ jobs: - name: Setup Database env: RAILS_ENV: test - run: bundle exec rails db:create db:migrate + run: | + bundle exec rails parallel:create + bundle exec rails parallel:load_schema - name: Check for untracked changes in schema.rb uses: rootstrap/check_untracked_changes@v1 with: From 75991cd711136f6d2fdb1f7fde3ae723a06af11e Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Tue, 22 Aug 2023 17:43:03 -0300 Subject: [PATCH 077/160] Trying to run parallel in CI --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5530c616..00174ff0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,13 +64,13 @@ jobs: chmod +x ./cc-test-reporter ./cc-test-reporter before-build - name: Install dependencies + env: + RAILS_ENV: test run: bundle install - name: Setup Database env: RAILS_ENV: test - run: | - bundle exec rails parallel:create - bundle exec rails parallel:load_schema + run: bundle exec rails db:create db:migrate - name: Check for untracked changes in schema.rb uses: rootstrap/check_untracked_changes@v1 with: From 8f70777d61ccac3730abda7df9024a66ca616807 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 23 Aug 2023 10:08:01 -0300 Subject: [PATCH 078/160] Test --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 00174ff0..fd9f306b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,13 +77,13 @@ jobs: path: "./db/schema.rb" - name: Run Tests env: - KNAPSACK_CI_NODE_TOTAL: ${{ matrix.ci_node_total }} - KNAPSACK_CI_NODE_INDEX: ${{ matrix.ci_node_index }} + CI_NODE_TOTAL: ${{ matrix.ci_node_total }} + CI_NODE_INDEX: ${{ matrix.ci_node_index }} KNAPSACK_LOG_LEVEL: info PARALLEL_TESTS_CONCURRENCY: 2 RAILS_ENV: test run: | - bundle exec parallel:rspec -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' + bundle exec rake knapsack:rspec - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From 801aa8346290e2803108aa6abdff2fc72469b75a Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 23 Aug 2023 10:15:40 -0300 Subject: [PATCH 079/160] Test --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fd9f306b..d8a63564 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,7 +70,8 @@ jobs: - name: Setup Database env: RAILS_ENV: test - run: bundle exec rails db:create db:migrate + run: | + bundle exec rake parallel:setup - name: Check for untracked changes in schema.rb uses: rootstrap/check_untracked_changes@v1 with: From 6aa80e85f76844678608cef38b8c0630d782c793 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 23 Aug 2023 10:17:34 -0300 Subject: [PATCH 080/160] Test --- .github/workflows/ci.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d8a63564..99a8a0ac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,14 +64,10 @@ jobs: chmod +x ./cc-test-reporter ./cc-test-reporter before-build - name: Install dependencies - env: - RAILS_ENV: test run: bundle install - name: Setup Database - env: - RAILS_ENV: test run: | - bundle exec rake parallel:setup + rake parallel:migrate - name: Check for untracked changes in schema.rb uses: rootstrap/check_untracked_changes@v1 with: @@ -82,7 +78,6 @@ jobs: CI_NODE_INDEX: ${{ matrix.ci_node_index }} KNAPSACK_LOG_LEVEL: info PARALLEL_TESTS_CONCURRENCY: 2 - RAILS_ENV: test run: | bundle exec rake knapsack:rspec - name: Check for missing annotations From 3b7d46062d29f8d8a61de0fcd5517bc8ee34b229 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 23 Aug 2023 10:22:50 -0300 Subject: [PATCH 081/160] Test --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 99a8a0ac..5f429948 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,7 +67,8 @@ jobs: run: bundle install - name: Setup Database run: | - rake parallel:migrate + bundle exec rails db:create db:migrate + bundle exec rake parallel:setup - name: Check for untracked changes in schema.rb uses: rootstrap/check_untracked_changes@v1 with: From 2a6b967fe4d2012eaffdad7f8aab54b78139fd55 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 23 Aug 2023 10:31:49 -0300 Subject: [PATCH 082/160] Test --- .github/workflows/ci.yml | 3 +-- config/database.yml | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f429948..5821563b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,8 +67,7 @@ jobs: run: bundle install - name: Setup Database run: | - bundle exec rails db:create db:migrate - bundle exec rake parallel:setup + rake parallel:setup - name: Check for untracked changes in schema.rb uses: rootstrap/check_untracked_changes@v1 with: diff --git a/config/database.yml b/config/database.yml index 80903b9b..9020ee02 100644 --- a/config/database.yml +++ b/config/database.yml @@ -13,7 +13,7 @@ development: test: <<: *default - database: rails_api_base_test + database: rails_api_base_test<%= ENV['TEST_ENV_NUMBER'] %> # For production is recommended to set DATABASE_URL env variable. # It will take precedence over the config defined here. From 954436a27f722fb869b70d58218434c78885dcf8 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 23 Aug 2023 10:35:11 -0300 Subject: [PATCH 083/160] Run tests in parallel --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5821563b..7eafffb7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,7 +67,8 @@ jobs: run: bundle install - name: Setup Database run: | - rake parallel:setup + bundle exec rails db:create db:migrate + bundle exec rake parallel:setup - name: Check for untracked changes in schema.rb uses: rootstrap/check_untracked_changes@v1 with: @@ -79,7 +80,7 @@ jobs: KNAPSACK_LOG_LEVEL: info PARALLEL_TESTS_CONCURRENCY: 2 run: | - bundle exec rake knapsack:rspec + bundle exec parallel_rspec -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From ce2e92561a8ced36b0094cb230845ef2f1d73c79 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 23 Aug 2023 10:36:57 -0300 Subject: [PATCH 084/160] Run tests in parallel --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7eafffb7..60702469 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,7 +80,7 @@ jobs: KNAPSACK_LOG_LEVEL: info PARALLEL_TESTS_CONCURRENCY: 2 run: | - bundle exec parallel_rspec -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' + bundle exec rake parallel_rspec -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From c7c2a18adff3d2b001e76df02568fadee6245836 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 23 Aug 2023 10:40:34 -0300 Subject: [PATCH 085/160] Run tests in parallel --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 60702469..4ecaf80c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,7 +80,7 @@ jobs: KNAPSACK_LOG_LEVEL: info PARALLEL_TESTS_CONCURRENCY: 2 run: | - bundle exec rake parallel_rspec -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' + bundle exec rake parallel:spec -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From 4c84c0c76142bee4f9f9d3cebfb70b78812f91ea Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 23 Aug 2023 10:42:24 -0300 Subject: [PATCH 086/160] Run tests in parallel --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4ecaf80c..fe3de415 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,7 +80,7 @@ jobs: KNAPSACK_LOG_LEVEL: info PARALLEL_TESTS_CONCURRENCY: 2 run: | - bundle exec rake parallel:spec -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' + bundle exec rake parallel_rspec -n $PARALLEL_TESTS_CONCURRENCY - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From 40b6571406fba09357c853ca95ccdac5ad895c06 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 23 Aug 2023 10:47:32 -0300 Subject: [PATCH 087/160] Run tests in parallel --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fe3de415..51acb93c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,7 +80,7 @@ jobs: KNAPSACK_LOG_LEVEL: info PARALLEL_TESTS_CONCURRENCY: 2 run: | - bundle exec rake parallel_rspec -n $PARALLEL_TESTS_CONCURRENCY + bundle exec parallel_rspec -n $PARALLEL_TESTS_CONCURRENCY - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From abc0a206bf9a4347a2d4464570e3df29d831127e Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 23 Aug 2023 10:55:57 -0300 Subject: [PATCH 088/160] Run tests in parallel --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 51acb93c..94d96a05 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,12 +75,12 @@ jobs: path: "./db/schema.rb" - name: Run Tests env: - CI_NODE_TOTAL: ${{ matrix.ci_node_total }} - CI_NODE_INDEX: ${{ matrix.ci_node_index }} + KNAPSACK_CI_NODE_TOTAL: ${{ matrix.ci_node_total }} + KNAPSACK_CI_NODE_INDEX: ${{ matrix.ci_node_index }} KNAPSACK_LOG_LEVEL: info PARALLEL_TESTS_CONCURRENCY: 2 run: | - bundle exec parallel_rspec -n $PARALLEL_TESTS_CONCURRENCY + bundle exec parallel_test -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From 26f2ce76c31213d5614d46c20c677446e93a37d8 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 23 Aug 2023 10:57:41 -0300 Subject: [PATCH 089/160] Run tests in parallel --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 94d96a05..1342a604 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,7 +80,7 @@ jobs: KNAPSACK_LOG_LEVEL: info PARALLEL_TESTS_CONCURRENCY: 2 run: | - bundle exec parallel_test -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' + bundle exec rake parallel_test -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From 1cc317239ac2d6302ea3681637cc4beb4d88771b Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 23 Aug 2023 10:59:12 -0300 Subject: [PATCH 090/160] Run tests in parallel --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1342a604..16780fee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,7 +80,7 @@ jobs: KNAPSACK_LOG_LEVEL: info PARALLEL_TESTS_CONCURRENCY: 2 run: | - bundle exec rake parallel_test -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' + bundle exec rake parallel_test -n $PARALLEL_TESTS_CONCURRENCY -e 'parallel_tests' - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From 48924025b4eeecb85ece2f3301b326e2002745bc Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 23 Aug 2023 11:07:28 -0300 Subject: [PATCH 091/160] Run tests in parallel --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 16780fee..1036056b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,7 +80,7 @@ jobs: KNAPSACK_LOG_LEVEL: info PARALLEL_TESTS_CONCURRENCY: 2 run: | - bundle exec rake parallel_test -n $PARALLEL_TESTS_CONCURRENCY -e 'parallel_tests' + bundle exec rake parallel_test -n $PARALLEL_TESTS_CONCURRENCY -e '../../bin/parallel_tests' - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From 57e8814b4d21ab27fa7728854076f979ae805ad2 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 23 Aug 2023 11:09:44 -0300 Subject: [PATCH 092/160] Run tests in parallel --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1036056b..943eb3ec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,7 +80,7 @@ jobs: KNAPSACK_LOG_LEVEL: info PARALLEL_TESTS_CONCURRENCY: 2 run: | - bundle exec rake parallel_test -n $PARALLEL_TESTS_CONCURRENCY -e '../../bin/parallel_tests' + bundle exec rake parallel_test -n $PARALLEL_TESTS_CONCURRENCY -e '../bin/parallel_tests' - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From 5c78dff91fdcefcb4802c06f11234ce1c48d3c10 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 23 Aug 2023 11:15:34 -0300 Subject: [PATCH 093/160] Run tests in parallel --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 943eb3ec..d6f68efe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,7 +80,7 @@ jobs: KNAPSACK_LOG_LEVEL: info PARALLEL_TESTS_CONCURRENCY: 2 run: | - bundle exec rake parallel_test -n $PARALLEL_TESTS_CONCURRENCY -e '../bin/parallel_tests' + bundle exec rake parallel_test -n $PARALLEL_TESTS_CONCURRENCY -e '/bin/parallel_tests' - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From 742ad3915d34a0da5414a2ff8b46802a358d957a Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 23 Aug 2023 11:18:23 -0300 Subject: [PATCH 094/160] Run tests in parallel --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d6f68efe..c54ba911 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,7 +80,7 @@ jobs: KNAPSACK_LOG_LEVEL: info PARALLEL_TESTS_CONCURRENCY: 2 run: | - bundle exec rake parallel_test -n $PARALLEL_TESTS_CONCURRENCY -e '/bin/parallel_tests' + bundle exec rake parallel_test -n $PARALLEL_TESTS_CONCURRENCY -e ./bin/parallel_tests - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From 29dcf73e63b33e1fca489cc633b6047acbf47710 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 23 Aug 2023 11:23:23 -0300 Subject: [PATCH 095/160] Run tests in parallel --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c54ba911..61e7a377 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,7 +80,7 @@ jobs: KNAPSACK_LOG_LEVEL: info PARALLEL_TESTS_CONCURRENCY: 2 run: | - bundle exec rake parallel_test -n $PARALLEL_TESTS_CONCURRENCY -e ./bin/parallel_tests + bundle exec rake parallel_test -n $PARALLEL_TESTS_CONCURRENCY -e "./bin/parallel_tests" - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From 4e88a61dfa3b56b2e8bd2c7262095ef73eac7db6 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 23 Aug 2023 11:35:24 -0300 Subject: [PATCH 096/160] Run tests in parallel --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 61e7a377..f9b02c12 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,7 +80,7 @@ jobs: KNAPSACK_LOG_LEVEL: info PARALLEL_TESTS_CONCURRENCY: 2 run: | - bundle exec rake parallel_test -n $PARALLEL_TESTS_CONCURRENCY -e "./bin/parallel_tests" + bundle exec rake parallel_test -n $PARALLEL_TESTS_CONCURRENCY - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From fe677704ee595ea63c734d36377a87e13824bc96 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 23 Aug 2023 11:39:51 -0300 Subject: [PATCH 097/160] Run tests in parallel --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f9b02c12..e7e4b696 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,7 +80,7 @@ jobs: KNAPSACK_LOG_LEVEL: info PARALLEL_TESTS_CONCURRENCY: 2 run: | - bundle exec rake parallel_test -n $PARALLEL_TESTS_CONCURRENCY + bundle exec rake parallel_rspec -n $PARALLEL_TESTS_CONCURRENCY - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From 7f15cde09d1afd3b4304e4f0d5f4ba7808040422 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 23 Aug 2023 11:47:22 -0300 Subject: [PATCH 098/160] Run tests in parallel --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e7e4b696..441bd512 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,7 +80,7 @@ jobs: KNAPSACK_LOG_LEVEL: info PARALLEL_TESTS_CONCURRENCY: 2 run: | - bundle exec rake parallel_rspec -n $PARALLEL_TESTS_CONCURRENCY + bundle exec rake parallel:rspec -n $PARALLEL_TESTS_CONCURRENCY - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From f462bbdfdfde94e86d2fda191af7f3271ea5495a Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 23 Aug 2023 11:49:10 -0300 Subject: [PATCH 099/160] Run tests in parallel --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 441bd512..9ad559d0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,7 +80,7 @@ jobs: KNAPSACK_LOG_LEVEL: info PARALLEL_TESTS_CONCURRENCY: 2 run: | - bundle exec rake parallel:rspec -n $PARALLEL_TESTS_CONCURRENCY + bundle exec rake parallel:spec -n $PARALLEL_TESTS_CONCURRENCY - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From a6c27abc1ebc20e3bae2fdf798ced2b16fe3d81b Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 23 Aug 2023 11:54:54 -0300 Subject: [PATCH 100/160] Run tests in parallel --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9ad559d0..ea1f1caa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,7 +80,7 @@ jobs: KNAPSACK_LOG_LEVEL: info PARALLEL_TESTS_CONCURRENCY: 2 run: | - bundle exec rake parallel:spec -n $PARALLEL_TESTS_CONCURRENCY + bundle exec rake parallel:spec -n $PARALLEL_TESTS_CONCURRENCY --exec './bin/parallel_tests' - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From bf434c670084506c1160fc194334fd2c63eda9e3 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 23 Aug 2023 11:58:31 -0300 Subject: [PATCH 101/160] Run tests in parallel --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ea1f1caa..e126fe6c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,7 +80,7 @@ jobs: KNAPSACK_LOG_LEVEL: info PARALLEL_TESTS_CONCURRENCY: 2 run: | - bundle exec rake parallel:spec -n $PARALLEL_TESTS_CONCURRENCY --exec './bin/parallel_tests' + bundle exec rake parallel:spec - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From d6d477d1edbb5a0bbb124a33ceea57a706552e34 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 23 Aug 2023 12:42:06 -0300 Subject: [PATCH 102/160] Run tests in parallel --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e126fe6c..9ad559d0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,7 +80,7 @@ jobs: KNAPSACK_LOG_LEVEL: info PARALLEL_TESTS_CONCURRENCY: 2 run: | - bundle exec rake parallel:spec + bundle exec rake parallel:spec -n $PARALLEL_TESTS_CONCURRENCY - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From ddc745667c49eae31662234428b60fbb40ed1b4b Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 23 Aug 2023 12:44:38 -0300 Subject: [PATCH 103/160] Run tests in parallel --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9ad559d0..98b9d4e3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,7 +80,7 @@ jobs: KNAPSACK_LOG_LEVEL: info PARALLEL_TESTS_CONCURRENCY: 2 run: | - bundle exec rake parallel:spec -n $PARALLEL_TESTS_CONCURRENCY + bundle exec rake parallel:spec -e './bin/parallel_tests' - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From e3faa9298b37b471dfa3225409bfc84ed6e7c3dd Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 23 Aug 2023 12:51:24 -0300 Subject: [PATCH 104/160] Run tests in parallel --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 98b9d4e3..550c0d12 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,7 +80,7 @@ jobs: KNAPSACK_LOG_LEVEL: info PARALLEL_TESTS_CONCURRENCY: 2 run: | - bundle exec rake parallel:spec -e './bin/parallel_tests' + bundle exec rake parallel_tests - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From 6bf433b0f0b656edc18feded971c2d7592eb56cf Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 23 Aug 2023 14:31:30 -0300 Subject: [PATCH 105/160] Test --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 550c0d12..94d96a05 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,7 +80,7 @@ jobs: KNAPSACK_LOG_LEVEL: info PARALLEL_TESTS_CONCURRENCY: 2 run: | - bundle exec rake parallel_tests + bundle exec parallel_test -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From ef7cf201790098a9e40767f223195c7ce0676dec Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 23 Aug 2023 14:35:24 -0300 Subject: [PATCH 106/160] Test --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 94d96a05..0da98652 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,7 +80,7 @@ jobs: KNAPSACK_LOG_LEVEL: info PARALLEL_TESTS_CONCURRENCY: 2 run: | - bundle exec parallel_test -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' + bundle exec parallel_rspec -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' --verbose - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From cecd0f4fbde454aab0a433fe7441e795252171b2 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 23 Aug 2023 14:37:20 -0300 Subject: [PATCH 107/160] Test --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0da98652..353334ea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,7 +80,7 @@ jobs: KNAPSACK_LOG_LEVEL: info PARALLEL_TESTS_CONCURRENCY: 2 run: | - bundle exec parallel_rspec -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' --verbose + bundle exec parallel_rspec --first-is-1 -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' --verbose - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From 828230b28fba34467b130707053c651f34600611 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 23 Aug 2023 14:38:29 -0300 Subject: [PATCH 108/160] Test --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 353334ea..43fbe3d2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,7 +80,7 @@ jobs: KNAPSACK_LOG_LEVEL: info PARALLEL_TESTS_CONCURRENCY: 2 run: | - bundle exec parallel_rspec --first-is-1 -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' --verbose + bundle exec parallel_spec --first-is-1 -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' --verbose - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From a38870c5e96beac5a2c352cfb6baf3eb0e0523c4 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 23 Aug 2023 14:44:20 -0300 Subject: [PATCH 109/160] Test --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 43fbe3d2..353334ea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,7 +80,7 @@ jobs: KNAPSACK_LOG_LEVEL: info PARALLEL_TESTS_CONCURRENCY: 2 run: | - bundle exec parallel_spec --first-is-1 -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' --verbose + bundle exec parallel_rspec --first-is-1 -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' --verbose - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From eb0ad37a98fc92a51ff37c6e15816fbf72c28b20 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 23 Aug 2023 14:46:24 -0300 Subject: [PATCH 110/160] Test --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 353334ea..a2397380 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,7 +80,7 @@ jobs: KNAPSACK_LOG_LEVEL: info PARALLEL_TESTS_CONCURRENCY: 2 run: | - bundle exec parallel_rspec --first-is-1 -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' --verbose + bundle exec parallel:spec --first-is-1 -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' --verbose - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From 223746293ef985eb21a8a9c17f1f9a868ea7eaab Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 23 Aug 2023 14:49:26 -0300 Subject: [PATCH 111/160] test --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a2397380..41635bb4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,8 +79,7 @@ jobs: KNAPSACK_CI_NODE_INDEX: ${{ matrix.ci_node_index }} KNAPSACK_LOG_LEVEL: info PARALLEL_TESTS_CONCURRENCY: 2 - run: | - bundle exec parallel:spec --first-is-1 -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' --verbose + run: bundle exec parallel_rspec --first-is-1 -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' --verbose - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From 0fcee6bd238db97bbe3496a1a3f55b1a1bc260ae Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 23 Aug 2023 14:51:51 -0300 Subject: [PATCH 112/160] testing --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 41635bb4..e126fe6c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,7 +79,8 @@ jobs: KNAPSACK_CI_NODE_INDEX: ${{ matrix.ci_node_index }} KNAPSACK_LOG_LEVEL: info PARALLEL_TESTS_CONCURRENCY: 2 - run: bundle exec parallel_rspec --first-is-1 -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' --verbose + run: | + bundle exec rake parallel:spec - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From fcc66ac7071548dfa0a3e1d55b55f97ce28c0640 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 23 Aug 2023 14:54:37 -0300 Subject: [PATCH 113/160] test --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e126fe6c..489a362d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,7 +80,7 @@ jobs: KNAPSACK_LOG_LEVEL: info PARALLEL_TESTS_CONCURRENCY: 2 run: | - bundle exec rake parallel:spec + bundle exec parallel_test --first-is-1 -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' --verbose - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From f2c057387360bc07bc0568cd5f81e8d72b97b7bb Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 23 Aug 2023 14:57:40 -0300 Subject: [PATCH 114/160] test --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 489a362d..2714e88b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,7 +68,7 @@ jobs: - name: Setup Database run: | bundle exec rails db:create db:migrate - bundle exec rake parallel:setup + bundle exec rake parallel:create --verbose - name: Check for untracked changes in schema.rb uses: rootstrap/check_untracked_changes@v1 with: @@ -80,7 +80,7 @@ jobs: KNAPSACK_LOG_LEVEL: info PARALLEL_TESTS_CONCURRENCY: 2 run: | - bundle exec parallel_test --first-is-1 -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' --verbose + bundle exec rake parallel:spec --verbose - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From c0106b56f5d9960ac32d16d6448f7dd0049d6d46 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 23 Aug 2023 15:00:41 -0300 Subject: [PATCH 115/160] test --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2714e88b..d7dab75d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,8 +67,7 @@ jobs: run: bundle install - name: Setup Database run: | - bundle exec rails db:create db:migrate - bundle exec rake parallel:create --verbose + bundle exec rake parallel:setup --verbose - name: Check for untracked changes in schema.rb uses: rootstrap/check_untracked_changes@v1 with: From 6d6c5597a243ed0af024ea19e797cd9098fb39f3 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 23 Aug 2023 15:04:15 -0300 Subject: [PATCH 116/160] test --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d7dab75d..3ec06324 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,7 +67,7 @@ jobs: run: bundle install - name: Setup Database run: | - bundle exec rake parallel:setup --verbose + bundle exec rake parallel:setup - name: Check for untracked changes in schema.rb uses: rootstrap/check_untracked_changes@v1 with: @@ -79,7 +79,7 @@ jobs: KNAPSACK_LOG_LEVEL: info PARALLEL_TESTS_CONCURRENCY: 2 run: | - bundle exec rake parallel:spec --verbose + bundle exec parallel_rspec --first-is-1 -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' --verbose - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From c5d5701c57ca675f0dcaa104361dc4a8697a1bf6 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 23 Aug 2023 15:06:05 -0300 Subject: [PATCH 117/160] test --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3ec06324..a818486f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,7 +79,7 @@ jobs: KNAPSACK_LOG_LEVEL: info PARALLEL_TESTS_CONCURRENCY: 2 run: | - bundle exec parallel_rspec --first-is-1 -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' --verbose + bundle exec parallel_spec --first-is-1 -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' --verbose - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From 85f8f9f063dec19eb09d719500fe12c080f59b2d Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 23 Aug 2023 15:27:09 -0300 Subject: [PATCH 118/160] test --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a818486f..3ec06324 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,7 +79,7 @@ jobs: KNAPSACK_LOG_LEVEL: info PARALLEL_TESTS_CONCURRENCY: 2 run: | - bundle exec parallel_spec --first-is-1 -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' --verbose + bundle exec parallel_rspec --first-is-1 -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' --verbose - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From 64bf47b378d0997bc2ba0b316b55bb17e192ea28 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 23 Aug 2023 15:40:50 -0300 Subject: [PATCH 119/160] test --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3ec06324..4e61557e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,6 +64,8 @@ jobs: chmod +x ./cc-test-reporter ./cc-test-reporter before-build - name: Install dependencies + env: + RAILS_ENV: test run: bundle install - name: Setup Database run: | From 25f43ed2b8eb23d7da48108b666945d9b8b600e3 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 23 Aug 2023 15:44:23 -0300 Subject: [PATCH 120/160] test --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4e61557e..c013f428 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,6 +80,7 @@ jobs: KNAPSACK_CI_NODE_INDEX: ${{ matrix.ci_node_index }} KNAPSACK_LOG_LEVEL: info PARALLEL_TESTS_CONCURRENCY: 2 + RAILS_ENV: test run: | bundle exec parallel_rspec --first-is-1 -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' --verbose - name: Check for missing annotations From fe64f3cd9d4a54013949ae8022a83a893061cd36 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 23 Aug 2023 15:48:21 -0300 Subject: [PATCH 121/160] test --- .github/workflows/ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c013f428..3ec06324 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,8 +64,6 @@ jobs: chmod +x ./cc-test-reporter ./cc-test-reporter before-build - name: Install dependencies - env: - RAILS_ENV: test run: bundle install - name: Setup Database run: | @@ -80,7 +78,6 @@ jobs: KNAPSACK_CI_NODE_INDEX: ${{ matrix.ci_node_index }} KNAPSACK_LOG_LEVEL: info PARALLEL_TESTS_CONCURRENCY: 2 - RAILS_ENV: test run: | bundle exec parallel_rspec --first-is-1 -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' --verbose - name: Check for missing annotations From 7970ce1e89527d62fcc9fdf61e416b73dc9fce99 Mon Sep 17 00:00:00 2001 From: Rodrigo Eizmendi Date: Wed, 23 Aug 2023 17:03:01 -0300 Subject: [PATCH 122/160] chmod +x --- bin/parallel_tests | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 bin/parallel_tests diff --git a/bin/parallel_tests b/bin/parallel_tests old mode 100644 new mode 100755 From 73c51005dee2319a0e930f75695e5ac0f6db7e63 Mon Sep 17 00:00:00 2001 From: Rodrigo Eizmendi Date: Wed, 23 Aug 2023 17:17:18 -0300 Subject: [PATCH 123/160] try again --- .github/workflows/ci.yml | 2 +- spec/spec_helper.rb | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3ec06324..d84374d7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,7 +79,7 @@ jobs: KNAPSACK_LOG_LEVEL: info PARALLEL_TESTS_CONCURRENCY: 2 run: | - bundle exec parallel_rspec --first-is-1 -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' --verbose + bundle exec parallel_rspec -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' --verbose - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 0c5d6c63..176682ab 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -20,6 +20,10 @@ Dir[Rails.root.join('spec/support/**/*.rb')].each { |file| require file } RSpec.configure do |config| + ### REMOVE ME + config.before(:suite) do + puts "RSpec is using the #{ ActiveRecord::Base.connection_db_config.configuration_hash[:database] } database." + end config.include Helpers config.expect_with :rspec do |expectations| expectations.include_chain_clauses_in_custom_matcher_descriptions = true From 4267f6f0734ec8ae257f6c8cba85e197ba4b8fc7 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Fri, 25 Aug 2023 12:48:15 -0300 Subject: [PATCH 124/160] Ignore test to see if duplicated key passes --- spec/requests/api/v1/settings_spec.rb | 58 +++++++++++++-------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/spec/requests/api/v1/settings_spec.rb b/spec/requests/api/v1/settings_spec.rb index 936801ef..5cdb420f 100644 --- a/spec/requests/api/v1/settings_spec.rb +++ b/spec/requests/api/v1/settings_spec.rb @@ -11,33 +11,33 @@ } end - context 'with correct settings' do - before { create(:setting_version) } - - it 'return success' do - subject - expect(response).to be_successful - end - - it 'returns no need to update' do - subject - expect(json['must_update']).to be(false) - end - end - - context 'with incorrect settings' do - before { create(:setting_version, value: '2.0') } - - it 'returns it needs to update' do - subject - expect(json['must_update']).to be(true) - end - end - - context 'without setting min version record' do - it 'returns no need to update' do - subject - expect(json['must_update']).to be(false) - end - end + # context 'with correct settings' do + # before { create(:setting_version) } + + # it 'return success' do + # subject + # expect(response).to be_successful + # end + + # it 'returns no need to update' do + # subject + # expect(json['must_update']).to be(false) + # end + # end + + # context 'with incorrect settings' do + # before { create(:setting_version, value: '2.0') } + + # it 'returns it needs to update' do + # subject + # expect(json['must_update']).to be(true) + # end + # end + + # context 'without setting min version record' do + # it 'returns no need to update' do + # subject + # expect(json['must_update']).to be(false) + # end + # end end From 250f7e5f9089aff0f44f354ec97cc0d41e24cee1 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Fri, 25 Aug 2023 12:52:38 -0300 Subject: [PATCH 125/160] test --- .github/workflows/ci.yml | 2 +- spec/requests/api/v1/settings_spec.rb | 58 +++++++++++++-------------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d84374d7..e58be3df 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,7 +67,7 @@ jobs: run: bundle install - name: Setup Database run: | - bundle exec rake parallel:setup + bundle exec rake parallel:load_schema - name: Check for untracked changes in schema.rb uses: rootstrap/check_untracked_changes@v1 with: diff --git a/spec/requests/api/v1/settings_spec.rb b/spec/requests/api/v1/settings_spec.rb index 5cdb420f..936801ef 100644 --- a/spec/requests/api/v1/settings_spec.rb +++ b/spec/requests/api/v1/settings_spec.rb @@ -11,33 +11,33 @@ } end - # context 'with correct settings' do - # before { create(:setting_version) } - - # it 'return success' do - # subject - # expect(response).to be_successful - # end - - # it 'returns no need to update' do - # subject - # expect(json['must_update']).to be(false) - # end - # end - - # context 'with incorrect settings' do - # before { create(:setting_version, value: '2.0') } - - # it 'returns it needs to update' do - # subject - # expect(json['must_update']).to be(true) - # end - # end - - # context 'without setting min version record' do - # it 'returns no need to update' do - # subject - # expect(json['must_update']).to be(false) - # end - # end + context 'with correct settings' do + before { create(:setting_version) } + + it 'return success' do + subject + expect(response).to be_successful + end + + it 'returns no need to update' do + subject + expect(json['must_update']).to be(false) + end + end + + context 'with incorrect settings' do + before { create(:setting_version, value: '2.0') } + + it 'returns it needs to update' do + subject + expect(json['must_update']).to be(true) + end + end + + context 'without setting min version record' do + it 'returns no need to update' do + subject + expect(json['must_update']).to be(false) + end + end end From 2ddd2de09246e3ae892705ea531c49f82bc10871 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Fri, 25 Aug 2023 12:57:14 -0300 Subject: [PATCH 126/160] Remove log --- spec/spec_helper.rb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 176682ab..0c5d6c63 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -20,10 +20,6 @@ Dir[Rails.root.join('spec/support/**/*.rb')].each { |file| require file } RSpec.configure do |config| - ### REMOVE ME - config.before(:suite) do - puts "RSpec is using the #{ ActiveRecord::Base.connection_db_config.configuration_hash[:database] } database." - end config.include Helpers config.expect_with :rspec do |expectations| expectations.include_chain_clauses_in_custom_matcher_descriptions = true From 8d9343f99d6b358f8cf15ab14961858112e2b194 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Mon, 28 Aug 2023 10:08:11 -0300 Subject: [PATCH 127/160] Remove verbose --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e58be3df..b9ca0047 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,7 +79,7 @@ jobs: KNAPSACK_LOG_LEVEL: info PARALLEL_TESTS_CONCURRENCY: 2 run: | - bundle exec parallel_rspec -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' --verbose + bundle exec parallel_rspec -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From adc46f1a9615a7bb05ba03e033d1f1b130529237 Mon Sep 17 00:00:00 2001 From: Laura Peralta Date: Mon, 28 Aug 2023 12:23:43 -0300 Subject: [PATCH 128/160] Move before-build as documentation example --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index faa511aa..46829839 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,7 +62,6 @@ jobs: run: | curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter chmod +x ./cc-test-reporter - ./cc-test-reporter before-build - name: Install dependencies run: bundle install - name: Setup Database @@ -80,6 +79,7 @@ jobs: PARALLEL_TESTS_CONCURRENCY: 2 run: | bundle exec parallel_rspec -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' + ./cc-test-reporter before-build - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories From f93f454f15e126087041318d7e00824bb9fb261f Mon Sep 17 00:00:00 2001 From: Rodrigo Eizmendi Date: Tue, 29 Aug 2023 11:16:55 -0300 Subject: [PATCH 129/160] test --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 46829839..64411aa5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,6 +80,7 @@ jobs: run: | bundle exec parallel_rspec -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' ./cc-test-reporter before-build + echo "KNAPSACK_CI_NODE_INDEX=$KNAPSACK_CI_NODE_INDEX" >> $GITHUB_ENV - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories @@ -88,12 +89,12 @@ jobs: path: "./app/ ./spec/" - name: Report to CodeClimate run: | - ./cc-test-reporter format-coverage --output "coverage/coverage.${{ matrix.ci_node_index }}.json" + ./cc-test-reporter format-coverage --output "coverage/coverage.${{ env.KNAPSACK_CI_NODE_INDEX }}.json" - name: Upload partial converage uses: actions/upload-artifact@v2 with: name: coverage - path: "coverage/coverage.${{ matrix.ci_node_index }}.json" + path: "coverage/coverage.${{ env.KNAPSACK_CI_NODE_INDEX }}.json" coverage: name: Coverage runs-on: ubuntu-latest From 7717e10041ddea20e6482a774f09fba4da110828 Mon Sep 17 00:00:00 2001 From: Rodrigo Eizmendi Date: Tue, 29 Aug 2023 15:43:58 -0300 Subject: [PATCH 130/160] Trigger Build From 0801d968c2f3b49023ac8cebf9718744fa4f1ad8 Mon Sep 17 00:00:00 2001 From: jpascual1994 <30729697+jpascual1994@users.noreply.github.com> Date: Wed, 30 Aug 2023 11:53:50 -0300 Subject: [PATCH 131/160] Update update_knapsack_report.yml --- .github/workflows/update_knapsack_report.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/update_knapsack_report.yml b/.github/workflows/update_knapsack_report.yml index 828a1f3d..34572254 100644 --- a/.github/workflows/update_knapsack_report.yml +++ b/.github/workflows/update_knapsack_report.yml @@ -1,9 +1,11 @@ name: Update Knapsack Report # This workflow should be scheduled at certain intervals -# for example, the following configuration would schedule it every 3 months -# on: -# schedule: +on: + schedule: + - cron: '0 5 31 2 *' +# The above cron does not run. Replace with the wanted periodicity. +# For example, the following configuration would schedule it every 3 months # - cron: '0 0 1 */3 *' jobs: From ac31b706eb36d66b44b142ea6ff01cfb6e23441b Mon Sep 17 00:00:00 2001 From: jpascual1994 <30729697+jpascual1994@users.noreply.github.com> Date: Wed, 30 Aug 2023 12:09:30 -0300 Subject: [PATCH 132/160] exclud code analysis --- .codeclimate.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.codeclimate.yml b/.codeclimate.yml index ebaa254b..fb082120 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -57,3 +57,4 @@ plugins: - spec/**/* exclude_patterns: - 'babel.config.js' + - 'lib/tasks/code_analysis.rake' From 29d3e332ff37f8fab19e393a5c5205b9bcc80fda Mon Sep 17 00:00:00 2001 From: Santiago Bartesaghi Date: Wed, 30 Aug 2023 12:22:31 -0300 Subject: [PATCH 133/160] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 64411aa5..82664f51 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -78,8 +78,8 @@ jobs: KNAPSACK_LOG_LEVEL: info PARALLEL_TESTS_CONCURRENCY: 2 run: | - bundle exec parallel_rspec -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' ./cc-test-reporter before-build + bundle exec parallel_rspec -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' echo "KNAPSACK_CI_NODE_INDEX=$KNAPSACK_CI_NODE_INDEX" >> $GITHUB_ENV - name: Check for missing annotations run: bundle exec annotate From b64de93122a4aa3ce7a6872ff1d178e2afc3a77e Mon Sep 17 00:00:00 2001 From: jpascual1994 <30729697+jpascual1994@users.noreply.github.com> Date: Wed, 30 Aug 2023 12:27:57 -0300 Subject: [PATCH 134/160] Update .codeclimate.yml --- .codeclimate.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.codeclimate.yml b/.codeclimate.yml index fb082120..c35e7d82 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -58,3 +58,4 @@ plugins: exclude_patterns: - 'babel.config.js' - 'lib/tasks/code_analysis.rake' + - 'bin/parallel_tests' From 8a90173b1279ce55bbb5c3b3b41c01e4ba08dfb7 Mon Sep 17 00:00:00 2001 From: Santiago Bartesaghi Date: Wed, 30 Aug 2023 12:31:53 -0300 Subject: [PATCH 135/160] Update .codeclimate.yml --- .codeclimate.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.codeclimate.yml b/.codeclimate.yml index c35e7d82..be67819e 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -59,3 +59,4 @@ exclude_patterns: - 'babel.config.js' - 'lib/tasks/code_analysis.rake' - 'bin/parallel_tests' + - 'knapsack_rspec_report.json' From 9a5c6edc8edeb3eecad2e6b477887c878ab348d7 Mon Sep 17 00:00:00 2001 From: jpascual1994 <30729697+jpascual1994@users.noreply.github.com> Date: Wed, 30 Aug 2023 12:37:59 -0300 Subject: [PATCH 136/160] test --- spec/rails_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 204da860..2b5acbc4 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -6,11 +6,11 @@ SimpleCov.start 'rails' do add_group 'Forms', 'app/forms' - add_group 'Policies', 'app/policies' add_group 'Presenters', 'app/presenters' add_filter 'app/admin' add_filter 'config' add_filter 'spec' + add_filter 'app/policies' end require File.expand_path('../config/environment', __dir__) From af2dfc342a73aa3f9f5088698db97312d2da16ea Mon Sep 17 00:00:00 2001 From: jpascual1994 <30729697+jpascual1994@users.noreply.github.com> Date: Wed, 30 Aug 2023 12:41:46 -0300 Subject: [PATCH 137/160] Update rails_helper.rb --- spec/rails_helper.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 2b5acbc4..ce67051f 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -10,7 +10,10 @@ add_filter 'app/admin' add_filter 'config' add_filter 'spec' - add_filter 'app/policies' + add_filter 'lib/tasks/code_analysis.rake' + add_filter 'lib/tasks/auto_annotate_models.rake' + add_filter 'app/controllers/application_controller.rb' + add_filter 'app/policies/admin/application_policy.rb' end require File.expand_path('../config/environment', __dir__) From fb7478487c0711dfe524e178be314133444a3dcc Mon Sep 17 00:00:00 2001 From: jpascual1994 <30729697+jpascual1994@users.noreply.github.com> Date: Wed, 30 Aug 2023 12:53:57 -0300 Subject: [PATCH 138/160] Update .codeclimate.yml --- .codeclimate.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.codeclimate.yml b/.codeclimate.yml index be67819e..ebaa254b 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -57,6 +57,3 @@ plugins: - spec/**/* exclude_patterns: - 'babel.config.js' - - 'lib/tasks/code_analysis.rake' - - 'bin/parallel_tests' - - 'knapsack_rspec_report.json' From 5b189db79029a5d42bfd31c0f8216fbc12aa599b Mon Sep 17 00:00:00 2001 From: jpascual1994 <30729697+jpascual1994@users.noreply.github.com> Date: Wed, 30 Aug 2023 12:55:12 -0300 Subject: [PATCH 139/160] Update rails_helper.rb --- spec/rails_helper.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index ce67051f..5c8db7c2 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -6,14 +6,12 @@ SimpleCov.start 'rails' do add_group 'Forms', 'app/forms' + add_group 'Policies', 'app/policies' add_group 'Presenters', 'app/presenters' add_filter 'app/admin' add_filter 'config' add_filter 'spec' add_filter 'lib/tasks/code_analysis.rake' - add_filter 'lib/tasks/auto_annotate_models.rake' - add_filter 'app/controllers/application_controller.rb' - add_filter 'app/policies/admin/application_policy.rb' end require File.expand_path('../config/environment', __dir__) From 3816085d643a0fff053d5ab20f37c1d77c214dac Mon Sep 17 00:00:00 2001 From: jpascual1994 <30729697+jpascual1994@users.noreply.github.com> Date: Thu, 31 Aug 2023 10:33:03 -0300 Subject: [PATCH 140/160] Fix typo Co-authored-by: enzofab91 --- .github/workflows/update_knapsack_report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update_knapsack_report.yml b/.github/workflows/update_knapsack_report.yml index 34572254..e5177e86 100644 --- a/.github/workflows/update_knapsack_report.yml +++ b/.github/workflows/update_knapsack_report.yml @@ -64,6 +64,6 @@ jobs: debug: true draft: false body: > - This is a automated PR. Knapsack uses the report file to distribute tests across different nodes + This is an automated PR. Knapsack uses the report file to distribute tests across different nodes so that they all have similar execution times. It's advisable to update the report periodically, especially if many test files have been added, for better distribution. From fbaad57c30d00e9c8924a01ac915516186174e01 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Thu, 31 Aug 2023 12:49:41 -0300 Subject: [PATCH 141/160] remove unnecessary env --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 82664f51..6f792914 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,8 +10,6 @@ jobs: linters: name: Linters runs-on: ubuntu-latest - env: - RAILS_ENV: test steps: - name: Checkout code uses: actions/checkout@v3 From d244d87f067bf0b24d2616d1b12d63a282b7208b Mon Sep 17 00:00:00 2001 From: Rodrigo Eizmendi Date: Thu, 31 Aug 2023 14:47:07 -0300 Subject: [PATCH 142/160] revert previous unncesary changes --- .github/workflows/ci.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6f792914..fc0d0941 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -78,7 +78,6 @@ jobs: run: | ./cc-test-reporter before-build bundle exec parallel_rspec -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' - echo "KNAPSACK_CI_NODE_INDEX=$KNAPSACK_CI_NODE_INDEX" >> $GITHUB_ENV - name: Check for missing annotations run: bundle exec annotate - name: Check for untracked changes in app and spec directories @@ -87,12 +86,12 @@ jobs: path: "./app/ ./spec/" - name: Report to CodeClimate run: | - ./cc-test-reporter format-coverage --output "coverage/coverage.${{ env.KNAPSACK_CI_NODE_INDEX }}.json" + ./cc-test-reporter format-coverage --output "coverage/coverage.${{ matrix.ci_node_index }}.json" - name: Upload partial converage uses: actions/upload-artifact@v2 with: name: coverage - path: "coverage/coverage.${{ env.KNAPSACK_CI_NODE_INDEX }}.json" + path: "coverage/coverage.${{ matrix.ci_node_index }}.json" coverage: name: Coverage runs-on: ubuntu-latest From ce9f84d1026a7dd5e765267574e8eb96ffa51591 Mon Sep 17 00:00:00 2001 From: Rodrigo Eizmendi Date: Mon, 4 Sep 2023 15:45:45 -0300 Subject: [PATCH 143/160] some review comments --- .github/workflows/ci.yml | 17 +++++++++-------- .github/workflows/update_knapsack_report.yml | 4 +--- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fc0d0941..801ee02a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: services: db: - image: postgres:9.4 + image: postgres:15 env: POSTGRES_USER: postgres POSTGRES_HOST_AUTH_METHOD: trust @@ -44,10 +44,10 @@ jobs: # Set N number of parallel jobs you want to run tests on. # Use higher number if you have slow tests to split them on more parallel jobs. # Remember to update ci_node_index below to 0..N-1 - ci_node_total: [4] + ci_node_total: [1] # set N-1 indexes for parallel jobs # When you run 2 parallel jobs then first job will have index 0, the second job will have index 1 etc - ci_node_index: [0, 1, 2, 3] + ci_node_index: [0] steps: - name: Checkout code @@ -60,8 +60,7 @@ jobs: run: | curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter chmod +x ./cc-test-reporter - - name: Install dependencies - run: bundle install + ./cc-test-reporter before-build - name: Setup Database run: | bundle exec rake parallel:load_schema @@ -69,14 +68,16 @@ jobs: uses: rootstrap/check_untracked_changes@v1 with: path: "./db/schema.rb" + - name: Get CPU info + id: cpu_info + run: | + echo "cpu_cores=$(nproc)" >> $GITHUB_ENV - name: Run Tests env: KNAPSACK_CI_NODE_TOTAL: ${{ matrix.ci_node_total }} KNAPSACK_CI_NODE_INDEX: ${{ matrix.ci_node_index }} - KNAPSACK_LOG_LEVEL: info - PARALLEL_TESTS_CONCURRENCY: 2 + PARALLEL_TESTS_CONCURRENCY: ${{ env.cpu_cores }} run: | - ./cc-test-reporter before-build bundle exec parallel_rspec -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests' - name: Check for missing annotations run: bundle exec annotate diff --git a/.github/workflows/update_knapsack_report.yml b/.github/workflows/update_knapsack_report.yml index e5177e86..a9c54ee3 100644 --- a/.github/workflows/update_knapsack_report.yml +++ b/.github/workflows/update_knapsack_report.yml @@ -14,7 +14,7 @@ jobs: services: db: - image: postgres:9.4 + image: postgres:15 env: POSTGRES_USER: postgres POSTGRES_HOST_AUTH_METHOD: trust @@ -55,13 +55,11 @@ jobs: - name: Initialize Pull Request uses: peter-evans/create-pull-request@v3 with: - verbose: true pull_request_token: ${{ secrets.GITHUB_TOKEN }} head: update-knapsack-report base: main title: 'Update Knapsack report' maintainer_can_modify: true - debug: true draft: false body: > This is an automated PR. Knapsack uses the report file to distribute tests across different nodes From 94b93fad91aa7577f0475d4c111a98c8bd277da3 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 6 Sep 2023 16:37:11 -0300 Subject: [PATCH 144/160] remove unnecessary env --- README.md | 3 +++ docs/ci.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 docs/ci.md diff --git a/README.md b/README.md index e106c562..c9d62e66 100644 --- a/README.md +++ b/README.md @@ -81,9 +81,11 @@ To illustrate, `bin/rails console` will run the console in the docker container - [Faker](https://github.com/stympy/faker) for generating test data - [Flipper](https://github.com/jnunemaker/flipper) for feature flag support - [Jbuilder](https://github.com/rails/jbuilder) for json views +- [Knapsack](https://github.com/KnapsackPro/knapsack) for generating CI time report and splitting into nodes - [Letter Opener](https://github.com/ryanb/letter_opener) for previewing a mail in the browser - [Oj](https://github.com/ohler55/oj) for optimized json - [Pagy](https://github.com/ddnexus/pagy) for pagination +- [Parallel](https://github.com/grosser/parallel) for split CI in several cores - [Prosopite](https://github.com/charkost/prosopite) to detect N+1 queries - [Pry](https://github.com/pry/pry) for enhancing the ruby shell - [Puma](https://github.com/puma/puma) for the server @@ -105,6 +107,7 @@ To illustrate, `bin/rails console` will run the console in the docker container - Set your [frontend URL](https://github.com/cyu/rack-cors#origin) in `config/initializers/rack_cors.rb` - Set your mail sender in `config/initializers/devise.rb` - Config your timezone accordingly in `application.rb`. +- Config CI in parallel execution. See [docs](docs/ci.md). ## Api Docs diff --git a/docs/ci.md b/docs/ci.md new file mode 100644 index 00000000..f3a9f839 --- /dev/null +++ b/docs/ci.md @@ -0,0 +1,42 @@ +# CI + +## Parallelization with Parallel & Knapsack +Knapsack and Parallel gems allow us to run tests in several nodes at the same time, benefiint us in the execution time. Knapsack it parallelizes at node level while Parallel does it at CPU level. + +Knapsack splits tests based on an execution time report. In case there are files that were not added in the report, they will all run on the same node and may overload it, so it is strongly recommended to update the report frequently. + +## Configuration +In case you want to use this you will need a script that split spec files called `parallel_tests` which sets up the configuration, assuming you have `n_nodes * cpu_cores_quantity`. + +On Github Actions you can add any nodes you want using matrix strategy, setting up some variables: + +```sh + ci_node_total: [4] + # set N-1 indexes for parallel jobs + # When you run 2 parallel jobs then first job will have index 0, the second job will have index 1 etc + ci_node_index: [0, 1, 2, 3] +``` + +To update cpu cores quantity on every onde you can do it by updating this variable: +`PARALLEL_TESTS_CONCURRENCY: 2` + +To update tests on local machine you can by executing `KNAPSACK_CI_NODE_TOTAL=4 KNAPSACK_CI_NODE_INDEX=1 PARALLEL_TESTS_CONCURRENCY=2 bundle exec parallel_rspec -n 2 -e './bin/parallel_tests'`. This will run subset of tests files corresponding to second node. + +## Generating report +Knapsack report needs to be updated frequently to balance execution time among nodes. This can be done manually by executing: +`knapsack_generate_generate_report: true bundle exec knapsack:rspec` + +It is also recommended to generate the report in the CI for a better precision. For this you have available a workflow in Github Actions that triggers the report generation and creates a pull request automatically. This workflow can be scheduled in the frequency you want or even can be manually triggered. + +To schedule the cron task you have to do it in `.github/workflows/update_knapsack_report.yml:6` +Now is setted on February 31th so will never run. + +```sh + - cron: '0 5 31 2 *' + # The above cron does not run. Replace with the wanted periodicity. +``` +## Coverage +When splitting tests in different nodes each one reports only coverate of a part of the code files are testing. +For this reason a job in the CI is added to sums coverages from all nodes to be uses by SimpleCov. This job will be executed after all nodes have finished and will send the final report to CodeClimate. + +For the case of CPU cores we do not need to add extra configuration since the report of each node contains the info of all the cores that have been splited. From c9608ec0508fc72b300074d2e9cd052c6915142f Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 6 Sep 2023 17:02:51 -0300 Subject: [PATCH 145/160] CR fixes --- docs/ci.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/ci.md b/docs/ci.md index f3a9f839..4595cd3b 100644 --- a/docs/ci.md +++ b/docs/ci.md @@ -1,7 +1,7 @@ # CI ## Parallelization with Parallel & Knapsack -Knapsack and Parallel gems allow us to run tests in several nodes at the same time, benefiint us in the execution time. Knapsack it parallelizes at node level while Parallel does it at CPU level. +Knapsack and Parallel gems allow us to run tests in several nodes at the same time, benefiting us in the execution time. Knapsack it parallelizes at node level while Parallel does it at CPU level. Knapsack splits tests based on an execution time report. In case there are files that were not added in the report, they will all run on the same node and may overload it, so it is strongly recommended to update the report frequently. @@ -36,7 +36,7 @@ Now is setted on February 31th so will never run. # The above cron does not run. Replace with the wanted periodicity. ``` ## Coverage -When splitting tests in different nodes each one reports only coverate of a part of the code files are testing. +When splitting tests in different nodes, each report covers only a part of the code files being tested. For this reason a job in the CI is added to sums coverages from all nodes to be uses by SimpleCov. This job will be executed after all nodes have finished and will send the final report to CodeClimate. For the case of CPU cores we do not need to add extra configuration since the report of each node contains the info of all the cores that have been splited. From c6b20636b7640c1a468fc5a6fe4db3c577ecebfd Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Thu, 7 Sep 2023 10:17:18 -0300 Subject: [PATCH 146/160] CR fixes --- docs/ci.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/ci.md b/docs/ci.md index 4595cd3b..3f85f53a 100644 --- a/docs/ci.md +++ b/docs/ci.md @@ -17,7 +17,7 @@ On Github Actions you can add any nodes you want using matrix strategy, setting ci_node_index: [0, 1, 2, 3] ``` -To update cpu cores quantity on every onde you can do it by updating this variable: +To update CPU cores quantity on every node you can do it by updating this variable: `PARALLEL_TESTS_CONCURRENCY: 2` To update tests on local machine you can by executing `KNAPSACK_CI_NODE_TOTAL=4 KNAPSACK_CI_NODE_INDEX=1 PARALLEL_TESTS_CONCURRENCY=2 bundle exec parallel_rspec -n 2 -e './bin/parallel_tests'`. This will run subset of tests files corresponding to second node. @@ -29,7 +29,7 @@ Knapsack report needs to be updated frequently to balance execution time among n It is also recommended to generate the report in the CI for a better precision. For this you have available a workflow in Github Actions that triggers the report generation and creates a pull request automatically. This workflow can be scheduled in the frequency you want or even can be manually triggered. To schedule the cron task you have to do it in `.github/workflows/update_knapsack_report.yml:6` -Now is setted on February 31th so will never run. +It is now scheduled for February 31 so will never run. ```sh - cron: '0 5 31 2 *' @@ -37,6 +37,6 @@ Now is setted on February 31th so will never run. ``` ## Coverage When splitting tests in different nodes, each report covers only a part of the code files being tested. -For this reason a job in the CI is added to sums coverages from all nodes to be uses by SimpleCov. This job will be executed after all nodes have finished and will send the final report to CodeClimate. +For this reason a job in the CI is added to sums coverages from all nodes to be used by SimpleCov. This job will be executed after all nodes have finished and will send the final report to CodeClimate. For the case of CPU cores we do not need to add extra configuration since the report of each node contains the info of all the cores that have been splited. From 59317d0391affb4b34229008002adbf88c2d9ccb Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Thu, 7 Sep 2023 10:31:16 -0300 Subject: [PATCH 147/160] Update cpu quantity info --- docs/ci.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/ci.md b/docs/ci.md index 3f85f53a..d460bc71 100644 --- a/docs/ci.md +++ b/docs/ci.md @@ -17,7 +17,8 @@ On Github Actions you can add any nodes you want using matrix strategy, setting ci_node_index: [0, 1, 2, 3] ``` -To update CPU cores quantity on every node you can do it by updating this variable: +CPU cores quantity on every node are obtained automatically from Github Actions config `echo "cpu_cores=$(nproc)" >> $GITHUB_ENV` +If you want to update it manually you can do it by updating this variable: `PARALLEL_TESTS_CONCURRENCY: 2` To update tests on local machine you can by executing `KNAPSACK_CI_NODE_TOTAL=4 KNAPSACK_CI_NODE_INDEX=1 PARALLEL_TESTS_CONCURRENCY=2 bundle exec parallel_rspec -n 2 -e './bin/parallel_tests'`. This will run subset of tests files corresponding to second node. From d0d479920dddb281744c5ffcbc44c69de4b8ea65 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Thu, 7 Sep 2023 10:31:56 -0300 Subject: [PATCH 148/160] Update cpu quantity info --- docs/ci.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/ci.md b/docs/ci.md index d460bc71..1868531e 100644 --- a/docs/ci.md +++ b/docs/ci.md @@ -17,7 +17,8 @@ On Github Actions you can add any nodes you want using matrix strategy, setting ci_node_index: [0, 1, 2, 3] ``` -CPU cores quantity on every node are obtained automatically from Github Actions config `echo "cpu_cores=$(nproc)" >> $GITHUB_ENV` +CPU cores quantity on every node are obtained automatically from Github Actions config `echo "cpu_cores=$(nproc)" >> $GITHUB_ENV`. + If you want to update it manually you can do it by updating this variable: `PARALLEL_TESTS_CONCURRENCY: 2` From 13448df97f9a65a2ade612a93632e85794bdb35b Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Thu, 7 Sep 2023 11:34:37 -0300 Subject: [PATCH 149/160] Text change --- docs/ci.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ci.md b/docs/ci.md index 1868531e..71c6752f 100644 --- a/docs/ci.md +++ b/docs/ci.md @@ -1,7 +1,7 @@ # CI ## Parallelization with Parallel & Knapsack -Knapsack and Parallel gems allow us to run tests in several nodes at the same time, benefiting us in the execution time. Knapsack it parallelizes at node level while Parallel does it at CPU level. +Knapsack and Parallel gems allow us to run tests in several nodes at the same time, benefiting us in the execution time. Knapsack parallelizes them at node level while Parallel does it at CPU level. Knapsack splits tests based on an execution time report. In case there are files that were not added in the report, they will all run on the same node and may overload it, so it is strongly recommended to update the report frequently. From 7c654efe06435c7972f43f82c1a067f628399793 Mon Sep 17 00:00:00 2001 From: Rodrigo Eizmendi Date: Thu, 7 Sep 2023 12:20:43 -0300 Subject: [PATCH 150/160] update ci knapsack workflow --- .github/workflows/update_knapsack_report.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/update_knapsack_report.yml b/.github/workflows/update_knapsack_report.yml index a9c54ee3..3e9a13d4 100644 --- a/.github/workflows/update_knapsack_report.yml +++ b/.github/workflows/update_knapsack_report.yml @@ -36,10 +36,6 @@ jobs: with: ruby-version: 3.1 github_token: ${{ secrets.GITHUB_TOKEN }} - - name: Ruby gems - run: | - gem install bundler - bundle install --jobs 4 --retry 3 - name: Setup Database run: bundle exec rails db:create db:migrate - name: Update Knapsack Report @@ -53,7 +49,7 @@ jobs: - name: Push changes run: git push origin HEAD:update-knapsack-report - name: Initialize Pull Request - uses: peter-evans/create-pull-request@v3 + uses: rootstrap/create-pull-request@v3 with: pull_request_token: ${{ secrets.GITHUB_TOKEN }} head: update-knapsack-report From acc8fa72203a7a2566375ea6de964ec86f2cbcea Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 6 Sep 2023 16:37:11 -0300 Subject: [PATCH 151/160] remove unnecessary env --- README.md | 3 +++ docs/ci.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 docs/ci.md diff --git a/README.md b/README.md index e106c562..c9d62e66 100644 --- a/README.md +++ b/README.md @@ -81,9 +81,11 @@ To illustrate, `bin/rails console` will run the console in the docker container - [Faker](https://github.com/stympy/faker) for generating test data - [Flipper](https://github.com/jnunemaker/flipper) for feature flag support - [Jbuilder](https://github.com/rails/jbuilder) for json views +- [Knapsack](https://github.com/KnapsackPro/knapsack) for generating CI time report and splitting into nodes - [Letter Opener](https://github.com/ryanb/letter_opener) for previewing a mail in the browser - [Oj](https://github.com/ohler55/oj) for optimized json - [Pagy](https://github.com/ddnexus/pagy) for pagination +- [Parallel](https://github.com/grosser/parallel) for split CI in several cores - [Prosopite](https://github.com/charkost/prosopite) to detect N+1 queries - [Pry](https://github.com/pry/pry) for enhancing the ruby shell - [Puma](https://github.com/puma/puma) for the server @@ -105,6 +107,7 @@ To illustrate, `bin/rails console` will run the console in the docker container - Set your [frontend URL](https://github.com/cyu/rack-cors#origin) in `config/initializers/rack_cors.rb` - Set your mail sender in `config/initializers/devise.rb` - Config your timezone accordingly in `application.rb`. +- Config CI in parallel execution. See [docs](docs/ci.md). ## Api Docs diff --git a/docs/ci.md b/docs/ci.md new file mode 100644 index 00000000..f3a9f839 --- /dev/null +++ b/docs/ci.md @@ -0,0 +1,42 @@ +# CI + +## Parallelization with Parallel & Knapsack +Knapsack and Parallel gems allow us to run tests in several nodes at the same time, benefiint us in the execution time. Knapsack it parallelizes at node level while Parallel does it at CPU level. + +Knapsack splits tests based on an execution time report. In case there are files that were not added in the report, they will all run on the same node and may overload it, so it is strongly recommended to update the report frequently. + +## Configuration +In case you want to use this you will need a script that split spec files called `parallel_tests` which sets up the configuration, assuming you have `n_nodes * cpu_cores_quantity`. + +On Github Actions you can add any nodes you want using matrix strategy, setting up some variables: + +```sh + ci_node_total: [4] + # set N-1 indexes for parallel jobs + # When you run 2 parallel jobs then first job will have index 0, the second job will have index 1 etc + ci_node_index: [0, 1, 2, 3] +``` + +To update cpu cores quantity on every onde you can do it by updating this variable: +`PARALLEL_TESTS_CONCURRENCY: 2` + +To update tests on local machine you can by executing `KNAPSACK_CI_NODE_TOTAL=4 KNAPSACK_CI_NODE_INDEX=1 PARALLEL_TESTS_CONCURRENCY=2 bundle exec parallel_rspec -n 2 -e './bin/parallel_tests'`. This will run subset of tests files corresponding to second node. + +## Generating report +Knapsack report needs to be updated frequently to balance execution time among nodes. This can be done manually by executing: +`knapsack_generate_generate_report: true bundle exec knapsack:rspec` + +It is also recommended to generate the report in the CI for a better precision. For this you have available a workflow in Github Actions that triggers the report generation and creates a pull request automatically. This workflow can be scheduled in the frequency you want or even can be manually triggered. + +To schedule the cron task you have to do it in `.github/workflows/update_knapsack_report.yml:6` +Now is setted on February 31th so will never run. + +```sh + - cron: '0 5 31 2 *' + # The above cron does not run. Replace with the wanted periodicity. +``` +## Coverage +When splitting tests in different nodes each one reports only coverate of a part of the code files are testing. +For this reason a job in the CI is added to sums coverages from all nodes to be uses by SimpleCov. This job will be executed after all nodes have finished and will send the final report to CodeClimate. + +For the case of CPU cores we do not need to add extra configuration since the report of each node contains the info of all the cores that have been splited. From c1f8862c2b55391e44ccfc8d69eb1728c86fc530 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Wed, 6 Sep 2023 17:02:51 -0300 Subject: [PATCH 152/160] CR fixes --- docs/ci.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/ci.md b/docs/ci.md index f3a9f839..4595cd3b 100644 --- a/docs/ci.md +++ b/docs/ci.md @@ -1,7 +1,7 @@ # CI ## Parallelization with Parallel & Knapsack -Knapsack and Parallel gems allow us to run tests in several nodes at the same time, benefiint us in the execution time. Knapsack it parallelizes at node level while Parallel does it at CPU level. +Knapsack and Parallel gems allow us to run tests in several nodes at the same time, benefiting us in the execution time. Knapsack it parallelizes at node level while Parallel does it at CPU level. Knapsack splits tests based on an execution time report. In case there are files that were not added in the report, they will all run on the same node and may overload it, so it is strongly recommended to update the report frequently. @@ -36,7 +36,7 @@ Now is setted on February 31th so will never run. # The above cron does not run. Replace with the wanted periodicity. ``` ## Coverage -When splitting tests in different nodes each one reports only coverate of a part of the code files are testing. +When splitting tests in different nodes, each report covers only a part of the code files being tested. For this reason a job in the CI is added to sums coverages from all nodes to be uses by SimpleCov. This job will be executed after all nodes have finished and will send the final report to CodeClimate. For the case of CPU cores we do not need to add extra configuration since the report of each node contains the info of all the cores that have been splited. From 32f1f3e5ba967a5317de7ceebedf523431ee4ceb Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Thu, 7 Sep 2023 10:17:18 -0300 Subject: [PATCH 153/160] CR fixes --- docs/ci.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/ci.md b/docs/ci.md index 4595cd3b..3f85f53a 100644 --- a/docs/ci.md +++ b/docs/ci.md @@ -17,7 +17,7 @@ On Github Actions you can add any nodes you want using matrix strategy, setting ci_node_index: [0, 1, 2, 3] ``` -To update cpu cores quantity on every onde you can do it by updating this variable: +To update CPU cores quantity on every node you can do it by updating this variable: `PARALLEL_TESTS_CONCURRENCY: 2` To update tests on local machine you can by executing `KNAPSACK_CI_NODE_TOTAL=4 KNAPSACK_CI_NODE_INDEX=1 PARALLEL_TESTS_CONCURRENCY=2 bundle exec parallel_rspec -n 2 -e './bin/parallel_tests'`. This will run subset of tests files corresponding to second node. @@ -29,7 +29,7 @@ Knapsack report needs to be updated frequently to balance execution time among n It is also recommended to generate the report in the CI for a better precision. For this you have available a workflow in Github Actions that triggers the report generation and creates a pull request automatically. This workflow can be scheduled in the frequency you want or even can be manually triggered. To schedule the cron task you have to do it in `.github/workflows/update_knapsack_report.yml:6` -Now is setted on February 31th so will never run. +It is now scheduled for February 31 so will never run. ```sh - cron: '0 5 31 2 *' @@ -37,6 +37,6 @@ Now is setted on February 31th so will never run. ``` ## Coverage When splitting tests in different nodes, each report covers only a part of the code files being tested. -For this reason a job in the CI is added to sums coverages from all nodes to be uses by SimpleCov. This job will be executed after all nodes have finished and will send the final report to CodeClimate. +For this reason a job in the CI is added to sums coverages from all nodes to be used by SimpleCov. This job will be executed after all nodes have finished and will send the final report to CodeClimate. For the case of CPU cores we do not need to add extra configuration since the report of each node contains the info of all the cores that have been splited. From 9bdbc001b112e2bd08bef5fb57b45bcbdbf873f4 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Thu, 7 Sep 2023 10:31:16 -0300 Subject: [PATCH 154/160] Update cpu quantity info --- docs/ci.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/ci.md b/docs/ci.md index 3f85f53a..d460bc71 100644 --- a/docs/ci.md +++ b/docs/ci.md @@ -17,7 +17,8 @@ On Github Actions you can add any nodes you want using matrix strategy, setting ci_node_index: [0, 1, 2, 3] ``` -To update CPU cores quantity on every node you can do it by updating this variable: +CPU cores quantity on every node are obtained automatically from Github Actions config `echo "cpu_cores=$(nproc)" >> $GITHUB_ENV` +If you want to update it manually you can do it by updating this variable: `PARALLEL_TESTS_CONCURRENCY: 2` To update tests on local machine you can by executing `KNAPSACK_CI_NODE_TOTAL=4 KNAPSACK_CI_NODE_INDEX=1 PARALLEL_TESTS_CONCURRENCY=2 bundle exec parallel_rspec -n 2 -e './bin/parallel_tests'`. This will run subset of tests files corresponding to second node. From 631014f189b017f782bf6f897ecdf22226423adf Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Thu, 7 Sep 2023 10:31:56 -0300 Subject: [PATCH 155/160] Update cpu quantity info --- docs/ci.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/ci.md b/docs/ci.md index d460bc71..1868531e 100644 --- a/docs/ci.md +++ b/docs/ci.md @@ -17,7 +17,8 @@ On Github Actions you can add any nodes you want using matrix strategy, setting ci_node_index: [0, 1, 2, 3] ``` -CPU cores quantity on every node are obtained automatically from Github Actions config `echo "cpu_cores=$(nproc)" >> $GITHUB_ENV` +CPU cores quantity on every node are obtained automatically from Github Actions config `echo "cpu_cores=$(nproc)" >> $GITHUB_ENV`. + If you want to update it manually you can do it by updating this variable: `PARALLEL_TESTS_CONCURRENCY: 2` From d9dacce29a0aa55319fc4acd125ad633712e7635 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Thu, 7 Sep 2023 11:34:37 -0300 Subject: [PATCH 156/160] Text change --- docs/ci.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ci.md b/docs/ci.md index 1868531e..71c6752f 100644 --- a/docs/ci.md +++ b/docs/ci.md @@ -1,7 +1,7 @@ # CI ## Parallelization with Parallel & Knapsack -Knapsack and Parallel gems allow us to run tests in several nodes at the same time, benefiting us in the execution time. Knapsack it parallelizes at node level while Parallel does it at CPU level. +Knapsack and Parallel gems allow us to run tests in several nodes at the same time, benefiting us in the execution time. Knapsack parallelizes them at node level while Parallel does it at CPU level. Knapsack splits tests based on an execution time report. In case there are files that were not added in the report, they will all run on the same node and may overload it, so it is strongly recommended to update the report frequently. From 8f7745b0a6de26b9cc46cda7f6bf4127969fadac Mon Sep 17 00:00:00 2001 From: Rodrigo Eizmendi Date: Thu, 7 Sep 2023 12:47:06 -0300 Subject: [PATCH 157/160] fix review comments --- README.md | 2 +- docs/ci.md | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c9d62e66..2eac4182 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,7 @@ To illustrate, `bin/rails console` will run the console in the docker container - [Letter Opener](https://github.com/ryanb/letter_opener) for previewing a mail in the browser - [Oj](https://github.com/ohler55/oj) for optimized json - [Pagy](https://github.com/ddnexus/pagy) for pagination -- [Parallel](https://github.com/grosser/parallel) for split CI in several cores +- [Parallel Tests](https://github.com/grosser/parallel_tests) for split CI in several cores - [Prosopite](https://github.com/charkost/prosopite) to detect N+1 queries - [Pry](https://github.com/pry/pry) for enhancing the ruby shell - [Puma](https://github.com/puma/puma) for the server diff --git a/docs/ci.md b/docs/ci.md index 71c6752f..02da3cda 100644 --- a/docs/ci.md +++ b/docs/ci.md @@ -1,7 +1,7 @@ # CI -## Parallelization with Parallel & Knapsack -Knapsack and Parallel gems allow us to run tests in several nodes at the same time, benefiting us in the execution time. Knapsack parallelizes them at node level while Parallel does it at CPU level. +## Parallelization with Parallel Tests & Knapsack +Knapsack and Parallel Tests gems allow us to run tests in several nodes at the same time, benefiting us in the execution time. Knapsack parallelizes them at node level while Parallel Tests does it at CPU level. Knapsack splits tests based on an execution time report. In case there are files that were not added in the report, they will all run on the same node and may overload it, so it is strongly recommended to update the report frequently. @@ -15,7 +15,6 @@ On Github Actions you can add any nodes you want using matrix strategy, setting # set N-1 indexes for parallel jobs # When you run 2 parallel jobs then first job will have index 0, the second job will have index 1 etc ci_node_index: [0, 1, 2, 3] -``` CPU cores quantity on every node are obtained automatically from Github Actions config `echo "cpu_cores=$(nproc)" >> $GITHUB_ENV`. @@ -26,7 +25,7 @@ To update tests on local machine you can by executing `KNAPSACK_CI_NODE_TOTAL=4 ## Generating report Knapsack report needs to be updated frequently to balance execution time among nodes. This can be done manually by executing: -`knapsack_generate_generate_report: true bundle exec knapsack:rspec` +`KNAPSACK_GENERATE_REPORT=true bundle exec rspec` It is also recommended to generate the report in the CI for a better precision. For this you have available a workflow in Github Actions that triggers the report generation and creates a pull request automatically. This workflow can be scheduled in the frequency you want or even can be manually triggered. From a5ff9d103e1fb62695c2bcc26f59c49288b7d3a9 Mon Sep 17 00:00:00 2001 From: Rodrigo Eizmendi Date: Thu, 7 Sep 2023 15:15:32 -0300 Subject: [PATCH 158/160] remove var --- .github/workflows/update_knapsack_report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update_knapsack_report.yml b/.github/workflows/update_knapsack_report.yml index 3e9a13d4..c1d54b4f 100644 --- a/.github/workflows/update_knapsack_report.yml +++ b/.github/workflows/update_knapsack_report.yml @@ -39,7 +39,7 @@ jobs: - name: Setup Database run: bundle exec rails db:create db:migrate - name: Update Knapsack Report - run: KNAPSACK=true KNAPSACK_GENERATE_REPORT=true bundle exec rspec + run: KNAPSACK_GENERATE_REPORT=true bundle exec rspec - name: Commit files run: | git config --local user.email "action@github.com" From eae899d8426a31439b5fec4db538e66f7080a309 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Fri, 8 Sep 2023 16:23:55 -0300 Subject: [PATCH 159/160] Update docs/ci.md Co-authored-by: Julian Pasquale --- docs/ci.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ci.md b/docs/ci.md index b42fc866..7df36072 100644 --- a/docs/ci.md +++ b/docs/ci.md @@ -22,7 +22,7 @@ CPU cores quantity on every node are obtained automatically from Github Actions If you want to update it manually you can do it by updating this variable: `PARALLEL_TESTS_CONCURRENCY: 2` -To update tests on local machine you can by executing `KNAPSACK_CI_NODE_TOTAL=4 KNAPSACK_CI_NODE_INDEX=1 PARALLEL_TESTS_CONCURRENCY=2 bundle exec parallel_rspec -n 2 -e './bin/parallel_tests'`. This will run subset of tests files corresponding to second node. +To update tests on local machine you can execute `KNAPSACK_CI_NODE_TOTAL=4 KNAPSACK_CI_NODE_INDEX=1 PARALLEL_TESTS_CONCURRENCY=2 bundle exec parallel_rspec -n 2 -e './bin/parallel_tests'`. This will run subset of tests files corresponding to second node. ## Generating report Knapsack report needs to be updated frequently to balance execution time among nodes. This can be done manually by executing: From 2b1d77f19ebe024645c9329b88eaf59bf0332023 Mon Sep 17 00:00:00 2001 From: enzofab91 Date: Fri, 8 Sep 2023 16:24:17 -0300 Subject: [PATCH 160/160] Update docs/ci.md Co-authored-by: Julian Pasquale --- docs/ci.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ci.md b/docs/ci.md index 7df36072..d2960f44 100644 --- a/docs/ci.md +++ b/docs/ci.md @@ -6,7 +6,7 @@ Knapsack and Parallel Tests gems allow us to run tests in several nodes at the s Knapsack splits tests based on an execution time report. In case there are files that were not added in the report, they will all run on the same node and may overload it, so it is strongly recommended to update the report frequently. ## Configuration -In case you want to use this you will need a script that split spec files called `parallel_tests` which sets up the configuration, assuming you have `n_nodes * cpu_cores_quantity`. +In case you want to use this you will need the script that splits spec files called `parallel_tests`, which sets up the configuration, assuming you have `n_nodes * cpu_cores_quantity`. On Github Actions you can add any nodes you want using matrix strategy, setting up some variables: