ci-helper 0.7.0 → 0.8.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 +4 -4
- data/.github/workflows/test.yml +1 -1
- data/.rubocop.yml +1 -1
- data/Gemfile +2 -0
- data/Gemfile.lock +8 -3
- data/ci_helper.gemspec +1 -1
- data/lib/ci_helper/commands/run_specs.rb +27 -4
- data/lib/ci_helper/version.rb +1 -1
- metadata +4 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6752c279e742404a6b104c4d4e2bccfaf4c18e17cfb0c6693ce1ddb0ce2b58e1
|
4
|
+
data.tar.gz: 4e9960ccc6a0f0bd7b1ecf65a4c6df063cf579cdc71338dddb90248065368332
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d8da6805297e53be7955d7219289dbece6f2decacdf760b81061e5745c4066a458b8b23ffa64cf06691ac270b00d58259941523e39ed919d056acc28aff0a85
|
7
|
+
data.tar.gz: 97b48c63728b3ef1c3a3457a1b5c90e4f2954d250783db38eed9ae6414aeb177cacfca9038d9d46226f6c307f0439a608c38e9bee83ec5999f93d39ba8a2a141
|
data/.github/workflows/test.yml
CHANGED
data/.rubocop.yml
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ci-helper (0.
|
4
|
+
ci-helper (0.8.0)
|
5
5
|
colorize (~> 1.1)
|
6
6
|
dry-inflector (~> 1.0)
|
7
7
|
umbrellio-sequel-plugins (~> 0.14)
|
@@ -21,6 +21,7 @@ GEM
|
|
21
21
|
tzinfo (~> 2.0)
|
22
22
|
ast (2.4.2)
|
23
23
|
base64 (0.2.0)
|
24
|
+
benchmark (0.4.1)
|
24
25
|
bigdecimal (3.1.4)
|
25
26
|
bundler-audit (0.9.1)
|
26
27
|
bundler (>= 1.2.0, < 3)
|
@@ -40,6 +41,7 @@ GEM
|
|
40
41
|
method_source (1.0.0)
|
41
42
|
minitest (5.20.0)
|
42
43
|
mutex_m (0.2.0)
|
44
|
+
ostruct (0.6.3)
|
43
45
|
parallel (1.23.0)
|
44
46
|
parser (3.2.2.4)
|
45
47
|
ast (~> 2.4.1)
|
@@ -122,13 +124,16 @@ GEM
|
|
122
124
|
unicode-display_width (2.5.0)
|
123
125
|
|
124
126
|
PLATFORMS
|
125
|
-
arm64-darwin
|
127
|
+
arm64-darwin
|
128
|
+
ruby
|
126
129
|
x86_64-linux
|
127
130
|
|
128
131
|
DEPENDENCIES
|
132
|
+
benchmark
|
129
133
|
bundler
|
130
134
|
bundler-audit
|
131
135
|
ci-helper!
|
136
|
+
ostruct
|
132
137
|
pry
|
133
138
|
rake
|
134
139
|
rspec
|
@@ -137,4 +142,4 @@ DEPENDENCIES
|
|
137
142
|
simplecov-lcov
|
138
143
|
|
139
144
|
BUNDLED WITH
|
140
|
-
2.
|
145
|
+
2.7.2
|
data/ci_helper.gemspec
CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.description = "CIHelper is a gem with Continuous Integration helpers for Ruby"
|
13
13
|
spec.homepage = "https://github.com/umbrellio/ci_helper"
|
14
14
|
spec.license = "MIT"
|
15
|
-
spec.required_ruby_version = Gem::Requirement.new(">= 2.
|
15
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 3.2.0")
|
16
16
|
|
17
17
|
spec.metadata["homepage_uri"] = spec.homepage
|
18
18
|
spec.metadata["source_code_uri"] = "https://github.com/umbrellio/ci_helper"
|
@@ -4,11 +4,12 @@ module CIHelper
|
|
4
4
|
module Commands
|
5
5
|
class RunSpecs < BaseCommand
|
6
6
|
def call
|
7
|
-
|
7
|
+
files_to_run = job_files
|
8
|
+
return if files_to_run.empty?
|
8
9
|
|
9
10
|
create_and_migrate_database! if with_database?
|
10
11
|
create_and_migrate_clickhouse_database! if with_clickhouse?
|
11
|
-
execute("bundle exec rspec #{Shellwords.join(
|
12
|
+
execute("bundle exec rspec #{Shellwords.join(files_to_run)}")
|
12
13
|
return 0 unless split_resultset?
|
13
14
|
|
14
15
|
execute("mv coverage/.resultset.json coverage/resultset.#{job_index}.json")
|
@@ -22,13 +23,35 @@ module CIHelper
|
|
22
23
|
|
23
24
|
def job_files
|
24
25
|
all_files = path.glob("spec/**/*_spec.rb")
|
26
|
+
|
27
|
+
heavy_files = []
|
28
|
+
std_files = []
|
29
|
+
|
30
|
+
all_files.each do |file|
|
31
|
+
relative_path = file.relative_path_from(path).to_s
|
32
|
+
if heavy_specs_paths.any? { |pattern| File.fnmatch?(pattern, relative_path) }
|
33
|
+
heavy_files << file
|
34
|
+
else
|
35
|
+
std_files << file
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
25
39
|
sorted_files =
|
26
|
-
|
27
|
-
sorted_files.reverse.select.with_index do |_file, index|
|
40
|
+
std_files.map { |x| [x.size, x.relative_path_from(path).to_s] }.sort.map(&:last)
|
41
|
+
(sorted_files + heavy_files).reverse.select.with_index do |_file, index|
|
28
42
|
(index % job_count) == (job_index - 1)
|
29
43
|
end
|
30
44
|
end
|
31
45
|
|
46
|
+
def heavy_specs_paths
|
47
|
+
@heavy_specs_paths ||=
|
48
|
+
begin
|
49
|
+
File.readlines("spec/heavy_specs.yml", chomp: true)
|
50
|
+
rescue
|
51
|
+
[]
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
32
55
|
def job_index
|
33
56
|
@job_index ||= options[:node_index]&.to_i || 1
|
34
57
|
end
|
data/lib/ci_helper/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ci-helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JustAnotherDude
|
8
|
-
autorequire:
|
9
8
|
bindir: exe
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: colorize
|
@@ -97,7 +96,6 @@ licenses:
|
|
97
96
|
metadata:
|
98
97
|
homepage_uri: https://github.com/umbrellio/ci_helper
|
99
98
|
source_code_uri: https://github.com/umbrellio/ci_helper
|
100
|
-
post_install_message:
|
101
99
|
rdoc_options: []
|
102
100
|
require_paths:
|
103
101
|
- lib
|
@@ -105,15 +103,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
105
103
|
requirements:
|
106
104
|
- - ">="
|
107
105
|
- !ruby/object:Gem::Version
|
108
|
-
version: 2.
|
106
|
+
version: 3.2.0
|
109
107
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
110
108
|
requirements:
|
111
109
|
- - ">="
|
112
110
|
- !ruby/object:Gem::Version
|
113
111
|
version: '0'
|
114
112
|
requirements: []
|
115
|
-
rubygems_version: 3.
|
116
|
-
signing_key:
|
113
|
+
rubygems_version: 3.7.2
|
117
114
|
specification_version: 4
|
118
115
|
summary: Continuous Integration helpers for Ruby
|
119
116
|
test_files: []
|