knapsack_pro 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b182a470dcef48877e231e561627a941a639b948
4
- data.tar.gz: 60893b62fec4539303eb546658e36f3246fff499
3
+ metadata.gz: 96ff13037f32a161f5a770ba6636b171a2d317c4
4
+ data.tar.gz: 11c088648df8c54ee22bd101fce0442ed5af7b85
5
5
  SHA512:
6
- metadata.gz: 373d0bbbe448f47cfc04019029e52e256a5b2a9723e9d0af27b6d9cc31671832003f635d1e660825549c15f3df25c74a19e8a1e299080b21bff5246edb0d9d70
7
- data.tar.gz: 380dd12e04d66fc7731bddbba57ce6823588bc1bc6b6ecb388179929791e6c052f0be776fed6bf0abedfa3f6d1f018aca31d23d42bcee504570b03c1d203d7ec
6
+ metadata.gz: 06f9467cd5208500e8daf2aa1efa77631fc189e50547f5b70f0a81b2966d6416450535da9637665f990e24f6ca5a21ef67fbea85dc2e793725458e5c93125d72
7
+ data.tar.gz: a63200ecee7013d6163c0bfe5a330c3416c2bc5151e1d22b0ba25851305a0cc048d43c483020508bfa3b42f57edfb06a5621c2fbe38057779f61a7cc379398a2
data/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  * TODO
4
4
 
5
+ ### 0.2.1
6
+
7
+ * TestFileFinder should find unique files without duplicates when using test file pattern supporting symlinks
8
+ * Update test file pattern to support symlinks in specs and readme examples
9
+ * Backwards compatibility with knapsack gem old rspec adapter name
10
+
11
+ https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v0.2.0...v0.2.1
12
+
5
13
  ### 0.2.0
6
14
 
7
15
  * Change file path patterns to support 1-level symlinks by default
data/README.md CHANGED
@@ -46,14 +46,15 @@ For instance when you will run tests with rake knapsack_pro:rspec then:
46
46
 
