Skip to content

Conversation

enzofab91
Copy link
Contributor

@enzofab91 enzofab91 commented Jul 20, 2023

Board:


Description:

This PR adds Knapsack gem and basic configuration.

Copy link
Contributor

@lauperalti lauperalti left a comment

Choose a reason for hiding this comment

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

Nice! We should probably add some doc/readme later of how it works and how to use it.

"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
Copy link
Contributor

Choose a reason for hiding this comment

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

New line missing

env:
RAILS_ENV: test
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
CI_NODE_TOTAL: 1
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be like a variable? Because it probably won't be 1 forever.

@sebastiancaraballo
Copy link
Contributor

What's the status of this PR? Please add PR description

@enzofab91 enzofab91 changed the base branch from main to release/improve-ci August 8, 2023 15:30
@lauperalti
Copy link
Contributor

lauperalti commented Aug 8, 2023

What's the status of this PR? Please add PR description

Hi @sebastiancaraballo. This PR is open and needs reviews to be merged on a "feature" branch release/improve-ci to configure together with parallel tests and improve CI.

@enzofab91 enzofab91 requested a review from santib August 8, 2023 16:02
Copy link
Contributor

@sebastiancaraballo sebastiancaraballo left a comment

Choose a reason for hiding this comment

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

Will this also work locally? Maybe it's worth adding the command on the README

@@ -0,0 +1,31 @@
{
"spec/requests/api/v1/passwords/edit_spec.rb": 0.18011699999988195,
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this file be ignored? Just asking

RAILS_ENV: test
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
CI_NODE_TOTAL: 1
CI_NODE_INDEX: 0
Copy link
Member

Choose a reason for hiding this comment

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

same for this I guess?

Gemfile Outdated
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'
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
gem 'knapsack', '~> 4.0.0', '>= 4.0.0'
gem 'knapsack', '~> 4.0'

maybe that's better so we allow any 4.x version?

@santib
Copy link
Member

santib commented Aug 8, 2023

There are some logs in the CI that aren't very nice

========= Knapsack Time Offset Warning ==========
Time offset: 30s
Max allowed node time execution: 35s
Exceeded time: -27s
        
Global time execution for this CI node is fine.
Happy testing!

Need explanation? See FAQ:
https://docs.knapsackpro.com/ruby/knapsack#faq
=================================================
Read up on the benefits of a dynamic test split with Knapsack Pro Queue Mode:
https://docs.knapsackpro.com/2020/how-to-speed-up-ruby-and-javascript-tests-with-ci-parallelisation

Sign up for Knapsack Pro here:
https://knapsackpro.com/
=================================================
  1. what is that Knapsack Time Offset warning?
  2. can we remove the advertisment to purchase knapsack pro?

@santib
Copy link
Member

santib commented Aug 8, 2023

Might be good to add some docs under docs/ directory explaining what it needs to be done, e.g. re-generating the knapsack_rspec_report.json from time to time

Comment on lines 26 to 27
CI_NODE_TOTAL: ${{ secrets.CI_NODE_TOTAL || 1 }}
CI_NODE_INDEX: ${{ secrets.CI_NODE_INDEX || 0 }}
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this will be in secrets, it might be set with a matrix or something like that I guess

require 'pundit/rspec'

Knapsack.tracker.config(enable_time_offset_warning: false)

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change

Comment on lines +29 to +32
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]
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

@grosendo2006 grosendo2006 mentioned this pull request Aug 15, 2023
@enzofab91 enzofab91 merged commit 171f2ba into release/improve-ci Aug 15, 2023
@enzofab91 enzofab91 deleted the add_knapsack_gem branch August 15, 2023 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants