knapsack 1.18.0 → 1.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/CHANGELOG.md +8 -0
- data/README.md +36 -1
- data/lib/knapsack/config/env.rb +2 -2
- data/lib/knapsack/version.rb +1 -1
- data/spec/knapsack/config/env_spec.rb +10 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a50a48925cacc27dbadfc763effe1061eb2dc6dec00217e23e304080e74faee
|
4
|
+
data.tar.gz: 60b6827c19012025fa3651a6e6017b3351eee25cd76cc5c0795625bd1d6dfe09
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ec9fe137cf43655aeab8bf89c969b0969485de1d16ea4de287d3eeb08bfa9b486b3aff58b632241792464f4d175b30d433e4901c51f2cb2cb6b71e730d556b5
|
7
|
+
data.tar.gz: 94842148dfb9ae8756a127decaabb8bdf0be8d0e3a3b8d708939e46b2ee214c3fef847a82d16562368ff4a0cdcf6cdec7aa7751a4045a69eebaa47c199e5b6e4
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1 +1,36 @@
|
|
1
|
-
#
|
1
|
+
# knapsack gem
|
2
|
+
|
3
|
+
Knapsack splits tests evenly across parallel CI nodes to run fast CI build and save you time.
|
4
|
+
|
5
|
+
| | knapsack gem | knapsack_pro gem |
|
6
|
+
| -------------------------------------------- | ------------ | ---------------- |
|
7
|
+
| __Is free__ | ✓ Yes | ✓ Yes, [free plan](https://knapsackpro.com?utm_source=github&utm_medium=readme&utm_campaign=knapsack_gem&utm_content=free_plan) |
|
8
|
+
| __Regular Mode - a static tests split__ | ✓ Yes | ✓ Yes |
|
9
|
+
| __Queue Mode - a dynamic tests split__ <br>([ensures all CI nodes finish work at the same time](https://docs.knapsackpro.com/2020/how-to-speed-up-ruby-and-javascript-tests-with-ci-parallelisation)) | No | ✓ Yes |
|
10
|
+
| __Auto [split slow RSpec test file](https://knapsackpro.com/faq/question/how-to-split-slow-rspec-test-files-by-test-examples-by-individual-it) between parallel CI nodes__ <br>(a single test file can be auto split by test examples between parallel jobs) | No | ✓ Yes |
|
11
|
+
| Tracking tests timing per commit, branch | No | ✓ Yes |
|
12
|
+
| Support for other programming languages | No | ✓ Yes |
|
13
|
+
| Support for CI providers | limited | ✓ Yes |
|
14
|
+
| __Installation README__ | [Install README](http://docs.knapsackpro.com/ruby/knapsack) | [Install README](https://docs.knapsackpro.com/integration/) |
|
15
|
+
|
16
|
+
[Features of knapsack vs knapsack_pro Ruby gem](https://knapsackpro.com/features/ruby_knapsack_pro_vs_knapsack?utm_source=github&utm_medium=readme&utm_campaign=knapsack_gem&utm_content=ruby_knapsack_pro_vs_knapsack)
|
17
|
+
|
18
|
+
# Do you use Heroku?
|
19
|
+
|
20
|
+
Do you know Knapsack Pro Ruby gem is available as Heroku add-on that's currently in beta and it's free to all beta users? It works with your current CI server.
|
21
|
+
https://elements.heroku.com/addons/knapsack-pro
|
22
|
+
|
23
|
+
Knapsack Pro has Queue Mode that will split Ruby & JS tests in a dynamic way across parallel CI nodes to ensure each parallel job takes a similar time. Thanks to that there is no bottleneck in your CI pipelines.
|
24
|
+
|
25
|
+
__See introduction how the Knapsack Pro add-on works__
|
26
|
+
https://youtu.be/rmXES2N0_QU
|
27
|
+
|
28
|
+
You may also find useful article how to run parallel dynos on Heroku CI to complete tests faster
|
29
|
+
https://docs.knapsackpro.com/2019/how-to-run-tests-faster-on-heroku-ci-with-parallel-dynos
|
30
|
+
|
31
|
+
## Do you know
|
32
|
+
|
33
|
+
* Knapsack Pro is risk-free integration! Knapsack Pro runs tests in Fallback Mode if your CI servers can't reach our API for any reason.
|
34
|
+
* We don't need access to your repository. Knapsack Pro is just wrapper around test runner like RSpec, Cucumber, Minitest etc.
|
35
|
+
* Hundreds of developers use Knapsack Pro every day to run fast CI builds.
|
36
|
+
* It works with other programming languages.
|
data/lib/knapsack/config/env.rb
CHANGED
@@ -7,11 +7,11 @@ module Knapsack
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def ci_node_total
|
10
|
-
ENV['CI_NODE_TOTAL'] || ENV['CIRCLE_NODE_TOTAL'] || ENV['SEMAPHORE_JOB_COUNT'] || ENV['SEMAPHORE_THREAD_COUNT'] || ENV['BUILDKITE_PARALLEL_JOB_COUNT'] || ENV['SNAP_WORKER_TOTAL'] || 1
|
10
|
+
ENV['CI_NODE_TOTAL'] || ENV['CIRCLE_NODE_TOTAL'] || ENV['SEMAPHORE_JOB_COUNT'] || ENV['SEMAPHORE_THREAD_COUNT'] || ENV['BUILDKITE_PARALLEL_JOB_COUNT'] || ENV['SNAP_WORKER_TOTAL'] || ENV['BITBUCKET_PARALLEL_STEP_COUNT'] || 1
|
11
11
|
end
|
12
12
|
|
13
13
|
def ci_node_index
|
14
|
-
gitlab_ci_node_index || ENV['CI_NODE_INDEX'] || ENV['CIRCLE_NODE_INDEX'] || semaphore_job_index || semaphore_current_thread || ENV['BUILDKITE_PARALLEL_JOB'] || snap_ci_worker_index || 0
|
14
|
+
gitlab_ci_node_index || ENV['CI_NODE_INDEX'] || ENV['CIRCLE_NODE_INDEX'] || semaphore_job_index || semaphore_current_thread || ENV['BUILDKITE_PARALLEL_JOB'] || snap_ci_worker_index || ENV['BITBUCKET_PARALLEL_STEP'] || 0
|
15
15
|
end
|
16
16
|
|
17
17
|
def test_file_pattern
|
data/lib/knapsack/version.rb
CHANGED
@@ -46,6 +46,11 @@ describe Knapsack::Config::Env do
|
|
46
46
|
before { stub_const("ENV", { 'SNAP_WORKER_TOTAL' => 6 }) }
|
47
47
|
it { should eql 6 }
|
48
48
|
end
|
49
|
+
|
50
|
+
context 'when BITBUCKET_PARALLEL_STEP_COUNT has value' do
|
51
|
+
before { stub_const("ENV", { 'BITBUCKET_PARALLEL_STEP_COUNT' => 8 }) }
|
52
|
+
it { should eql 8 }
|
53
|
+
end
|
49
54
|
end
|
50
55
|
|
51
56
|
context "when ENV doesn't exist" do
|
@@ -91,6 +96,11 @@ describe Knapsack::Config::Env do
|
|
91
96
|
before { stub_const("ENV", { 'SNAP_WORKER_INDEX' => 4 }) }
|
92
97
|
it { should eql 3 }
|
93
98
|
end
|
99
|
+
|
100
|
+
context 'when BITBUCKET_PARALLEL_STEP has value' do
|
101
|
+
before { stub_const("ENV", { 'BITBUCKET_PARALLEL_STEP' => 7 }) }
|
102
|
+
it { should eql 7 }
|
103
|
+
end
|
94
104
|
end
|
95
105
|
|
96
106
|
context "when ENV doesn't exist" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knapsack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.19.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ArturT
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -285,7 +285,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
285
285
|
- !ruby/object:Gem::Version
|
286
286
|
version: '0'
|
287
287
|
requirements: []
|
288
|
-
rubygems_version: 3.0.
|
288
|
+
rubygems_version: 3.0.6
|
289
289
|
signing_key:
|
290
290
|
specification_version: 4
|
291
291
|
summary: Knapsack splits tests across CI nodes and makes sure that tests will run
|