rspec-abq 0.1.0 → 0.2.0

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: f99eb724ca058a63aa026b82c6d9bfda4a5aaf98df3d7fc0485025db98e46b43
4
- data.tar.gz: bcfa57ca1f21298e63f4feed8e3d845a1304c9db9915360146931eb0c521105f
3
+ metadata.gz: c8b8a25cd22948b9135bd5036dd6668d4d5e676701666d1ec4f292093024b991
4
+ data.tar.gz: d7be39b4e9fd99aade6874938a6bd0453b342d3d6e16429095f546eabe4f9a46
5
5
  SHA512:
6
- metadata.gz: a95ccc0549bc1d46f79c25fbe7de2f7b3f88cd74474039333d8b72b31858bf4c903169e4b7bbb55cfb277b4844bcc7073a56eb87bc332bac82d41261de31ef6a
7
- data.tar.gz: 9b497c0bd97ee1760a18077d88bfa3da9c0340393648d01a1a53d8ec4f91a95303303b5a329b933bd0212a246a83477f7912e1359aca9b5f5aac365ec9dc1cf3
6
+ metadata.gz: 269ac1413322da658c4f13ffb2dd78fd5f37d08fac32ed8d569e9e5443a131b026d5cd579e5f176ba92b7926fb8b2a34671bd8324d72a0c59b693f86fdc6bac9
7
+ data.tar.gz: eef0ac675ec2ba23db3223939bf56a5ac9f978b00604008a6b252b5fe32249e015711f4c60500c760f4e042346bd02740e85101d89d9498640e35e5a79e68391
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.
@@ -1,6 +1,6 @@
1
1
  module RSpec
2
2
  module Abq
3
3
  # current version!
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
6
6
  end
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] = Process.pid.to_s
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:
@@ -95,18 +101,12 @@ module RSpec
95
101
  # the first message is the init_meta block of the manifest. This is used to share runtime configuration
96
102
  # information amongst worker processes. In RSpec, it is used to ensure that random ordering between workers
97
103
  # shares the same seed, so can be deterministic.
98
- message = protocol_read
99
- init_message = message["init_meta"]
100
- if init_message
101
- protocol_write(INIT_SUCCESS_MESSAGE)
102
- # todo: get rid of this unless init_message.empty? as soon as the bug is fixed in abq
103
- Ordering.setup!(init_message, RSpec.configuration) unless init_message.empty?
104
+ init_message = protocol_read
105
+ protocol_write(INIT_SUCCESS_MESSAGE)
106
+ # TODO: delete the check for empty init_meta when https://github.com/rwx-research/abq/pull/216 is merged
107
+ if !init_message["fast_exit"] && init_message["init_meta"].any?
108
+ Ordering.setup!(init_message["init_meta"], RSpec.configuration)
104
109
  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
110
  end
111
111
  nil
112
112
  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.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ayaz Hafiz
@@ -35,6 +35,7 @@ executables: []
35
35
  extensions: []
36
36
  extra_rdoc_files: []
37
37
  files:
38
+ - LICENSE.md
38
39
  - README.md
39
40
  - lib/rspec/abq.rb
40
41
  - lib/rspec/abq/extensions.rb
@@ -44,13 +45,15 @@ files:
44
45
  - lib/rspec/abq/test_case.rb
45
46
  - lib/rspec/abq/version.rb
46
47
  homepage: https://github.com/rwx-research/rspec-abq
47
- licenses: []
48
+ licenses:
49
+ - MIT
48
50
  metadata:
49
51
  homepage_uri: https://github.com/rwx-research/rspec-abq
50
52
  bug_tracker_uri: https://github.com/rwx-research/rspec-abq/issues
51
53
  changelog_uri: https://github.com/rwx-research/rspec-abq/releases
52
54
  documentation_uri: https://rwx-research.github.io/rspec-abq/
53
55
  source_code_uri: https://github.com/rwx-research/rspec-abq
56
+ rubygems_mfa_required: 'true'
54
57
  post_install_message:
55
58
  rdoc_options: []
56
59
  require_paths: