knapsack 0.4.0 → 0.5.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: bc477465c1e83c26805933d0aead7afb9dd5cd49
4
- data.tar.gz: 73dc9071d26112fe9f7dc546aed93904bc553aac
3
+ metadata.gz: fa40f580898155eb65fe8e84fc8345a476a0a0ab
4
+ data.tar.gz: 62ff398b48201c72d6074a9e174955c317b52718
5
5
  SHA512:
6
- metadata.gz: f1151ac4215c86a36f7a0c977a7ec7fd7253cb4234afd83180ba18889891c6bde675423f83c03039b2ff45bea8c4e6dad4d4dd58e661b3b4b99e57a2ee6e8483
7
- data.tar.gz: 79ac330dd040c46f2217f768a068eaa49e0470cc64ed64c2fe72e747fe2c42a0989f1b279e219ff9e56c04406244ed35580c072062013b10d94101895cb688ac
6
+ metadata.gz: f2c797ee5e47d102f93bb618dbe2fe2bf1fdd9c5efefcb5c42e886f19382efdbef2292b1d7c0ace2fbb4716e060f3bf26e652e39acb7532f72873c3be33856e2
7
+ data.tar.gz: 42450a7369f6e9989b31975d54aa49c7f4b1341a1dff1d9fec37c66c9eef33acdc148870b3bc48f5708edeeb27fce107b0b38176070917dcee99a33404fce3d5
data/.rspec CHANGED
@@ -1,5 +1,5 @@
1
1
  --color
2
- --warnings
2
+ #--warnings
3
3
  --require spec_helper
4
4
  --format documentation
5
5
  #--profile
@@ -27,6 +27,9 @@ script:
27
27
  - echo "Run rake task for the second CI node"
28
28
  - CI_NODE_TOTAL=2 CI_NODE_INDEX=1 KNAPSACK_SPEC_PATTERN="spec_examples/**/*_spec.rb" bundle exec rake knapsack:rspec
29
29
 
30
+ - echo "Check passing arguments to rspec. Run only specs with custom_focus tag"
31
+ - KNAPSACK_SPEC_PATTERN="spec_examples/**/*_spec.rb" bundle exec rake "knapsack:rspec[--tag custom_focus]"
32
+
30
33
  - echo "Run specs with custom knapsack logger"
31
34
  - CUSTOM_LOGGER=true KNAPSACK_SPEC_PATTERN="spec_examples/**/*_spec.rb" bundle exec rake knapsack:rspec
32
35
 
@@ -2,6 +2,10 @@
2
2
 
3
3
  * TODO
4
4
 
5
+ ### 0.5.0
6
+
7
+ * Allow passing arguments to rspec via knapsack:rspec task.
8
+
5
9
  ### 0.4.0
6
10
 
7
11
  * Add support for RSpec 2.
data/README.md CHANGED
@@ -16,7 +16,10 @@
16
16
 
17
17
  Parallel specs across CI server nodes based on each spec file's time execution. Knapsack generates a spec time execution report and uses it for future test runs.
18
18
 
19
- Short [presentation](http://slides.com/arturt/knapsack) about gem.
19
+ Presentations about gem:
20
+
21
+ * [2014 X Kraków Ruby User Group](http://slides.com/arturt/parallel-tests-in-comparable-time)
22
+ * [2014 VII Lunar Logic Dev Meeting](http://slides.com/arturt/knapsack)
20
23
 
21
24
  **[Sign up](http://knapsack.launchrock.com) to get info about launch Knapsack Pro with more features and free access for beta users.**
22
25
 
@@ -96,6 +99,18 @@ You can set `KNAPSACK_REPORT_PATH` if your knapsack report was saved in non defa
96
99
 
97
100
  `CI_NODE_INDEX` - index of current CI node starts from 0. Second CI node should have `CI_NODE_INDEX=1`.
98
101
 
102
+ ### Passing arguments to rspec
103
+
104
+ Knapsack allows you to pass arguments through to rspec. For example if you want to run only specs that have the tag `focus`. If you do this with rspec directly it would look like:
105
+
106
+ $ bundle exec rake rspec --tag focus
107
+
108
+ To do this with Knapsack you simply add your rspec arguments as parameters to the knapsack rake task.
109
+
110
+ $ bundle exec rake "knapsack:rspec[--tag focus]"
111
+
112
+ Remember that using tags to limit which specs get run will affect the time each file takes to run. One solution to this is to generate a new `knapsack_report.json` for the commonly run scenarios.
113
+
99
114
  ### Info for CircleCI users
100
115
 
101
116
  If you are using circleci.com you can omit `CI_NODE_TOTAL` and `CI_NODE_INDEX`. Knapsack will use `CIRCLE_NODE_TOTAL` and `CIRCLE_NODE_INDEX` provided by CircleCI.
data/TODO.md CHANGED
@@ -2,4 +2,3 @@
2
2
 
3
3
  * Add other adapters and rake tasks than RSpec.
4
4
  * Add support for ENV CI node total and CI node index other than CircleCI.
5
-
@@ -1,3 +1,3 @@
1
1
  module Knapsack
2
- VERSION = '0.4.0'
2
+ VERSION = '0.5.0'
3
3
  end
@@ -1,8 +1,9 @@
1
1
  require 'knapsack'
2
2
 
3
3
  namespace :knapsack do
4
- task :rspec do
4
+ task :rspec, [:rspec_args] do |t, args|
5
5
  allocator = Knapsack::Allocator.new
6
+ rspec_args = args[:rspec_args]
6
7
 
7
8
  puts
8
9
  puts 'Report specs:'
@@ -12,7 +13,7 @@ namespace :knapsack do
12
13
  puts allocator.leftover_node_specs
13
14
  puts
14
15
 
15
- cmd = %Q[bundle exec rspec --default-path #{allocator.spec_dir} -- #{allocator.stringify_node_specs}]
16
+ cmd = %Q[bundle exec rspec #{rspec_args} --default-path #{allocator.spec_dir} -- #{allocator.stringify_node_specs}]
16
17
 
17
18
  exec(cmd)
18
19
  end
@@ -1,3 +1,3 @@
1
- describe 'Fast 1', :focus do
1
+ describe 'Fast 1', :focus, :custom_focus do
2
2
  it {}
3
3
  end
@@ -1,4 +1,4 @@
1
1
  # this file should not be included in knapsack_report.json
2
- describe 'Leftover Fast 1' do
2
+ describe 'Leftover Fast 1', :custom_focus do
3
3
  it {}
4
4
  end
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: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ArturT
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-12 00:00:00.000000000 Z
11
+ date: 2014-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler