knapsack_pro 0.39.0 → 0.40.0

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: edaac63877b452e0ced9674b15c70e2b6cdd7a23
4
- data.tar.gz: 4f3758d26a0de86ce21db7b410a98a59c5d3fe33
3
+ metadata.gz: 2b643c8be1b319ebbee7eba6e71a1c9006086129
4
+ data.tar.gz: b75182aa4e028e1192fdaf3562ff77ecef0c38d7
5
5
  SHA512:
6
- metadata.gz: 0fd7cc1022087c4d508c3ef2d8ec2589626cf724f9689cdc3d9f0bf366b9583145fb901dde61ca9defb67929e00bdbf93931e9b8b516bedd0e74ce9e05e3e62c
7
- data.tar.gz: a04c3a24dfebb12475dd2d6aeedb06532df428b831c84eff157bb1187089fd2ef9d8f4d90ea72edf3a008066bde89db3411cd7498e4bfb4a498b6fea26fa36bb
6
+ metadata.gz: be387a13a2f6e29459ad46a46a8c8ff3d350e50d3ea3b3e6672214d2c00832797e8b3aabae7bca7629fe072573e51f4a5c25440d2c9de9106cefb938482dd229
7
+ data.tar.gz: 22d8a26c14cb995c3399e3a5ab438d1c08e247f72d88412ad5853df903ded0cfa055fdc582f231b53dacf7f5ae29c6185c78b9e3673f609a28b85ec419f1fba5
data/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  * TODO
4
4
 
5
+ ### 0.40.0
6
+
7
+ * Replace rake task installer `knapsack_pro:install` with online installation guide. Remove `tty-prompt` gem dependency.
8
+
9
+ https://github.com/KnapsackPro/knapsack_pro-ruby/pull/39
10
+
11
+ https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v0.39.0...v0.40.0
12
+
5
13
  ### 0.39.0
6
14
 
7
15
  * Remove timecop gem from required dependencies list.
