ci-helper 0.6.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c65325f8b34b50a47de3b66dd16aee7b9e91d4cdd0be32ec258c88f8a0e105e7
4
- data.tar.gz: 99c2668bcef68f533f9c96a716fca23f1ed3e82f0abb582c70187c61033ee48a
3
+ metadata.gz: 6752c279e742404a6b104c4d4e2bccfaf4c18e17cfb0c6693ce1ddb0ce2b58e1
4
+ data.tar.gz: 4e9960ccc6a0f0bd7b1ecf65a4c6df063cf579cdc71338dddb90248065368332
5
5
  SHA512:
6
- metadata.gz: 23217662314854d1ac37e90494fb21e3f8d1fbfe7dd4c9b7b1166d918d00d1e6bbf2b624c95591a8a8e200a593620a56c5f5f563c0a614ea740073694d2451a5
7
- data.tar.gz: 48a8b8bec14dbca6b5819ab06c0ebeaba2066755c804163e387e084668c22ba17f49311044dca51b62fe15873c2ebcf314ae8b8d6ed2c86c4c2abb7534277a84
6
+ metadata.gz: 3d8da6805297e53be7955d7219289dbece6f2decacdf760b81061e5745c4066a458b8b23ffa64cf06691ac270b00d58259941523e39ed919d056acc28aff0a85
7
+ data.tar.gz: 97b48c63728b3ef1c3a3457a1b5c90e4f2954d250783db38eed9ae6414aeb177cacfca9038d9d46226f6c307f0439a608c38e9bee83ec5999f93d39ba8a2a141
@@ -24,8 +24,6 @@ jobs:
24
24
  run: bundle exec ci-helper CheckSpecSuffixes --extra-paths spec/*.rb --ignored-paths spec/*_helper.rb
25
25
  - name: Run specs
26
26
  run: bundle exec ci-helper RunSpecs
27
- - name: Audit
28
- run: bundle exec ci-helper BundlerAudit
29
27
  - name: Coveralls
30
28
  uses: coverallsapp/github-action@master
31
29
  with:
@@ -39,7 +37,7 @@ jobs:
39
37
  strategy:
40
38
  fail-fast: false
41
39
  matrix:
42
- ruby: ["2.7", "3.0", "3.1"]
40
+ ruby: ["3.2", "3.3", "3.4"]
43
41
 
44
42
  steps:
45
43
  - uses: actions/checkout@v4
data/.rubocop.yml CHANGED
@@ -3,7 +3,7 @@ inherit_gem:
3
3
 
4
4
  AllCops:
5
5
  DisplayCopNames: true
6
- TargetRubyVersion: 2.7
6
+ TargetRubyVersion: 3.2
7
7
 
8
8
  Naming/MethodParameterName:
9
9
  AllowedNames: ["x", "y", "z"]
data/Gemfile CHANGED
@@ -4,8 +4,10 @@ source "https://rubygems.org"
4
4
 
5
5
  gemspec
6
6
 
7
+ gem "benchmark"
7
8
  gem "bundler"
8
9
  gem "bundler-audit"
10
+ gem "ostruct"
9
11
  gem "pry"
10
12
  gem "rake"
11
13
  gem "rspec"
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ci-helper (0.6.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-23
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.4.21
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.7.0")
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,10 +4,12 @@ module CIHelper
4
4
  module Commands
5
5
  class RunSpecs < BaseCommand
6
6
  def call
7
- return if job_files.empty?
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
- execute("bundle exec rspec #{Shellwords.join(job_files)}")
11
+ create_and_migrate_clickhouse_database! if with_clickhouse?
12
+ execute("bundle exec rspec #{Shellwords.join(files_to_run)}")
11
13
  return 0 unless split_resultset?
12
14
 
13
15
  execute("mv coverage/.resultset.json coverage/resultset.#{job_index}.json")
@@ -21,13 +23,35 @@ module CIHelper
21
23
 
22
24
  def job_files
23
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
+
24
39
  sorted_files =
25
- all_files.map { |x| [x.size, x.relative_path_from(path).to_s] }.sort.map(&:last)
26
- 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|
27
42
  (index % job_count) == (job_index - 1)
28
43
  end
29
44
  end
30
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
+
31
55
  def job_index
32
56
  @job_index ||= options[:node_index]&.to_i || 1
33
57
  end
@@ -40,6 +64,10 @@ module CIHelper
40
64
  boolean_option(:with_database)
41
65
  end
42
66
 
67
+ def with_clickhouse?
68
+ boolean_option(:with_clickhouse)
69
+ end
70
+
43
71
  def split_resultset?
44
72
  boolean_option(:split_resultset)
45
73
  end
@@ -50,6 +50,10 @@ module CIHelper
50
50
  execute_with_env("bundle exec rake db:drop db:create db:migrate")
51
51
  end
52
52
 
53
+ def create_and_migrate_clickhouse_database!
54
+ execute_with_env("bundle exec rake ch:create ch:migrate")
55
+ end
56
+
53
57
  def fail!(message)
54
58
  raise Error, message
55
59
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CIHelper
4
- VERSION = "0.6.0"
4
+ VERSION = "0.8.0"
5
5
  end
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.6.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: 2023-12-11 00:00:00.000000000 Z
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.7.0
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.4.21
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: []