rspec-abq 0.1.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.md +21 -0
- data/README.md +8 -2
- data/lib/rspec/abq/extensions.rb +6 -2
- data/lib/rspec/abq/ordering.rb +6 -1
- data/lib/rspec/abq/version.rb +1 -1
- data/lib/rspec/abq.rb +25 -16
- metadata +15 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ba8b36702b47a05aa98804502a7050443fb867361e513f638f7c4e9565381d5
|
4
|
+
data.tar.gz: 58c935e604bd8924d47f9a24061e18cf59cdf92930a6f509957a27b65f3c2599
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb7bd9a6ca27be92b253fdaeb48498d8a63a4f700819278c3968221d4b4b0d2f7fdbe8a7e72c0f0af3494705f5b5c2dfbfb67623e4b5866c46bf126454dc8125
|
7
|
+
data.tar.gz: 745195f4be73d7d93499d50757b5f9e837d04b18a3973f6cd61c7c0e8d8721b7a8f3674744da57da004bb256c40c200f1f7fcc50693373d4d8a681e3b1ecf77d
|
data/LICENSE.md
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# MIT LICENSE
|
2
|
+
|
3
|
+
Copyright (c) 2022 ReadWriteExecute, Inc. and contributors
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
CHANGED
@@ -16,7 +16,9 @@ end
|
|
16
16
|
|
17
17
|
And then execute:
|
18
18
|
|
19
|
-
|
19
|
+
```
|
20
|
+
bundle
|
21
|
+
```
|
20
22
|
|
21
23
|
## Usage
|
22
24
|
|
@@ -26,6 +28,10 @@ Use the included binary with abq:
|
|
26
28
|
abq test -- bundle exec rspec
|
27
29
|
```
|
28
30
|
|
31
|
+
## Compatibility
|
32
|
+
|
33
|
+
This gem is actively tested against rubies 2.6-3.1 and rspecs 3.5-3.12
|
34
|
+
|
29
35
|
## Development
|
30
36
|
|
31
37
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
@@ -38,7 +44,7 @@ use the release script, `./release_gem.rb`
|
|
38
44
|
|
39
45
|
## Contributing
|
40
46
|
|
41
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/rwx-research/rspec-abq
|
47
|
+
Bug reports and pull requests are welcome on GitHub at <https://github.com/rwx-research/rspec-abq>. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
42
48
|
|
43
49
|
## Code of Conduct
|
44
50
|
|
data/lib/rspec/abq/extensions.rb
CHANGED
@@ -53,7 +53,9 @@ module RSpec
|
|
53
53
|
|
54
54
|
should_run_context_hooks = descendant_filtered_examples.any?
|
55
55
|
begin
|
56
|
-
RSpec
|
56
|
+
if Gem::Version.new(RSpec::Core::Version::STRING) >= Gem::Version.new("3.11.0")
|
57
|
+
RSpec.current_scope = :before_context_hook
|
58
|
+
end
|
57
59
|
run_before_context_hooks(new("before(:context) hook")) if should_run_context_hooks
|
58
60
|
|
59
61
|
# If the next example to run is on the surface of this group, scan all
|
@@ -85,7 +87,9 @@ module RSpec
|
|
85
87
|
RSpec.world.wants_to_quit = true if reporter.fail_fast_limit_met?
|
86
88
|
false
|
87
89
|
ensure
|
88
|
-
RSpec
|
90
|
+
if Gem::Version.new(RSpec::Core::Version::STRING) >= Gem::Version.new("3.11.0")
|
91
|
+
RSpec.current_scope = :after_context_hook
|
92
|
+
end
|
89
93
|
run_after_context_hooks(new("after(:context) hook")) if should_run_context_hooks
|
90
94
|
reporter.example_group_finished(self)
|
91
95
|
end
|
data/lib/rspec/abq/ordering.rb
CHANGED
@@ -4,7 +4,12 @@ module RSpec
|
|
4
4
|
# and reading the ordering from `init_meta` to set up the current processes settings
|
5
5
|
module Ordering
|
6
6
|
# notably: we don't support custom orderings
|
7
|
-
SUPPORTED_ORDERINGS =
|
7
|
+
SUPPORTED_ORDERINGS =
|
8
|
+
if Gem::Version.new(RSpec::Core::Version::STRING) >= Gem::Version.new("3.11.0")
|
9
|
+
[:defined, :recently_modified, :random]
|
10
|
+
else
|
11
|
+
[:defined, :random]
|
12
|
+
end
|
8
13
|
|
9
14
|
# Raised when we experience an ordering that doesn't exist in SUPPORTED_ORDERINGS
|
10
15
|
UnsupportedOrderingError = Class.new(StandardError)
|
data/lib/rspec/abq/version.rb
CHANGED
data/lib/rspec/abq.rb
CHANGED
@@ -66,10 +66,16 @@ module RSpec
|
|
66
66
|
Extensions.setup!
|
67
67
|
end
|
68
68
|
|
69
|
+
# raised if we try to load rspec-abq twice
|
70
|
+
# perhaps RSpec or a plugin has changed behavior to break assumptions we've made with rspec-abq
|
71
|
+
AbqLoadedTwiceError = Class.new(StandardError)
|
72
|
+
|
69
73
|
# @!visibility private
|
70
74
|
# @return [Boolean]
|
71
75
|
def self.setup_after_specs_loaded!
|
72
|
-
ENV[ABQ_RSPEC_PID]
|
76
|
+
fail AbqLoadedTwiceError, "tried to setup abq-rspec twice" if ENV[ABQ_RSPEC_PID]
|
77
|
+
ENV[ABQ_RSPEC_PID] ||= Process.pid.to_s
|
78
|
+
|
73
79
|
# ABQ doesn't support writing example status to disk yet.
|
74
80
|
# in its simple implementation, status persistance write the status of all tests which ends up hanging with under
|
75
81
|
# abq because we haven't run most of the tests in this worker. (maybe it's running the tests?). In any case:
|
@@ -80,9 +86,13 @@ module RSpec
|
|
80
86
|
if !!ENV[ABQ_GENERATE_MANIFEST] # the abq worker will set this env var if it needs a manifest
|
81
87
|
RSpec::Abq::Manifest.write_manifest(RSpec.world.ordered_example_groups, RSpec.configuration.seed, RSpec.configuration.ordering_registry)
|
82
88
|
# ... Maybe it's fine to just exit(0)
|
83
|
-
RSpec.
|
84
|
-
|
85
|
-
|
89
|
+
if Gem::Version.new(RSpec::Core::Version::STRING) >= Gem::Version.new("3.10.0")
|
90
|
+
RSpec.world.wants_to_quit = true # ask rspec to exit
|
91
|
+
RSpec.configuration.error_exit_code = 0
|
92
|
+
RSpec.world.non_example_failure = true # exit has nothing to do with tests
|
93
|
+
else
|
94
|
+
exit(0)
|
95
|
+
end
|
86
96
|
return true
|
87
97
|
end
|
88
98
|
|
@@ -90,23 +100,22 @@ module RSpec
|
|
90
100
|
# new rspec process
|
91
101
|
|
92
102
|
# enabling colors allows us to pass through nicer error messages
|
93
|
-
|
103
|
+
|
104
|
+
if Gem::Version.new(RSpec::Core::Version::STRING) >= Gem::Version.new("3.6.0")
|
105
|
+
RSpec.configuration.color_mode = :on
|
106
|
+
else
|
107
|
+
RSpec.configuration.color = true
|
108
|
+
end
|
94
109
|
|
95
110
|
# the first message is the init_meta block of the manifest. This is used to share runtime configuration
|
96
111
|
# information amongst worker processes. In RSpec, it is used to ensure that random ordering between workers
|
97
112
|
# shares the same seed, so can be deterministic.
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
Ordering.setup!(init_message, RSpec.configuration) unless init_message.empty?
|
113
|
+
init_message = protocol_read
|
114
|
+
protocol_write(INIT_SUCCESS_MESSAGE)
|
115
|
+
# TODO: delete the check for empty init_meta when https://github.com/rwx-research/abq/pull/216 is merged
|
116
|
+
if !init_message["fast_exit"] && init_message["init_meta"].any?
|
117
|
+
Ordering.setup!(init_message["init_meta"], RSpec.configuration)
|
104
118
|
fetch_next_example
|
105
|
-
else
|
106
|
-
# to support the old protocol, we don't depend on the initialization method, however we don't support random
|
107
|
-
# ordering via config, only via a shared command line seed. `abq test -- rspec --seed 4` will pass the
|
108
|
-
# deterministic seed to all workers.
|
109
|
-
fetch_next_example(message)
|
110
119
|
end
|
111
120
|
nil
|
112
121
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-abq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ayaz Hafiz
|
@@ -15,16 +15,22 @@ dependencies:
|
|
15
15
|
name: rspec-core
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - "
|
18
|
+
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 3.
|
20
|
+
version: 3.5.0
|
21
|
+
- - "<"
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 3.13.0
|
21
24
|
type: :runtime
|
22
25
|
prerelease: false
|
23
26
|
version_requirements: !ruby/object:Gem::Requirement
|
24
27
|
requirements:
|
25
|
-
- - "
|
28
|
+
- - ">="
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: 3.5.0
|
31
|
+
- - "<"
|
26
32
|
- !ruby/object:Gem::Version
|
27
|
-
version: 3.
|
33
|
+
version: 3.13.0
|
28
34
|
description: RSpec::Abq is an rspec plugin that replaces its ordering with one that
|
29
35
|
is controlled by abq. It allows for parallelization of rspec on a single machine
|
30
36
|
or across multiple workers.
|
@@ -35,6 +41,7 @@ executables: []
|
|
35
41
|
extensions: []
|
36
42
|
extra_rdoc_files: []
|
37
43
|
files:
|
44
|
+
- LICENSE.md
|
38
45
|
- README.md
|
39
46
|
- lib/rspec/abq.rb
|
40
47
|
- lib/rspec/abq/extensions.rb
|
@@ -44,13 +51,15 @@ files:
|
|
44
51
|
- lib/rspec/abq/test_case.rb
|
45
52
|
- lib/rspec/abq/version.rb
|
46
53
|
homepage: https://github.com/rwx-research/rspec-abq
|
47
|
-
licenses:
|
54
|
+
licenses:
|
55
|
+
- MIT
|
48
56
|
metadata:
|
49
57
|
homepage_uri: https://github.com/rwx-research/rspec-abq
|
50
58
|
bug_tracker_uri: https://github.com/rwx-research/rspec-abq/issues
|
51
59
|
changelog_uri: https://github.com/rwx-research/rspec-abq/releases
|
52
60
|
documentation_uri: https://rwx-research.github.io/rspec-abq/
|
53
61
|
source_code_uri: https://github.com/rwx-research/rspec-abq
|
62
|
+
rubygems_mfa_required: 'true'
|
54
63
|
post_install_message:
|
55
64
|
rdoc_options: []
|
56
65
|
require_paths:
|