paraspec 0.0.1 → 0.0.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 709786de26ffdac4d238bb0a1c531a654b7183386b0f85f0c523e74958f66f33
4
- data.tar.gz: aa00e1665689abead274c8259a1ab55e1fc049b9e16029723e8c19269248d884
3
+ metadata.gz: 76dfd75abb077976992e37c9934206e610f652f8f7d88564bcfdd9356cf473e1
4
+ data.tar.gz: 5d08c00a5d951348ba228bb94509158ddae389b21e0e500b011cbdb6aa379a52
5
5
  SHA512:
6
- metadata.gz: 70f1e59627cc4d63ae6653b0f945831d9d7abac73cc998c76b1f8c36100e5b1a1f4578731c091904086a159be9ff4d3a16f24702f7847eb46cffac2c39947d4b
7
- data.tar.gz: 06d5f5746820455ebe7fc0d440cc8f335a8c8ca6177a5d1a36afc0691d0854a9b2df31eb27b87726470be35139e7fdece0d2315e3bbbec07966ba4e7a0ae7801
6
+ metadata.gz: e04a18244f08e43e84a9a610405fa6972820f658b84ba67e81a954fd5635873aba6e53ddef8277985d124dbcb6ec6055e5dfbe7f51930c92e314c44078869aeb
7
+ data.tar.gz: 8b7ef16dee8bb3506442cb8a7b761dbb91929881acd74c4369203f390381de0a3902d59341ce58eb23fa41684754bbd911bb8f67b3ba8a80eddd3fa379689aa4
data/README.md CHANGED
@@ -10,7 +10,7 @@ back to the master and requests the next test until there are no more left.
10
10
  This producer/consumer architecture enables a number of features:
11
11
 
12
12
  1. The worker load is naturally balanced. If a worker happens to come across
13
- a slow test, the other workers keep chugging away at faster tests.
13
+ a slow test, the other workers keep chugging away at the remaining tests.
14
14
  2. Tests defined in a single file can be executed by multiple workers,
15
15
  since paraspec operates on a test by test basis and not on a file by file basis.
16
16
  3. Standard output and error streams can be[*] captured and grouped on a
@@ -19,12 +19,31 @@ This output capture can be performed for output generated by C extensions
19
19
  as well as plain Ruby code.
20
20
  4. Test results are seamlessly integrated by the master, such that
21
21
  a parallel run produces a single progress bar with Fuubar across all workers.
22
+ 5. Test grouping: paraspec can[**] group the tests by file, top level example
23
+ group, bottom level example group and individually by examples.
24
+ Larger groupings reduce overhead but limit concurrency.
25
+ Smaller groupings have more overhead but higher concurrency.
26
+ 6. Paraspec is naturally resilient to worker failure. If a worker dies
27
+ for any reason the remaining tests get automatically redistributed among
28
+ the remaining workers. It is also possible, in theory, to provision
29
+ additional workers when a test run is already in progress, though this feature
30
+ is not currently on the roadmap.
22
31
 
23
32
  [*] This feature is not yet implemented.
24
33
 
34
+ [**] Currently only grouping by bottom level example group is implemented.
35
+
25
36
  ## Usage
26
37
 
27
- For a test suite with no external dependencies, using paraspec is
38
+ Add paraspec to your Gemfile:
39
+
40
+ gem 'paraspec'
41
+
42
+ This is necessary because paraspec has its own dependencies and loads
43
+ the application being tested into its environment, hence both paraspec's
44
+ and application's dependencies need to exist in the same Bundler environment.
45
+
46
+ Then, for a test suite with no external dependencies, using paraspec is
28
47
  trivially easy. Just run:
29
48
 
30
49
  paraspec
@@ -39,7 +58,8 @@ To pass options to rspec, for example to filter examples to run:
39
58
  paraspec -- spec/my_spec.rb
40
59
 
41
60
  For a test suite with external dependencies, paraspec sets the
42
- `TEST_ENV_NUMBER` environment variable, like
61
+ `TEST_ENV_NUMBER` environment variable to an integer starting from 1
62
+ corresponding to the worker number, like
43
63
  [parallel_tests](https://github.com/grosser/parallel_tests) does.
44
64
  The test suite can then configure itself differently in each worker.
45
65
 
@@ -88,6 +108,23 @@ The debugging output is turned on with `-d`/`--debug` option:
88
108
  paraspec -d ipc # IPC requests and responses
89
109
  paraspec -d perf # timing & performance information
90
110
 
111
+ ## Caveats
112
+
113
+ The master and workers need to all define the same example groups and
114
+ examples, otherwise a worker may retrieve an example group from the master
115
+ that it is unable to run. RSpec provides a way to define tests conditionally
116
+ via `if:` and `unless:` options on contexts and examples, and if this
117
+ functionality is used it is important to make sure that all workers are
118
+ configured identically (especially if such conditional configuration is
119
+ dependent on external resources such as a network server).
120
+
121
+ Paraspec will check workers' example groups and examples for equality
122
+ with master and will raise an error if there is a mismatch.
123
+
124
+ ## Known Issues
125
+
126
+ Aborting a test run with Ctrl-C can leave the workers still running.
127
+
91
128
  ## Bugs & Patches
92
129
 
93
130
  Please report via issues and pull requests.
@@ -1,3 +1,3 @@
1
1
  module Paraspec
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
@@ -40,8 +40,10 @@ module Paraspec
40
40
  return if examples.empty?
41
41
  # It is important to run the entire world here because if
42
42
  # a particular example group is run, before/after :all hooks
43
- # aren't always run
44
- RSpec.world.ordered_example_groups.each do |group|
43
+ # aren't always run.
44
+ # And "the entire world" means our complete list of example groups,
45
+ # not RSpec.world.ordered_example_groups which are top level only!
46
+ RSpecFacade.all_example_groups.each do |group|
45
47
  group.reset_memoized
46
48
  end
47
49
  # Hack to not run examples from each group each time I want to run
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paraspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oleg Pudeyev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-03 00:00:00.000000000 Z
11
+ date: 2018-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec-core
@@ -119,5 +119,5 @@ rubyforge_project:
119
119
  rubygems_version: 2.7.3
120
120
  signing_key:
121
121
  specification_version: 4
122
- summary: paraspec-0.0.1
122
+ summary: paraspec-0.0.2
123
123
  test_files: []