knapsack 1.4.0 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +14 -14
- data/CHANGELOG.md +7 -0
- data/README.md +4 -4
- data/Rakefile +1 -1
- data/knapsack.gemspec +1 -0
- data/lib/knapsack/adapters/rspec_adapter.rb +1 -1
- data/lib/knapsack/distributors/base_distributor.rb +1 -1
- data/lib/knapsack/version.rb +1 -1
- data/spec/knapsack/allocator_builder_spec.rb +2 -2
- data/spec/knapsack/allocator_spec.rb +1 -1
- data/spec/knapsack/config/env_spec.rb +1 -1
- data/spec/knapsack/distributors/base_distributor_spec.rb +1 -1
- data/spec/knapsack/distributors/leftover_distributor_spec.rb +12 -4
- data/spec/knapsack/distributors/report_distributor_spec.rb +1 -1
- data/spec/spec_helper.rb +2 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ac6199bd640d975d725e7fc00509f1785a4fa2e
|
4
|
+
data.tar.gz: 1af90f4bff6a1077051e248459f82a9a8a1a3f7c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe02e1a38bc1d34404dc0ddaeb9808924614ba7293a5bf9c3fe5486cf2afba012301b9e4a2fd2be1d3de585ad88331196e6e4246d841e6615a92d7a45ea035f6
|
7
|
+
data.tar.gz: eb874f176692f3d4199bbf79ca2f2ac42444698840ea7ec8f2a78e840bf1f843816cc8106d1cd59a294db739d0fef2a35a6e803d460377508485456fa13f3423
|
data/.travis.yml
CHANGED
@@ -29,24 +29,24 @@ script:
|
|
29
29
|
- bundle exec rspec --default-path spec_examples
|
30
30
|
|
31
31
|
- bin/print_header.sh "Run rake task for the first CI node"
|
32
|
-
- CI_NODE_TOTAL=2 CI_NODE_INDEX=0 KNAPSACK_TEST_FILE_PATTERN="spec_examples
|
32
|
+
- CI_NODE_TOTAL=2 CI_NODE_INDEX=0 KNAPSACK_TEST_FILE_PATTERN="spec_examples/**{,/*/**}/*_spec.rb" bundle exec rake knapsack:rspec
|
33
33
|
- bin/print_header.sh "Run rake task for the second CI node"
|
34
|
-
- CI_NODE_TOTAL=2 CI_NODE_INDEX=1 KNAPSACK_TEST_FILE_PATTERN="spec_examples
|
34
|
+
- CI_NODE_TOTAL=2 CI_NODE_INDEX=1 KNAPSACK_TEST_FILE_PATTERN="spec_examples/**{,/*/**}/*_spec.rb" bundle exec rake knapsack:rspec
|
35
35
|
|
36
36
|
- bin/print_header.sh "Check passing arguments to rspec. Run only specs with custom_focus tag"
|
37
|
-
- KNAPSACK_TEST_FILE_PATTERN="spec_examples
|
38
|
-
- KNAPSACK_TEST_FILE_PATTERN="spec_examples
|
37
|
+
- KNAPSACK_TEST_FILE_PATTERN="spec_examples/**{,/*/**}/*_spec.rb" bundle exec rake "knapsack:rspec[--tag custom_focus]"
|
38
|
+
- KNAPSACK_TEST_FILE_PATTERN="spec_examples/**{,/*/**}/*_spec.rb" bin/knapsack rspec "--tag custom_focus --profile"
|
39
39
|
|
40
40
|
- bin/print_header.sh "Run specs with custom knapsack logger"
|
41
|
-
- CUSTOM_LOGGER=true KNAPSACK_TEST_FILE_PATTERN="spec_examples
|
41
|
+
- CUSTOM_LOGGER=true KNAPSACK_TEST_FILE_PATTERN="spec_examples/**{,/*/**}/*_spec.rb" bundle exec rake knapsack:rspec
|
42
42
|
|
43
43
|
- bin/print_header.sh "Run specs for custom knapsack report path"
|
44
44
|
- cp knapsack_rspec_report.json knapsack_custom_rspec_report.json
|
45
|
-
- KNAPSACK_REPORT_PATH="knapsack_custom_rspec_report.json" KNAPSACK_TEST_FILE_PATTERN="spec_examples
|
45
|
+
- KNAPSACK_REPORT_PATH="knapsack_custom_rspec_report.json" KNAPSACK_TEST_FILE_PATTERN="spec_examples/**{,/*/**}/*_spec.rb" bundle exec rake knapsack:rspec
|
46
46
|
|
47
47
|
- bin/print_header.sh "Run specs when spec file was removed and still exists in knapsack report json"
|
48
48
|
- rm spec_examples/fast/1_spec.rb
|
49
|
-
- KNAPSACK_TEST_FILE_PATTERN="spec_examples
|
49
|
+
- KNAPSACK_TEST_FILE_PATTERN="spec_examples/**{,/*/**}/*_spec.rb" bundle exec rake knapsack:rspec
|
50
50
|
|
51
51
|
|
52
52
|
- bin/print_header.sh "------------------------------------------------------"
|
@@ -60,23 +60,23 @@ script:
|
|
60
60
|
- bundle exec rake test
|
61
61
|
|
62
62
|
- bin/print_header.sh "Run rake task for the first CI node"
|
63
|
-
- CI_NODE_TOTAL=2 CI_NODE_INDEX=0 KNAPSACK_TEST_FILE_PATTERN="test_examples
|
63
|
+
- CI_NODE_TOTAL=2 CI_NODE_INDEX=0 KNAPSACK_TEST_FILE_PATTERN="test_examples/**{,/*/**}/*_test.rb" bundle exec rake knapsack:minitest
|
64
64
|
- bin/print_header.sh "Run rake task for the second CI node"
|
65
|
-
- CI_NODE_TOTAL=2 CI_NODE_INDEX=1 KNAPSACK_TEST_FILE_PATTERN="test_examples
|
65
|
+
- CI_NODE_TOTAL=2 CI_NODE_INDEX=1 KNAPSACK_TEST_FILE_PATTERN="test_examples/**{,/*/**}/*_test.rb" bundle exec rake knapsack:minitest
|
66
66
|
|
67
67
|
- bin/print_header.sh "Check passing arguments to minitest. Run verbose tests"
|
68
|
-
- KNAPSACK_TEST_FILE_PATTERN="test_examples
|
69
|
-
- KNAPSACK_TEST_FILE_PATTERN="test_examples
|
68
|
+
- KNAPSACK_TEST_FILE_PATTERN="test_examples/**{,/*/**}/*_test.rb" bundle exec rake "knapsack:minitest[--verbose]"
|
69
|
+
- KNAPSACK_TEST_FILE_PATTERN="test_examples/**{,/*/**}/*_test.rb" bin/knapsack minitest "--verbose --pride"
|
70
70
|
|
71
71
|
- bin/print_header.sh "Run tests with custom knapsack logger"
|
72
|
-
- CUSTOM_LOGGER=true KNAPSACK_TEST_FILE_PATTERN="test_examples
|
72
|
+
- CUSTOM_LOGGER=true KNAPSACK_TEST_FILE_PATTERN="test_examples/**{,/*/**}/*_test.rb" bundle exec rake knapsack:minitest
|
73
73
|
|
74
74
|
- bin/print_header.sh "Run tests for custom knapsack report path"
|
75
75
|
- cp knapsack_minitest_report.json knapsack_custom_minitest_report.json
|
76
|
-
- KNAPSACK_REPORT_PATH="knapsack_custom_minitest_report.json" KNAPSACK_TEST_FILE_PATTERN="test_examples
|
76
|
+
- KNAPSACK_REPORT_PATH="knapsack_custom_minitest_report.json" KNAPSACK_TEST_FILE_PATTERN="test_examples/**{,/*/**}/*_test.rb" bundle exec rake knapsack:minitest
|
77
77
|
|
78
78
|
- bin/print_header.sh "Run tests when test file was removed and still exists in knapsack report json"
|
79
79
|
- rm test_examples/fast/unit_test.rb
|
80
|
-
- KNAPSACK_TEST_FILE_PATTERN="test_examples
|
80
|
+
- KNAPSACK_TEST_FILE_PATTERN="test_examples/**{,/*/**}/*_test.rb" bundle exec rake knapsack:minitest
|
81
81
|
notifications:
|
82
82
|
email: false
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,13 @@
|
|
2
2
|
|
3
3
|
* TODO
|
4
4
|
|
5
|
+
### 1.4.1
|
6
|
+
|
7
|
+
* Update test file pattern in tests also. Related PR https://github.com/ArturT/knapsack/pull/27
|
8
|
+
* Ensure there are no duplicates in leftover tests because of new test file pattern
|
9
|
+
|
10
|
+
https://github.com/ArturT/knapsack/compare/v1.4.0...v1.4.1
|
11
|
+
|
5
12
|
### 1.4.0
|
6
13
|
|
7
14
|
* Rename RspecAdapter to RSpecAdapter so that it is consistent
|
data/README.md
CHANGED
@@ -146,7 +146,7 @@ Knapsack.tracker.config({
|
|
146
146
|
})
|
147
147
|
|
148
148
|
Knapsack.report.config({
|
149
|
-
test_file_pattern: 'spec
|
149
|
+
test_file_pattern: 'spec/**{,/*/**}/*_spec.rb', # default value based on adapter
|
150
150
|
report_path: 'knapsack_custom_report.json'
|
151
151
|
})
|
152
152
|
|
@@ -205,13 +205,13 @@ On your CI server run this command for the first CI node. Update `CI_NODE_INDEX`
|
|
205
205
|
You can add `KNAPSACK_TEST_FILE_PATTERN` if your tests are not in default directory. For instance:
|
206
206
|
|
207
207
|
# Step for RSpec
|
208
|
-
$ KNAPSACK_TEST_FILE_PATTERN="directory_with_specs
|
208
|
+
$ KNAPSACK_TEST_FILE_PATTERN="directory_with_specs/**{,/*/**}/*_spec.rb" CI_NODE_TOTAL=2 CI_NODE_INDEX=0 bundle exec rake knapsack:rspec
|
209
209
|
|
210
210
|
# Step for Cucumber
|
211
211
|
$ KNAPSACK_TEST_FILE_PATTERN="directory_with_features/**/*.feature" CI_NODE_TOTAL=2 CI_NODE_INDEX=0 bundle exec rake knapsack:cucumber
|
212
212
|
|
213
213
|
# Step for Minitest
|
214
|
-
$ KNAPSACK_TEST_FILE_PATTERN="directory_with_tests
|
214
|
+
$ KNAPSACK_TEST_FILE_PATTERN="directory_with_tests/**{,/*/**}/*_spec.rb" CI_NODE_TOTAL=2 CI_NODE_INDEX=0 bundle exec rake knapsack:minitest
|
215
215
|
|
216
216
|
You can set `KNAPSACK_REPORT_PATH` if your knapsack report was saved in non default location. Example:
|
217
217
|
|
@@ -476,7 +476,7 @@ To generate a new knapsack report for specs with `focus` tag (only specs in `spe
|
|
476
476
|
|
477
477
|
To see specs distributed for the first CI node type:
|
478
478
|
|
479
|
-
$ CI_NODE_TOTAL=2 CI_NODE_INDEX=0 KNAPSACK_SPEC_PATTERN="spec_examples
|
479
|
+
$ CI_NODE_TOTAL=2 CI_NODE_INDEX=0 KNAPSACK_SPEC_PATTERN="spec_examples/**{,/*/**}/*_spec.rb" bundle exec rake knapsack:rspec
|
480
480
|
|
481
481
|
Specs in `spec_examples/leftover` take more than 3 seconds. This should cause a Knapsack time offset warning because we set `time_offset_in_seconds` to 3 in `spec_examples/spec_helper.rb`. Type below to see warning:
|
482
482
|
|
data/Rakefile
CHANGED
data/knapsack.gemspec
CHANGED
@@ -23,6 +23,7 @@ Gem::Specification.new do |spec|
|
|
23
23
|
|
24
24
|
spec.add_development_dependency 'bundler', '~> 1.6'
|
25
25
|
spec.add_development_dependency 'rspec', '~> 3.0', '>= 2.0.0'
|
26
|
+
spec.add_development_dependency 'rspec-its', '~> 1.2'
|
26
27
|
spec.add_development_dependency 'cucumber', '>= 1.3'
|
27
28
|
spec.add_development_dependency 'minitest', '>= 5.0.0'
|
28
29
|
spec.add_development_dependency 'codeclimate-test-reporter', '~> 0'
|
data/lib/knapsack/version.rb
CHANGED
@@ -60,7 +60,7 @@ describe Knapsack::AllocatorBuilder do
|
|
60
60
|
end
|
61
61
|
|
62
62
|
context 'when ENV test_file_pattern has value' do
|
63
|
-
let(:env_test_file_pattern) { 'custom_spec
|
63
|
+
let(:env_test_file_pattern) { 'custom_spec/**{,/*/**}/*_spec.rb' }
|
64
64
|
let(:report_config) { { report_path: adapter_report_path } }
|
65
65
|
let(:allocator_args) do
|
66
66
|
{
|
@@ -102,7 +102,7 @@ describe Knapsack::AllocatorBuilder do
|
|
102
102
|
end
|
103
103
|
|
104
104
|
context 'when ENV test_file_pattern has value' do
|
105
|
-
let(:env_test_file_pattern) { 'custom_spec
|
105
|
+
let(:env_test_file_pattern) { 'custom_spec/**{,/*/**}/*_spec.rb' }
|
106
106
|
|
107
107
|
it { should eq 'custom_spec' }
|
108
108
|
end
|
@@ -77,7 +77,7 @@ describe Knapsack::Config::Env do
|
|
77
77
|
subject { described_class.test_file_pattern }
|
78
78
|
|
79
79
|
context 'when ENV exists' do
|
80
|
-
let(:test_file_pattern) { 'custom_spec
|
80
|
+
let(:test_file_pattern) { 'custom_spec/**{,/*/**}/*_spec.rb' }
|
81
81
|
before { stub_const("ENV", { 'KNAPSACK_TEST_FILE_PATTERN' => test_file_pattern }) }
|
82
82
|
it { should eql test_file_pattern }
|
83
83
|
end
|
@@ -7,7 +7,7 @@ describe Knapsack::Distributors::LeftoverDistributor do
|
|
7
7
|
'd_spec.rb' => 2.5,
|
8
8
|
}
|
9
9
|
end
|
10
|
-
let(:test_file_pattern) { 'spec
|
10
|
+
let(:test_file_pattern) { 'spec/**{,/*/**}/*_spec.rb' }
|
11
11
|
let(:default_args) do
|
12
12
|
{
|
13
13
|
report: report,
|
@@ -29,18 +29,26 @@ describe Knapsack::Distributors::LeftoverDistributor do
|
|
29
29
|
subject { distributor.all_tests }
|
30
30
|
|
31
31
|
context 'when given test_file_pattern' do
|
32
|
-
context 'spec
|
32
|
+
context 'spec/**{,/*/**}/*_spec.rb' do
|
33
33
|
it { should_not be_empty }
|
34
34
|
it { should include 'spec/knapsack/tracker_spec.rb' }
|
35
35
|
it { should include 'spec/knapsack/adapters/rspec_adapter_spec.rb' }
|
36
|
+
|
37
|
+
it 'has no duplicated test file paths' do
|
38
|
+
expect(subject.size).to eq subject.uniq.size
|
39
|
+
end
|
36
40
|
end
|
37
41
|
|
38
|
-
context 'spec_examples
|
39
|
-
let(:test_file_pattern) { 'spec_examples
|
42
|
+
context 'spec_examples/**{,/*/**}/*_spec.rb' do
|
43
|
+
let(:test_file_pattern) { 'spec_examples/**{,/*/**}/*_spec.rb' }
|
40
44
|
|
41
45
|
it { should_not be_empty }
|
42
46
|
it { should include 'spec_examples/fast/1_spec.rb' }
|
43
47
|
it { should include 'spec_examples/leftover/a_spec.rb' }
|
48
|
+
|
49
|
+
it 'has no duplicated test file paths' do
|
50
|
+
expect(subject.size).to eq subject.uniq.size
|
51
|
+
end
|
44
52
|
end
|
45
53
|
end
|
46
54
|
|
data/spec/spec_helper.rb
CHANGED
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.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ArturT
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -72,6 +72,20 @@ dependencies:
|
|
72
72
|
- - ">="
|
73
73
|
- !ruby/object:Gem::Version
|
74
74
|
version: 2.0.0
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: rspec-its
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - "~>"
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '1.2'
|
82
|
+
type: :development
|
83
|
+
prerelease: false
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - "~>"
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '1.2'
|
75
89
|
- !ruby/object:Gem::Dependency
|
76
90
|
name: cucumber
|
77
91
|
requirement: !ruby/object:Gem::Requirement
|