Skip to content

Commit 3390834

Browse files
ArturT3v0k4
andauthored
Apply suggestions from code review
Co-authored-by: Riccardo <riccardo.odone@gmail.com>
1 parent 993d65f commit 3390834

11 files changed

+13
-13
lines changed

_posts/2017-07-17-when-distributed-locks-might-be-helpful-in-ruby-on-rails-application.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,4 +254,4 @@ This may look familiar to you because it's similar to what Rails method `find_or
254254
* If possible use unique index to ensure data consistency in DB. When concurrency problem will happen then at least DB will ensure data correctness.
255255
* Use tested distribution lock solutions
256256

257-
I also recommend reading article: [Differences between transactions and locking](https://makandracards.com/makandra/31937-differences-transactions-locking).
257+
I also recommend reading the following article: [Differences between transactions and locking](https://makandracards.com/makandra/31937-differences-transactions-locking).

_posts/2018-05-27-how-to-run-tests-in-minitest-continuously-with-dynamic-test-files-loading.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ I was also looking if something similar exists in Minitest to ensure we have a p
3131

3232
## Digging into Minitest source code
3333

34-
I found out that Minitest has [class method `run`](https://github.com/minitest/minitest/blob/8a59450038f31f30fe591946bbb0418ac9f65617/lib/minitest.rb#L546) that will start running the loaded test files.
34+
I found out that Minitest comes with class method [`run`](https://github.com/minitest/minitest/blob/8a59450038f31f30fe591946bbb0418ac9f65617/lib/minitest.rb#L546) that runs the loaded test files.
3535

3636
{% highlight ruby %}
3737
# minitest/lib/minitest.rb

_posts/2018-11-08-clean-rspec-configuration-directory-structure-for-ruby-on-rails-gems-needed-in-testing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ RSpec::Sidekiq.configure do |config|
135135
end
136136
{% endhighlight %}
137137

138-
I use gems like [sidekiq-unique-jobs](https://github.com/mhenrixon/sidekiq-unique-jobs) and [rspec-sidekiq](https://github.com/wspurgin/rspec-sidekiq). Here you can read more about [Sidekiq testing](https://github.com/sidekiq/sidekiq/wiki/Testing) configuration.
138+
I use gems like [sidekiq-unique-jobs](https://github.com/mhenrixon/sidekiq-unique-jobs) and [rspec-sidekiq](https://github.com/wspurgin/rspec-sidekiq). Here you can read more about [testing Sidekiq](https://github.com/sidekiq/sidekiq/wiki/Testing).
139139

140140
## Configuration for FactoryBot (known as FactoryGirl)
141141

_posts/2018-11-30-how-to-run-travis-ci-parallel-jobs-with-build-matrix-feature-fast.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ By doing test suite split in a dynamic way across [Travis](https://knapsackpro.c
7878

7979
## Travis CI build matrix in action
8080

81-
If you would like to see how [Knapsack Pro helps split tests across parallel jobs](https://knapsackpro.com?utm_source=docs_knapsackpro&utm_medium=blog_post&utm_campaign=how-to-run-travis-ci-parallel-jobs-with-build-matrix-feature-fast) you can check open source project Consul - Open Government and E-Participation Web Software. There is a [list of CI builds for Consul](https://github.com/consuldemocracy/consuldemocracy/actions/workflows/tests.yml).
81+
The OSS [Consul - Open Government and E-Participation Web Software](https://github.com/consuldemocracy/consuldemocracy/actions/workflows/tests.yml) is a great example of how [Knapsack Pro helps split tests across parallel jobs](https://knapsackpro.com?utm_source=docs_knapsackpro&utm_medium=blog_post&utm_campaign=how-to-run-travis-ci-parallel-jobs-with-build-matrix-feature-fast).
8282

8383
<blockquote class="twitter-tweet" data-lang="en"><p lang="en" dir="ltr">I&#39;ve got cup gift for GitHub contribution to <a href="https://twitter.com/hashtag/Consul?src=hash&amp;ref_src=twsrc%5Etfw" rel="nofollow noopener noreferrer">#Consul</a> - Open Government and E-Participation Web Software <a href="https://t.co/NNIAgO3uXX" rel="nofollow noopener noreferrer">https://t.co/NNIAgO3uXX</a> that empowers <a href="https://t.co/eGO3aj0slM" rel="nofollow noopener noreferrer">https://t.co/eGO3aj0slM</a> The Consul team uses <a href="https://twitter.com/KnapsackPro?ref_src=twsrc%5Etfw" rel="nofollow noopener noreferrer">@KnapsackPro</a> to run <a href="https://twitter.com/hashtag/ruby?src=hash&amp;ref_src=twsrc%5Etfw" rel="nofollow noopener noreferrer">#ruby</a> tests faster :) Thanks <a href="https://twitter.com/bertocq?ref_src=twsrc%5Etfw" rel="nofollow noopener noreferrer">@bertocq</a> <a href="https://twitter.com/voodoorai2000?ref_src=twsrc%5Etfw" rel="nofollow noopener noreferrer">@voodoorai2000</a> <a href="https://t.co/8sowbeXlAJ" rel="nofollow noopener noreferrer">pic.twitter.com/8sowbeXlAJ</a></p>&mdash; Artur Trzop (@ArturTrzop) <a href="https://twitter.com/ArturTrzop/status/1012429838328754176?ref_src=twsrc%5Etfw" rel="nofollow noopener noreferrer">June 28, 2018</a></blockquote>
8484
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

_posts/2018-12-08-how-to-run-codeship-parallel-test-pipelines-efficiently-optimal-ci-parallelization.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ When you use CodeShip as your CI server you can significantly increase the speed
1515

1616
### Setup via CodeShip interface
1717

18-
One way is to define commands via [CodeShip interface](https://docs.cloudbees.com/docs/cloudbees-codeship/latest/basic-builds-and-configuration/parallel-tests#using-parallel-test-pipelines). Once parallel test pipelines are enabled, each project can have multiple test pipelines that will be run in parallel.
18+
One way is to define commands via the [CodeShip interface](https://docs.cloudbees.com/docs/cloudbees-codeship/latest/basic-builds-and-configuration/parallel-tests#using-parallel-test-pipelines). Once parallel test pipelines are enabled, each project can have multiple test pipelines that run in parallel.
1919

2020
In order to run CI build as fast as possible we need to ensure the parallel commands will run subset of the test suite in a way that all the commands complete at the same time to avoid slow pipeline bottleneck. To split test suite we will use [Knapsack Pro with Queue Mode which does dynamic test suite split across pipelines for Ruby and JavaScript tests](https://knapsackpro.com?utm_source=docs_knapsackpro&utm_medium=blog_post&utm_campaign=how-to-run-codeship-parallel-test-pipelines-efficiently-optimal-ci-parallelization) to keep running our tests in an optimal way across parallel pipelines (also known as CI nodes).
2121

@@ -70,7 +70,7 @@ If you use CodeShip Pro then a parallel step group is defined by using the `type
7070
command: KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=1 bundle exec rake knapsack_pro:queue:rspec
7171
{% endhighlight %}
7272

73-
More examples how to configure [CodeShip Pro parallelism](https://docs.cloudbees.com/docs/cloudbees-codeship/latest/pro-builds-and-configuration/steps#_parallelizing_steps_and_tests)
73+
More examples on how to configure [CodeShip Pro parallelism](https://docs.cloudbees.com/docs/cloudbees-codeship/latest/pro-builds-and-configuration/steps#_parallelizing_steps_and_tests)
7474

7575
## How dynamic test suite split works
7676

_posts/2018-12-16-jenkins-pipeline-how-to-run-parallel-tests-in-your-workflow-stages.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Jenkins Pipeline is a suite of plugins that allows creating simple-to-complex bu
1111

1212
<img src="/images/blog/posts/jenkins-pipeline-how-to-run-parallel-tests-in-your-workflow-stages/jenkins.jpg" style="width:300px;margin-left: 15px;float:right;" alt="Jenkins" />
1313

14-
In order to run parallel stages with [Jenkins Pipeline](https://www.jenkins.io/doc/book/pipeline/), we will need a proper Jenkinsfile which represents our delivery pipeline as code via the Pipeline domain-specific language (DSL) syntax.
14+
In order to run parallel stages with [Jenkins Pipeline](https://www.jenkins.io/doc/book/pipeline/), you need a proper Jenkinsfile which represents our delivery pipeline as code via the Pipeline DSL.
1515

1616
Another thing we will have to figure out is the problem how to divide our test suite across parallel stages in a way that each subset of test suite executed across all stages will complete work at the same time. It's important to complete the tests on all stages at a similar time to run our CI build as fast as possible and eliminate bottleneck stage.
1717

_posts/2019-05-24-codeclimate-and-circleci-2-0-parallel-builds-config-for-rspec-with-simplecov-and-junit-formatter.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ workflows:
162162

163163
## SimpleCov configuration for RSpec
164164

165-
When you use [simplecov](https://github.com/simplecov-ruby/simplecov) gem in order to create test coverage for RSpec then you need to remember about one additional thing when you want to run tests in parallel on many CircleCI jobs. You set a unique name for the simplecov report with `SimpleCov.command_name`.
165+
When you use [simplecov](https://github.com/simplecov-ruby/simplecov) with RSpec, you have to set a unique name for its report with `SimpleCov.command_name`:
166166

167167
{% highlight ruby %}
168168
# spec/rails_helper.rb or spec/spec_helper.rb

_posts/2020-09-25-how-to-build-native-integration-with-knapsack-pro-api-to-run-tests-in-parallel-for-any-test-runner-testing-framework.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Here is some basic info about the project structure. It's written in TypeScript.
5353
You can rename forked project `@knapsack-pro/cypress` to `@knapsack-pro/my-test-runner` and update the info in `package.json`.
5454

5555
- Update name to `@knapsack-pro/my-test-runner` and `version` to `1.0.0`. [See in code](https://github.com/KnapsackPro/knapsack-pro-cypress/blob/8942e0430e9b529ab27cf877b15b2d2964f89222/package.json#L2,L3).
56-
- Add your test runner package to [`peerDependency`](https://docs.npmjs.com/cli/v11/configuring-npm/package-json#peerdependencies). This allows a developer to use a runner within a specified version range when the developer installs your package in their project. [See in code](https://github.com/KnapsackPro/knapsack-pro-cypress/blob/8942e0430e9b529ab27cf877b15b2d2964f89222/package.json#L62).
56+
- Add your package to the [`peerDependency`](https://docs.npmjs.com/cli/v11/configuring-npm/package-json#peerdependencies). This enforces your users to install a specific version of the test runner in their project alongside your package. [See in code](https://github.com/KnapsackPro/knapsack-pro-cypress/blob/8942e0430e9b529ab27cf877b15b2d2964f89222/package.json#L62).
5757
- Add your test runner package to `devDependencies`. This allows using a specific version of the test runner in development for testing your `@knapsack-pro/my-test-runner` with another local project using an example test suite supported by `my-test-runner` npm package. For example, to test `@knapscak-pro/cypress` we have a [separate repository with an example test suite written in Cypress](https://github.com/KnapsackPro/cypress-example-kitchensink). We verify with it that our `@knapsack-pro/cypress` package ([See in code](https://github.com/KnapsackPro/cypress-example-kitchensink/blob/5c5ddf80f8ca0fb317572d50d5d264070bb61af0/package.json#L67)) works fine. In order to do, we've created [an example bin script](https://github.com/KnapsackPro/cypress-example-kitchensink/blob/5c5ddf80f8ca0fb317572d50d5d264070bb61af0/bin/knapsack_pro_cypress_test_file_pattern#L29) to connect with Knapsack Pro API. Please remove from it the `ENDPOINT` environment variable - this way the `@knapsack-pro/core` will connect to the production API (https://api.knapsackpro.com) by default.
5858

5959
Note how we pass to `KnapsackProCore` the list of all existing test files on the disk - [see in code](https://github.com/KnapsackPro/knapsack-pro-cypress/blob/8942e0430e9b529ab27cf877b15b2d2964f89222/src/knapsack-pro-cypress.ts#L30). This is needed to initialize the Queue on the API side with the very first request to the API (as mentioned earlier). Those test files will be used to run your tests.

_posts/2021-03-19-auto-scaling-buildkite-ci-build-agents-for-rspec-run-parallel-jobs-in-minutes-instead-of-hours.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Please note that you should hide your credentials like the Knapsack Pro API toke
8080

8181
## An advanced Buildkite config with Elastic CI Stack for AWS
8282

83-
When you want to run your big RSpec project on dozen or even hundreds of parallel machines you need powerful resources. In such a case, you can follow the [Buildkite tutorial about AWS setup](https://buildkite.com/docs/agent/v3/elastic-ci-aws). The Elastic CI Stack for AWS gives you a private, autoscaling Buildkite Agent cluster in your own AWS account.
83+
If you want to run your RSpec project on dozen or even hundreds of parallel machines, you need powerful resources. In such a case, you can follow the [Buildkite tutorial about AWS setup](https://buildkite.com/docs/agent/v3/elastic-ci-aws). The Elastic CI Stack for AWS gives you a private, autoscaling Buildkite Agent cluster in your own AWS account.
8484

8585
### AWS Spot Instances can save you money
8686

_posts/2021-04-26-estimate-database-connections-pool-size-for-rails-application.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ If you run multiple servers (Heroku dynos), then it works similarly to the Puma
132132

133133
You need to have a pool size of at least 10 in `config/database.yml` because Sidekiq by default, uses 10 threads.
134134

135-
If you use a pool size lower than 10 then Sidekiq threads will be fighting for access to limited connections in the pool. It could be fine for some time, but you should be aware that this can increase your job's processing time because not all Sidekiq threads will use DB connections in parallel. It can also lead to [a problem described here](https://github.com/sidekiq/sidekiq/wiki/Problems-and-Troubleshooting#cannot-get-database-connection-within-500-seconds).
135+
If you use a pool size smaller than 10, Sidekiq threads will contend the access to the limited connections in the pool. It may work out fine, but be aware this can increase your job's processing time. It can also lead to [this problem](https://github.com/sidekiq/sidekiq/wiki/Problems-and-Troubleshooting#cannot-get-database-connection-within-500-seconds).
136136

137137
### Sidekiq and Redis database connections
138138

@@ -144,7 +144,7 @@ Using the previous example:
144144

145145
2 servers (dynos) X 1 Sidekiq process X 10 Sidekiq threads = 2 servers (dynos) X 1 Sidekiq process X (10 + 5) = 30 Redis connections required.
146146

147-
More in [Sidekiq docs](https://github.com/sidekiq/sidekiq/wiki/Using-Redis).
147+
More on the [Sidekiq docs](https://github.com/sidekiq/sidekiq/wiki/Using-Redis).
148148

149149
## Redis database connections
150150

0 commit comments

Comments
 (0)