data/README.md CHANGED
@@ -19,7 +19,7 @@ __Would you like to try knapsack_pro gem?__ You can [get API token here](http://
19
19
 
20
20
  ## Is knapsack_pro gem free?
21
21
 
22
- * If your __project is open source__ then you can use Knapsack Pro for free. Just add a link back to the page http://knapsackpro.com and please let me know via email (arturtrzop@gmail.com). I will mark your account on KnapsackPro.com as open source.
22
+ * If your __project is open source__ then you can use Knapsack Pro for free. Please let me know via email (arturtrzop@gmail.com) and I will mark your account on KnapsackPro.com as open source.
23
23
 
24
24
  * If your __project is commercial__ then I'd like to get feedback from you and work closely together to validate if the solution I'm building provide a value for the users. Switching to paid plan is a good way to validate that and a way to get support from happy users. Maybe you will be the next one who will join and support the project. Thanks!
25
25
 
@@ -161,9 +161,7 @@ Add this lines at the bottom of `Rakefile` if your project has it:
161
161
  KnapsackPro.load_tasks if defined?(KnapsackPro)
162
162
  ```
163
163
 
164
- Run installer to get started. It will ask you a few questions and generate instruction steps for your project.
165
-
166
- $ bundle exec rake knapsack_pro:install
164
+ __Please check [online installation guide](http://docs.knapsackpro.com/knapsack_pro-ruby/guide/#questions) to get started.__ It will ask you a few questions and generate instruction steps for your project.
167
165
 
168
166
  You can read next section only if you want to better understand optional gem configuration and features.
169
167
 
@@ -672,7 +670,7 @@ Such configuration will generate matrix with 2 following ENV rows:
672
670
  KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC=rspec-token KNAPSACK_PRO_TEST_SUITE_TOKEN_CUCUMBER=cucumber-token KNAPSACK_PRO_TEST_SUITE_TOKEN_MINITEST=minitest-token KNAPSACK_PRO_TEST_SUITE_TOKEN_SPINACH=spinach-token
673
671
  KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=1 KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC=rspec-token KNAPSACK_PRO_TEST_SUITE_TOKEN_CUCUMBER=cucumber-token KNAPSACK_PRO_TEST_SUITE_TOKEN_MINITEST=minitest-token KNAPSACK_PRO_TEST_SUITE_TOKEN_SPINACH=spinach-token
674
672
 
675
- More info about global and matrix ENV configuration in [travis docs](http://docs.travis-ci.com/user/build-configuration/#Environment-variables).
673
+ More info about global and matrix ENV configuration in [travis docs](https://docs.travis-ci.com/user/customizing-the-build/#Build-Matrix).
676
674
 
677
675
  #### Info for semaphoreapp.com users
678
676
 
data/knapsack_pro.gemspec CHANGED
@@ -19,7 +19,6 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_dependency 'rake', '>= 0'
22
- spec.add_dependency 'tty-prompt', '~> 0.7'
23
22
 
24
23
  spec.add_development_dependency 'bundler', '~> 1.6'
25
24
  spec.add_development_dependency 'rspec', '~> 3.0', '>= 2.0.0'
@@ -1,3 +1,3 @@
1
1
  module KnapsackPro
2
- VERSION = '0.39.0'
2
+ VERSION = '0.40.0'
3
3
  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.39.0
4
+ version: 0.40.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ArturT
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-12 00:00:00.000000000 Z
11
+ date: 2017-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -24,20 +24,6 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
- - !ruby/object:Gem::Dependency
28
- name: tty-prompt
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '0.7'
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '0.7'
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: bundler
43
29
  requirement: !ruby/object:Gem::Requirement
@@ -276,7 +262,6 @@ files:
276
262
  - lib/tasks/cucumber.rake
277
263
  - lib/tasks/encrypted_branch_names.rake
278
264
  - lib/tasks/encrypted_test_file_names.rake
279
- - lib/tasks/install.rake
280
265
  - lib/tasks/minitest.rake
281
266
  - lib/tasks/queue/rspec.rake
282
267
  - lib/tasks/rspec.rake
@@ -1,357 +0,0 @@
1
- require 'knapsack_pro'
2
- require 'tty-prompt'
3
-
4
- def step_for_rspec(prompt)
5
- prompt.say "Step for RSpec", color: :yellow
6
- prompt.say "Add at the beginning of your spec/spec_helper.rb:"
7
-
8
- prompt.say %{
9
- require 'knapsack_pro'
10
- KnapsackPro::Adapters::RSpecAdapter.bind
11
- }, color: :cyan
12
- end
13
-
14
- def step_for_minitest(prompt)
15
- prompt.say "Step for Minitest", color: :yellow
16
- prompt.say "Add at the beginning of your test/test_helper.rb:"
17
-
18
- prompt.say %{
19
- require 'knapsack_pro'
20
- knapsack_pro_adapter = KnapsackPro::Adapters::MinitestAdapter.bind
21
- knapsack_pro_adapter.set_test_helper_path(__FILE__)
22
- }, color: :cyan
23
- end
24
-
25
- def step_for_cucumber(prompt)
26
- prompt.say "Step for Cucumber", color: :yellow
27
- prompt.say "Create file features/support/knapsack_pro.rb and add there:"
28
-
29
- prompt.say %{
30
- require 'knapsack_pro'
31
- KnapsackPro::Adapters::CucumberAdapter.bind
32
- }, color: :cyan
33
- end
34
-
35
- def step_for_spinach(prompt)
36
- prompt.say "Step for Spinach", color: :yellow
37
- prompt.say "Create file features/support/knapsack_pro.rb and add there:"
38
-
39
- prompt.say %{
40
- require 'knapsack_pro'
41
- KnapsackPro::Adapters::SpinachAdapter.bind
42
- }, color: :cyan
43
- end
44
-
45
- def step_for_vcr(prompt)
46
- prompt.say "Step for VCR/WebMock/FakeWeb gems", color: :yellow
47
- prompt.say "Add Knapsack Pro API subdomain to ignore hosts"
48
- prompt.say "in spec/spec_helper.rb or wherever is your VCR configuration:"
49
-
50
- prompt.say %{
51
- require 'vcr'
52
- VCR.configure do |config|
53
- config.hook_into :webmock # or :fakeweb
54
- config.ignore_hosts('localhost', '127.0.0.1', '0.0.0.0', 'api.knapsackpro.com')
55
- end
56
-
57
- # add below when you hook into webmock
58
- require 'webmock/rspec'
59
- WebMock.disable_net_connect!(:allow => ['api.knapsackpro.com'])
60
-
61
- # add below when you use FakeWeb
62
- require 'fakeweb'
63
- FakeWeb.allow_net_connect = %r[^https?://api\.knapsackpro\.com]
64
- }, color: :cyan
65
-
66
- puts
67
-
68
- prompt.say "Ensure you have require false in Gemfile for webmock gem when VCR is hook into it. Thanks to that webmock configuration in spec_helper.rb is loaded properly."
69
-
70
- prompt.say %{
71
- group :test do
72
- gem 'vcr'
73
- gem 'webmock', require: false
74
- gem 'fakeweb', require: false # example when you use fakeweb
75
- end
76
- }, color: :cyan
77
- end
78
-
79
- def step_for_ci_circle(prompt, answers)
80
- prompt.say "Step for https://circleci.com", color: :yellow
81
- prompt.say "Update circle.yml in your project:"
82
-
83
- str = ''
84
- answers[:testing_tools].each do |tool|
85
- str << %{
86
- # Step for #{tool}
87
- - bundle exec rake knapsack_pro:#{tool}:
88
- parallel: true # Caution: there are 8 spaces indentation!
89
- }
90
- end
91
-
92
- prompt.say((%{
93
- test:
94
- override:} + str), color: :cyan)
95
-
96
- puts
97
- prompt.say "Please read this section about example for CircleCI 1.0 and CircleCI 2.0 platform:"
98
- prompt.say "https://github.com/KnapsackPro/knapsack_pro-ruby#info-for-circleci-users"
99
-
100
- puts
101
- set_api_tokens_on_ci(prompt, answers)
102
- end
103
-
104
- def step_for_ci_gitlab(prompt, answers)
105
- prompt.say "Step for Gitlab CI https://about.gitlab.com/features/gitlab-ci-cd/", color: :yellow
106
- prompt.say "Update .gitlab-ci.yml in your project as in this example:"
107
- prompt.say "https://github.com/KnapsackPro/knapsack_pro-ruby#info-for-gitlab-ci-users"
108
-
109
- puts
110
- set_api_tokens_on_ci(prompt, answers)
111
- end
112
-
113
- def step_for_ci_travis(prompt, answers)
114
- prompt.say "Step for https://travis-ci.org", color: :yellow
115
- prompt.say "You can parallelize your builds across virtual machines with travis matrix feature."
116
- prompt.say "https://docs.travis-ci.com/user/speeding-up-the-build/#Parallelizing-your-builds-across-virtual-machines"
117
- puts
118
- prompt.say "Update .travis.yml"
119
-
120
- prompt.say %{
121
- script:
122
- }, color: :cyan
123
-
124
- answers[:testing_tools].each do |tool|
125
- prompt.say %{
126
- # Step for #{tool}
127
- - "bundle exec rake knapsack_pro:#{tool}"
128
- }, color: :cyan
129
- end
130
-
131
- prompt.say %{
132
- env:
133
- global:
134
- - KNAPSACK_PRO_CI_NODE_TOTAL=2
135
- }, color: :cyan
136
-
137
- prompt.say %{
138
- matrix:
139
- - KNAPSACK_PRO_CI_NODE_INDEX=0
140
- - KNAPSACK_PRO_CI_NODE_INDEX=1
141
- }, color: :cyan
142
-
143
- puts
144
- prompt.say "If you want more parallel jobs then update accordingly:"
145
- tip_ci_node_total_and_index(prompt)
146
-
147
- puts
148
- prompt.say "Open travis settings in web interface to add there Knapsack Pro API token."
149
- puts
150
- set_api_tokens_on_ci(prompt, answers)
151
- end
152
-
153
- def step_for_ci_buildkite(prompt, answers)
154
- prompt.say "Step for https://buildkite.com", color: :yellow
155
- prompt.say "Please configure the parallelism parameter in your build step and run the appropiate command in your build:"
156
-
157
- answers[:testing_tools].each do |tool|
158
- prompt.say %{
159
- # Step for #{tool}
160
- bundle exec rake knapsack_pro:#{tool}
161
- }, color: :cyan
162
- end
163
-
164
- puts
165
- prompt.say "Please read this section about example usage for Rails project with Docker and without it:"
166
- prompt.say "https://github.com/KnapsackPro/knapsack_pro-ruby#info-for-buildkitecom-users"
167
-
168
- puts
169
- set_api_tokens_on_ci(prompt, answers)
170
- end
171
-
172
- def step_for_ci_semaphore(prompt, answers)
173
- prompt.say "Step for https://semaphoreci.com", color: :yellow
174
- prompt.say "Set knapsack pro command for each parallel thread. Here is example:"
175
-
176
- answers[:testing_tools].each do |tool|
177
- puts
178
- prompt.say "Step for #{tool}"
179
- prompt.say %{
180
- # Thread 1
181
- bundle exec rake knapsack_pro:#{tool}
182
-
183
- # Thread 2
184
- bundle exec rake knapsack_pro:#{tool}
185
- }, color: :cyan
186
- end
187
-
188
- puts
189
- set_api_tokens_on_ci(prompt, answers)
190
- end
191
-
192
- def step_for_ci_snap_ci(prompt, answers)
193
- prompt.say "Step for https://snap-ci.com", color: :yellow
194
- prompt.say "Please configure number of workers for your project in configuration settings in order to enable parallelism."
195
- prompt.say "Next thing is to set below commands to be executed in your stage:"
196
-
197
- answers[:testing_tools].each do |tool|
198
- prompt.say %{
199
- # Step for #{tool}
200
- bundle exec rake knapsack_pro:#{tool}
201
- }, color: :cyan
202
- end
203
-
204
- puts
205
- set_api_tokens_on_ci(prompt, answers)
206
- end
207
-
208
- def step_for_ci_jenkins(prompt, answers)
209
- prompt.say "Step for Jenkins", color: :yellow
210
- prompt.say "Please visit page to see example Jenkinsfile:"
211
- prompt.say "https://github.com/KnapsackPro/knapsack_pro-ruby#info-for-jenkins-users"
212
- puts
213
- end
214
-
215
- def step_for_ci_other(prompt, answers)
216
- prompt.say "Step for other CI provider", color: :yellow
217
- prompt.say "Set below global variables on your CI server."
218
- puts
219
-
220
- prompt.say "Git installed on the CI server will be used to determine branch name and current commit hash."
221
-
222
- prompt.say %{
223
- KNAPSACK_PRO_REPOSITORY_ADAPTER=git
224
- }, color: :cyan
225
- puts
226
-
227
- prompt.say "Path to the project repository on CI server, for instance:"
228
- prompt.say %{
229
- KNAPSACK_PRO_PROJECT_DIR=/home/ubuntu/my-app-repository
230
- }, color: :cyan
231
- puts
232
-
233
- prompt.say "You can learn more about those variables here:"
234
- prompt.say "https://github.com/KnapsackPro/knapsack_pro-ruby#when-you-set-global-variable-knapsack_pro_repository_adaptergit-required-when-ci-provider-is-not-supported"
235
- puts
236
-
237
- set_api_tokens_on_ci(prompt, answers)
238
-
239
- # set test run command on CI server
240
- prompt.say "Set test run command on CI server", color: :yellow
241
- prompt.say "You must set command responsible for running tests for each CI node."
242
- prompt.say "Let's assume you have 2 CI nodes. Here are commands you need to run for each CI node."
243
-
244
- answers[:testing_tools].each do |tool|
245
- puts
246
- prompt.say "Step for #{tool}"
247
- prompt.say %{
248
- # Command for first CI node
249
- $ KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:#{tool}
250
-
251
- # Command for second CI node
252
- $ KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=1 bundle exec rake knapsack_pro:#{tool}
253
- }, color: :cyan
254
- end
255
- puts
256
- prompt.say "If you have more CI nodes then update accordingly:"
257
- tip_ci_node_total_and_index(prompt)
258
- puts
259
- end
260
-
261
- def tip_ci_node_total_and_index(prompt)
262
- prompt.say %{
263
- KNAPSACK_PRO_CI_NODE_TOTAL - total number of your CI nodes
264
- KNAPSACK_PRO_CI_NODE_INDEX - starts from 0, it's index of each CI node
265
- }, color: :cyan
266
- end
267
-
268
- def set_api_tokens_on_ci(prompt, answers)
269
- prompt.say "Set API token", color: :yellow
270
- prompt.say "You must set different API token on your CI server for each test suite you have:"
271
- puts
272
-
273
- str = ''
274
- answers[:testing_tools].each do |tool|
275
- str << "KNAPSACK_PRO_TEST_SUITE_TOKEN_#{tool.upcase}\n"
276
- end
277
- prompt.say str, color: :cyan
278
-
279
- prompt.say "You can generate more API tokens after sign in on https://knapsackpro.com"
280
- puts
281
- end
282
-
283
- namespace :knapsack_pro do
284
- task :install do
285
- prompt = TTY::Prompt.new
286
- answers = {}
287
-
288
- puts
289
- prompt.say "Welcome to knapsack_pro gem installer."
290
- puts
291
-
292
- TESTING_TOOLS_CHOICES = {
293
- 'RSpec' => :rspec,
294
- 'Minitest' => :minitest,
295
- 'Cucumber' => :cucumber,
296
- 'Spinach' => :spinach,
297
- }
298
- answers[:testing_tools] = []
299
- while answers[:testing_tools].empty?
300
- answers[:testing_tools] = prompt.multi_select("Choose your testing tools:", TESTING_TOOLS_CHOICES)
301
- end
302
-
303
- answers[:has_vcr] = prompt.yes?('Do you use VCR, WebMock or FakeWeb gem?')
304
-
305
- CI_PROVIDER_CHOICES = {
306
- 'https://circleci.com' => :circle,
307
- 'https://travis-ci.org' => :travis,
308
- 'https://buildkite.com' => :buildkite,
309
- 'https://semaphoreci.com' => :semaphore,
310
- 'https://snap-ci.com' => :snap_ci,
311
- 'Gitlab CI' => :gitlab,
312
- 'Jenkins' => :jenkins,
313
- 'other' => :other,
314
- }
315
- answers[:ci] = prompt.select("What is your CI provider?", CI_PROVIDER_CHOICES)
316
-
317
- puts
318
-
319
- # Instructions how to set up the gem
320
- puts
321
- puts
322
- prompt.say "###### Please follow below instructions to finish configuration ######", color: :green
323
- puts
324
-
325
- answers[:testing_tools].each do |tool|
326
- send("step_for_#{tool}", prompt)
327
- puts
328
- end
329
-
330
- if answers[:has_vcr]
331
- step_for_vcr(prompt)
332
- puts
333
- end
334
-
335
- send("step_for_ci_#{answers[:ci]}", prompt, answers)
336
-
337
- prompt.say "Final step", color: :yellow
338
- prompt.say "Now you are ready to use the gem!"
339
- puts
340
- prompt.say "Please push a new commit to repository so knapsack_pro gem will record time execution of your test suite."
341
- puts
342
- prompt.say "Go to user dashboard https://knapsackpro.com/dashboard and click build metrics link next to your API token. Click show link on recent build and ensure the time execution data were recorded for all your CI nodes. You should see info that build subsets were collected."
343
- puts
344
- prompt.say "Your second test suite run on CI will be parallelized with optimal test suite split if first run was recorded correctly."
345
- puts
346
- puts
347
- prompt.say "Later you may want to learn about Queue Mode and how to enable it:"
348
- prompt.say "https://github.com/KnapsackPro/knapsack_pro-ruby#queue-mode"
349
- puts
350
- puts
351
- prompt.say "You can learn more about custom configuration and other features:"
352
- prompt.say "https://knapsackpro.com/features"
353
- prompt.say "https://github.com/KnapsackPro/knapsack_pro-ruby#table-of-contents"
354
- puts
355
- prompt.say "###### Please follow above instructions to finish configuration ######", color: :green
356
- end
357
- end