Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,17 @@ jobs:
--health-interval 10s
--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]
Comment on lines +48 to +51
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great that you made it work, but for projects to start we might be good with just

Suggested change
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]
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]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay we'll keep in this way to continue with our work/ tests but before merging into master we'll change and also we'll add the documentation explaining how to use


env:
RAILS_ENV: test
Expand All @@ -64,8 +75,12 @@ jobs:
with:
path: "./db/schema.rb"
- name: Run Tests
env:
CI_NODE_TOTAL: ${{ matrix.ci_node_total }}
CI_NODE_INDEX: ${{ matrix.ci_node_index }}
KNAPSACK_LOG_LEVEL: info
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
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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'
gem 'parallel_tests', '~> 4.2'
gem 'pry-byebug', '~> 3.9', platform: :mri
gem 'pry-rails', '~> 0.3.9'
Expand Down
3 changes: 3 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -499,6 +501,7 @@ DEPENDENCIES
flipper-ui (~> 0.28.0)
i18n-tasks (~> 0.9.30)
jbuilder (~> 2.10)
knapsack (~> 4.0.0)
letter_opener (~> 1.7)
listen (~> 3.2)
oj (~> 3.9, >= 3.9.2)
Expand Down
2 changes: 2 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
require_relative 'config/application'

Rails.application.load_tasks

Knapsack.load_tasks if defined?(Knapsack)
31 changes: 31 additions & 0 deletions knapsack_rspec_report.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"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
}
4 changes: 4 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@

require 'factory_bot_rails'
require 'helpers'
require 'knapsack'
require 'webmock/rspec'
require 'shoulda/matchers'
require 'pundit/rspec'

Knapsack.tracker.config(enable_time_offset_warning: false)
Knapsack::Adapters::RSpecAdapter.bind

FactoryBot.factories.clear
FactoryBot.reload

Expand Down