selective-ruby-rspec 0.1.7 → 0.1.9
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/.rwx/push.yml +30 -0
- data/.semaphore/semaphore.yml +3 -3
- data/lib/selective/ruby/rspec/monkeypatches.rb +24 -3
- data/lib/selective/ruby/rspec/runner_wrapper.rb +7 -1
- data/lib/selective/ruby/rspec/version.rb +1 -1
- data/selective-ruby-rspec.gemspec +40 -0
- metadata +22 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 89ad50cd02294aa7e1b6650ce52fd75c482288882dacbd08c7f27538687c4a3c
|
|
4
|
+
data.tar.gz: 4f9450bbfb488758b949996fe1f867d89260f78cf333eb4938852c6739b03da0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ed755443380ebcc8d9b30e524d377590a374efe743603cb2f6aaf9c4cd5c91b2bf4d47bba4966ba5da67c583f636234a7117136181682a23960147753f3839df
|
|
7
|
+
data.tar.gz: a19235ebde1d57a2a54ed2a1a37dbf1681662a58d2013637871f9fd568bea26a2902edfb6ca150d422326febf1ee4b0334989b9b4a7a51fa0c4fe9c1bd7b62a0
|
data/.rwx/push.yml
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
on:
|
|
2
|
+
github:
|
|
3
|
+
push:
|
|
4
|
+
init:
|
|
5
|
+
commit-sha: ${{ event.git.sha }}
|
|
6
|
+
|
|
7
|
+
base:
|
|
8
|
+
image: ubuntu:24.04
|
|
9
|
+
config: rwx/base 1.0.2
|
|
10
|
+
|
|
11
|
+
tasks:
|
|
12
|
+
- key: code
|
|
13
|
+
call: git/clone 2.0.7
|
|
14
|
+
with:
|
|
15
|
+
repository: https://github.com/selectiveci/selective-ruby-rspec.git
|
|
16
|
+
ref: ${{ init.commit-sha }}
|
|
17
|
+
github-token: ${{ github.token }}
|
|
18
|
+
- key: ruby
|
|
19
|
+
call: ruby/install 1.2.27
|
|
20
|
+
with:
|
|
21
|
+
ruby-version: 4.0.3
|
|
22
|
+
- key: install-dependencies
|
|
23
|
+
use: [code, ruby]
|
|
24
|
+
run: bundle install
|
|
25
|
+
- key: run-tests
|
|
26
|
+
use: [install-dependencies]
|
|
27
|
+
env:
|
|
28
|
+
SELECTIVE_API_KEY: ${{ vaults.selective.secrets.selective-ruby-rspec-api-key }}
|
|
29
|
+
parallel: 4
|
|
30
|
+
run: bundle exec selective rspec
|
data/.semaphore/semaphore.yml
CHANGED
|
@@ -2,8 +2,8 @@ version: v1.0
|
|
|
2
2
|
name: Ruby
|
|
3
3
|
agent:
|
|
4
4
|
machine:
|
|
5
|
-
type:
|
|
6
|
-
os_image:
|
|
5
|
+
type: f1-standard-2
|
|
6
|
+
os_image: ubuntu2404
|
|
7
7
|
blocks:
|
|
8
8
|
- name: Run RSpec tests
|
|
9
9
|
task:
|
|
@@ -11,7 +11,7 @@ blocks:
|
|
|
11
11
|
- name: Run RSpec tests
|
|
12
12
|
parallelism: 2
|
|
13
13
|
commands:
|
|
14
|
-
- sem-version ruby
|
|
14
|
+
- sem-version ruby 4.0.3
|
|
15
15
|
- checkout
|
|
16
16
|
- bundle install
|
|
17
17
|
- bundle exec selective rspec
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
require 'benchmark'
|
|
2
|
+
|
|
1
3
|
module Selective
|
|
2
4
|
module Ruby
|
|
3
5
|
module RSpec
|
|
@@ -121,7 +123,14 @@ module Selective
|
|
|
121
123
|
|
|
122
124
|
def run(*args)
|
|
123
125
|
@exception = nil
|
|
124
|
-
|
|
126
|
+
# Records the files this example executes when the server has
|
|
127
|
+
# asked for a test map; a plain pass-through otherwise (and on
|
|
128
|
+
# older cores that predate test maps).
|
|
129
|
+
if ::Selective::Ruby::Core.const_defined?(:TestMap)
|
|
130
|
+
::Selective::Ruby::Core::TestMap.around(id) { super(*args) }
|
|
131
|
+
else
|
|
132
|
+
super
|
|
133
|
+
end
|
|
125
134
|
end
|
|
126
135
|
end
|
|
127
136
|
|
|
@@ -154,8 +163,20 @@ module Selective
|
|
|
154
163
|
module Hooks
|
|
155
164
|
HOOKS.each do |hook|
|
|
156
165
|
define_method(hook) do |*args, &block|
|
|
157
|
-
|
|
158
|
-
|
|
166
|
+
if args.any? { |a| a == :all}
|
|
167
|
+
args = args.map { |a| a == :all ? :each : a }
|
|
168
|
+
super(*args, &->(example) {
|
|
169
|
+
Benchmark.measure { example.instance_exec(example, &block) }.tap do |time|
|
|
170
|
+
Selective::Ruby::Core::Controller.report_at_finish.tap do |report_at_finish|
|
|
171
|
+
key = :"seconds_in_#{hook}_all_hooks"
|
|
172
|
+
report_at_finish[key] ||= 0
|
|
173
|
+
report_at_finish[key] += time.real
|
|
174
|
+
end
|
|
175
|
+
end
|
|
176
|
+
})
|
|
177
|
+
else
|
|
178
|
+
super(*args, &block)
|
|
179
|
+
end
|
|
159
180
|
end
|
|
160
181
|
end
|
|
161
182
|
end
|
|
@@ -75,7 +75,13 @@ module Selective
|
|
|
75
75
|
end
|
|
76
76
|
|
|
77
77
|
def exit_status
|
|
78
|
-
::RSpec.
|
|
78
|
+
if Gem::Version.new(::RSpec::Core::Version::STRING) >= Gem::Version.new("3.10")
|
|
79
|
+
rspec_runner.exit_code(::RSpec.world.reporter.failed_examples.none?)
|
|
80
|
+
else
|
|
81
|
+
return ::RSpec.world.reporter.exit_early(rspec_runner.configuration.failure_exit_code) if ::RSpec.world.wants_to_quit
|
|
82
|
+
|
|
83
|
+
::RSpec.world.reporter.failed_examples.any? ? 1 : 0
|
|
84
|
+
end
|
|
79
85
|
end
|
|
80
86
|
|
|
81
87
|
def finish
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "lib/selective/ruby/rspec/version"
|
|
4
|
+
|
|
5
|
+
Gem::Specification.new do |spec|
|
|
6
|
+
spec.name = "selective-ruby-rspec"
|
|
7
|
+
spec.version = Selective::Ruby::RSpec::VERSION
|
|
8
|
+
spec.authors = ["Benjamin Wood", "Nate Vick"]
|
|
9
|
+
spec.email = ["ben@hint.io", "nate@hint.io"]
|
|
10
|
+
spec.license = "MIT"
|
|
11
|
+
|
|
12
|
+
spec.summary = "Selective Ruby RSpec Client"
|
|
13
|
+
spec.description = "Selective is an intelligent test runner for your current CI provider. Get real-time test results, intelligent ordering based on code changes, shorter run times, automatic flake detection, the ability to re-enqueue failed tests, and more."
|
|
14
|
+
spec.homepage = "https://www.selective.ci"
|
|
15
|
+
spec.required_ruby_version = ">= 2.6.0"
|
|
16
|
+
|
|
17
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
|
18
|
+
spec.metadata["source_code_uri"] = "http://github.com/selectiveci/selective-ruby-rspec"
|
|
19
|
+
spec.metadata["changelog_uri"] = "https://github.com/selectiveci/selective-ruby-rspec/blob/main/CHANGELOG.md"
|
|
20
|
+
|
|
21
|
+
# Specify which files should be added to the gem when it is released.
|
|
22
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
|
23
|
+
spec.files = Dir.chdir(__dir__) do
|
|
24
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
|
25
|
+
(File.expand_path(f) == __FILE__) || f.start_with?(*%w[bin/ test/ spec/ features/ log/ gemfiles/ .git .circleci appveyor .rspec .ruby-version .standard.yml README.md CHANGELOG.md CODE_OF_CONDUCT.md Gemfile Appraisals])
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
spec.bindir = "exe"
|
|
30
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
|
31
|
+
spec.require_paths = ["lib"]
|
|
32
|
+
|
|
33
|
+
# Uncomment to register a new dependency of your gem
|
|
34
|
+
spec.add_dependency("zeitwerk", "~> 2.6.12")
|
|
35
|
+
spec.add_dependency("selective-ruby-core", ">= 0.2.3")
|
|
36
|
+
spec.add_dependency("benchmark", ">= 0.5.0")
|
|
37
|
+
|
|
38
|
+
# For more information and examples about making a new gem, check out our
|
|
39
|
+
# guide at: https://bundler.io/guides/creating_gem.html
|
|
40
|
+
end
|
metadata
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: selective-ruby-rspec
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.9
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Benjamin Wood
|
|
8
8
|
- Nate Vick
|
|
9
|
-
autorequire:
|
|
9
|
+
autorequire:
|
|
10
10
|
bindir: exe
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date:
|
|
12
|
+
date: 2026-09-29 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: zeitwerk
|
|
@@ -39,6 +39,20 @@ dependencies:
|
|
|
39
39
|
- - ">="
|
|
40
40
|
- !ruby/object:Gem::Version
|
|
41
41
|
version: 0.2.3
|
|
42
|
+
- !ruby/object:Gem::Dependency
|
|
43
|
+
name: benchmark
|
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
|
45
|
+
requirements:
|
|
46
|
+
- - ">="
|
|
47
|
+
- !ruby/object:Gem::Version
|
|
48
|
+
version: 0.5.0
|
|
49
|
+
type: :runtime
|
|
50
|
+
prerelease: false
|
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
52
|
+
requirements:
|
|
53
|
+
- - ">="
|
|
54
|
+
- !ruby/object:Gem::Version
|
|
55
|
+
version: 0.5.0
|
|
42
56
|
description: Selective is an intelligent test runner for your current CI provider.
|
|
43
57
|
Get real-time test results, intelligent ordering based on code changes, shorter
|
|
44
58
|
run times, automatic flake detection, the ability to re-enqueue failed tests, and
|
|
@@ -50,6 +64,7 @@ executables: []
|
|
|
50
64
|
extensions: []
|
|
51
65
|
extra_rdoc_files: []
|
|
52
66
|
files:
|
|
67
|
+
- ".rwx/push.yml"
|
|
53
68
|
- ".semaphore/semaphore.yml"
|
|
54
69
|
- LICENSE
|
|
55
70
|
- Rakefile
|
|
@@ -58,6 +73,7 @@ files:
|
|
|
58
73
|
- lib/selective/ruby/rspec/monkeypatches.rb
|
|
59
74
|
- lib/selective/ruby/rspec/runner_wrapper.rb
|
|
60
75
|
- lib/selective/ruby/rspec/version.rb
|
|
76
|
+
- selective-ruby-rspec.gemspec
|
|
61
77
|
homepage: https://www.selective.ci
|
|
62
78
|
licenses:
|
|
63
79
|
- MIT
|
|
@@ -65,7 +81,7 @@ metadata:
|
|
|
65
81
|
homepage_uri: https://www.selective.ci
|
|
66
82
|
source_code_uri: http://github.com/selectiveci/selective-ruby-rspec
|
|
67
83
|
changelog_uri: https://github.com/selectiveci/selective-ruby-rspec/blob/main/CHANGELOG.md
|
|
68
|
-
post_install_message:
|
|
84
|
+
post_install_message:
|
|
69
85
|
rdoc_options: []
|
|
70
86
|
require_paths:
|
|
71
87
|
- lib
|
|
@@ -80,8 +96,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
80
96
|
- !ruby/object:Gem::Version
|
|
81
97
|
version: '0'
|
|
82
98
|
requirements: []
|
|
83
|
-
rubygems_version: 3.
|
|
84
|
-
signing_key:
|
|
99
|
+
rubygems_version: 3.5.22
|
|
100
|
+
signing_key:
|
|
85
101
|
specification_version: 4
|
|
86
102
|
summary: Selective Ruby RSpec Client
|
|
87
103
|
test_files: []
|