rspec-abq 0.2.0 → 0.2.1
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 +4 -4
- 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 +13 -4
- metadata +11 -5
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/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
@@ -86,9 +86,13 @@ module RSpec
|
|
86
86
|
if !!ENV[ABQ_GENERATE_MANIFEST] # the abq worker will set this env var if it needs a manifest
|
87
87
|
RSpec::Abq::Manifest.write_manifest(RSpec.world.ordered_example_groups, RSpec.configuration.seed, RSpec.configuration.ordering_registry)
|
88
88
|
# ... Maybe it's fine to just exit(0)
|
89
|
-
RSpec.
|
90
|
-
|
91
|
-
|
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
|
92
96
|
return true
|
93
97
|
end
|
94
98
|
|
@@ -96,7 +100,12 @@ module RSpec
|
|
96
100
|
# new rspec process
|
97
101
|
|
98
102
|
# enabling colors allows us to pass through nicer error messages
|
99
|
-
|
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
|
100
109
|
|
101
110
|
# the first message is the init_meta block of the manifest. This is used to share runtime configuration
|
102
111
|
# information amongst worker processes. In RSpec, it is used to ensure that random ordering between workers
|
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.2.
|
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.
|