47
47
  - [Update gem](#update-gem)
48
48
  - [Installation](#installation)
49
- - [Usage](#usage)
50
- - [Step for RSpec](#step-for-rspec)
51
- - [Step for Cucumber](#step-for-cucumber)
52
- - [Step for Minitest](#step-for-minitest)
53
- - [Custom configuration](#custom-configuration)
54
- - [Setup your CI server](#setup-your-ci-server)
55
- - [Set API key token](#set-api-key-token)
56
- - [Set knapsack_pro command to execute tests](#set-knapsack_pro-command-to-execute-tests)
49
+ - [How to set up](#how-to-set-up)
50
+ - [Usage](#usage)
51
+ - [Step for RSpec](#step-for-rspec)
52
+ - [Step for Cucumber](#step-for-cucumber)
53
+ - [Step for Minitest](#step-for-minitest)
54
+ - [Custom configuration](#custom-configuration)
55
+ - [Setup your CI server](#setup-your-ci-server)
56
+ - [Set API key token](#set-api-key-token)
57
+ - [Set knapsack_pro command to execute tests](#set-knapsack_pro-command-to-execute-tests)
57
58
  - [Extra configuration for CI server](#extra-configuration-for-ci-server)
58
59
  - [Info about ENV variables](#info-about-env-variables)
59
60
  - [Repository adapter](#repository-adapter)
@@ -101,13 +102,15 @@ Add this line at the bottom of `Rakefile` if your project has it:
101
102
  KnapsackPro.load_tasks if defined?(KnapsackPro)
102
103
  ```
103
104
 
104
- ## Usage
105
+ ## How to set up
106
+
107
+ ### Usage
105
108
 
106
109
  You can find here example of rails app with already configured knapsack_pro.
107
110
 
108
111
  https://github.com/KnapsackPro/rails-app-with-knapsack_pro
109
112
 
110
- ### Step for RSpec
113
+ #### Step for RSpec
111
114
 
112
115
  Add at the beginning of your `spec_helper.rb`:
113
116
 
@@ -119,7 +122,7 @@ require 'knapsack_pro'
119
122
  KnapsackPro::Adapters::RSpecAdapter.bind
120
123
  ```
121
124
 
122
- ### Step for Cucumber
125
+ #### Step for Cucumber
123
126
 
124
127
  Create file `features/support/knapsack_pro.rb` and add there:
125
128
 
@@ -131,7 +134,7 @@ require 'knapsack_pro'
131
134
  KnapsackPro::Adapters::CucumberAdapter.bind
132
135
  ```
133
136
 
134
- ### Step for Minitest
137
+ #### Step for Minitest
135
138
 
136
139
  Add at the beginning of your `test_helper.rb`:
137
140
 
@@ -144,7 +147,7 @@ knapsack_pro_adapter = KnapsackPro::Adapters::MinitestAdapter.bind
144
147
  knapsack_pro_adapter.set_test_helper_path(__FILE__)
145
148
  ```
146
149
 
147
- ### Custom configuration
150
+ #### Custom configuration
148
151
 
149
152
  You can change default Knapsack Pro configuration for RSpec, Cucumber or Minitest tests. Here are examples what you can do. Put below configuration instead of `CUSTOM_CONFIG_GOES_HERE`.
150
153
 
@@ -155,9 +158,9 @@ KnapsackPro.logger = Logger.new(STDOUT)
155
158
  KnapsackPro.logger.level = Logger::INFO
156
159
  ```
157
160
 
158
- ## Setup your CI server
161
+ ### Setup your CI server
159
162
 
160
- ### Set API key token
163
+ #### Set API key token
161
164
 
162
165
  Set one or a few tokens depend on how many test suites you run on CI server.
163
166
 
@@ -167,7 +170,7 @@ Set one or a few tokens depend on how many test suites you run on CI server.
167
170
 
168
171
  __Tip:__ In case you have for instance multiple rspec test suites then prepend each of knapsack_pro command which executes tests with `KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC` variable.
169
172
 
170
- ### Set knapsack_pro command to execute tests
173
+ #### Set knapsack_pro command to execute tests
171
174
 
172
175
  On your CI server run this command for the first CI node. Update `KNAPSACK_PRO_CI_NODE_INDEX` for the next one.
173
176
 
@@ -183,13 +186,15 @@ On your CI server run this command for the first CI node. Update `KNAPSACK_PRO_C
183
186
  You can add `KNAPSACK_PRO_TEST_FILE_PATTERN` if your tests are not in default directory. For instance:
184
187
 
185
188
  # Step for RSpec
186
- $ KNAPSACK_PRO_TEST_FILE_PATTERN="directory_with_specs/**/*_spec.rb" KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:rspec
189
+ $ KNAPSACK_PRO_TEST_FILE_PATTERN="directory_with_specs/**{,/*/**}/*_spec.rb" KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:rspec
187
190
 
188
191
  # Step for Cucumber
189
- $ KNAPSACK_PRO_TEST_FILE_PATTERN="directory_with_features/**/*.feature" KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:cucumber
192
+ $ KNAPSACK_PRO_TEST_FILE_PATTERN="directory_with_features/**{,/*/**}/*.feature" KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:cucumber
190
193
 
191
194
  # Step for Minitest
192
- $ KNAPSACK_PRO_TEST_FILE_PATTERN="directory_with_tests/**/*_test.rb" KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:minitest
195
+ $ KNAPSACK_PRO_TEST_FILE_PATTERN="directory_with_tests/**{,/*/**}/*_test.rb" KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:minitest
196
+
197
+ __Tip:__ If you are using one of supported CI providers then instead of above steps you should [take a look on this](#supported-ci-providers).
193
198
 
194
199
  ## Extra configuration for CI server
195
200
 
@@ -44,5 +44,11 @@ module KnapsackPro
44
44
  end
45
45
  end
46
46
  end
47
+
48
+ # This is added to provide backwards compatibility
49
+ # In case someone is doing switch from knapsack gem to the knapsack_pro gem
50
+ # and didn't notice the class name changed
51
+ class RspecAdapter < RSpecAdapter
52
+ end
47
53
  end
48
54
  end
@@ -21,7 +21,7 @@ module KnapsackPro
21
21
  attr_reader :test_file_pattern
22
22
 
23
23
  def test_files
24
- Dir.glob(test_file_pattern).sort
24
+ Dir.glob(test_file_pattern).uniq.sort
25
25
  end
26
26
 
27
27
  def test_file_hash_for(test_file_path)
@@ -1,3 +1,3 @@
1
1
  module KnapsackPro
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.1'
3
3
  end
@@ -1,4 +1,8 @@
1
1
  describe KnapsackPro::Adapters::RSpecAdapter do
2
+ it 'backwards compatibility with knapsack gem old rspec adapter name' do
3
+ expect(KnapsackPro::Adapters::RspecAdapter.new).to be_kind_of(described_class)
4
+ end
5
+
2
6
  it do
3
7
  expect(described_class::TEST_DIR_PATTERN).to eq 'spec/**{,/*/**}/*_spec.rb'
4
8
  end
@@ -37,7 +37,7 @@ describe KnapsackPro::AllocatorBuilder do
37
37
  subject { allocator_builder.test_dir }
38
38
 
39
39
  before do
40
- expect(KnapsackPro::TestFilePattern).to receive(:call).and_return('spec/**/*_spec.rb')
40
+ expect(KnapsackPro::TestFilePattern).to receive(:call).and_return('spec/**{,/*/**}/*_spec.rb')
41
41
  end
42
42
 
43
43
  it { should eq 'spec' }
@@ -120,7 +120,7 @@ describe KnapsackPro::Config::Env do
120
120
  subject { described_class.test_file_pattern }
121
121
 
122
122
  context 'when ENV exists' do
123
- let(:test_file_pattern) { 'custom_spec/**/*_spec.rb' }
123
+ let(:test_file_pattern) { 'custom_spec/**{,/*/**}/*_spec.rb' }
124
124
  before { stub_const("ENV", { 'KNAPSACK_PRO_TEST_FILE_PATTERN' => test_file_pattern }) }
125
125
  it { should eq test_file_pattern }
126
126
  end
@@ -14,7 +14,7 @@ describe KnapsackPro::TestFileFinder do
14
14
  end
15
15
 
16
16
  describe '#call' do
17
- let(:test_file_pattern) { 'spec_fake/**/*_spec.rb' }
17
+ let(:test_file_pattern) { 'spec_fake/**{,/*/**}/*_spec.rb' }
18
18
 
19
19
  subject { described_class.new(test_file_pattern).call }
20
20
 
@@ -9,7 +9,7 @@ describe KnapsackPro::TestFilePattern do
9
9
  end
10
10
 
11
11
  context 'when ENV defined' do
12
- let(:env_test_file_pattern) { 'spec/**/*_spec.rb' }
12
+ let(:env_test_file_pattern) { 'spec/**{,/*/**}/*_spec.rb' }
13
13
 
14
14
  it { should eq env_test_file_pattern }
15
15
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knapsack_pro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.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-03 00:00:00.000000000 Z
11
+ date: 2015-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake