Skip to content

Commit 52f6d70

Browse files
authored
Merge pull request #227 from eduardoj/fix/ci
Fix and upate the CI
2 parents be69214 + c18ff3e commit 52f6d70

File tree

4 files changed

+7
-40
lines changed

4 files changed

+7
-40
lines changed

.github/workflows/rubocop.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ jobs:
1313
- uses: actions/checkout@v3
1414
- uses: ruby/setup-ruby@v1
1515
with:
16-
ruby-version: 3.0
16+
ruby-version: 3.1
1717
bundler-cache: true
1818
- run: bundle exec rake rubocop

.github/workflows/spec.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
ruby: [ '3.0', '3.1', '3.2', 'head' ]
15-
rails: [ 'gemfiles/Gemfile.rails-6.0.x', 'gemfiles/Gemfile.rails-6.1.x', 'gemfiles/Gemfile.rails-7.0.x']
14+
ruby: [ '3.1', '3.2', '3.3', 'head' ]
15+
rails: [ 'gemfiles/Gemfile.rails-6.1.x', 'gemfiles/Gemfile.rails-7.0.x', 'gemfiles/Gemfile.rails-7.1.x']
1616
exclude: []
1717
continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'debug' }}
1818
env:

gemfiles/Gemfile.rails-6.0.x renamed to gemfiles/Gemfile.rails-7.1.x

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
source "https://rubygems.org"
22

3-
gem 'actionpack', '~> 6.0.0'
4-
gem 'activesupport', '~> 6.0.0'
5-
gem 'activemodel', '~> 6.0.0'
3+
gem 'actionpack', '~> 7.1.0'
4+
gem 'activesupport', '~> 7.1.0'
5+
gem 'activemodel', '~> 7.1.0'
66
gem 'sqlite3', '~> 1.4'
77
gem 'rspec-rails'
88

spec/requests/active_record_sql_metrics_spec.rb

+1-34
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
end
1515

1616
it "writes metric" do
17-
skip("https://github.com/rails/rails/issues/30586") unless payload_names_fixed_in_rails?
18-
1917
get "/metrics"
2018

2119
expect_metric(
@@ -29,28 +27,7 @@
2927
additional_field: :value,
3028
request_id: :request_id,
3129
value: be_between(1, 500),
32-
sql: "INSERT INTO \"metrics\" (\"name\", \"created_at\", \"updated_at\") VALUES (xxx)"
33-
)
34-
)
35-
end
36-
37-
it "writes metric" do
38-
skip("https://github.com/rails/rails/issues/30586") if payload_names_fixed_in_rails?
39-
40-
get "/metrics"
41-
42-
expect_metric(
43-
tags: a_hash_including(
44-
hook: "sql",
45-
name: "SQL",
46-
class_name: "SQL",
47-
operation: "INSERT"
48-
),
49-
fields: a_hash_including(
50-
additional_field: :value,
51-
request_id: :request_id,
52-
value: be_between(1, 500),
53-
sql: "INSERT INTO \"metrics\" (\"name\", \"created_at\", \"updated_at\") VALUES (xxx)"
30+
sql: /^INSERT INTO "metrics" \("name", "created_at", "updated_at"\) VALUES \(xxx\)( RETURNING "id")?$/
5431
)
5532
)
5633
end
@@ -80,14 +57,4 @@
8057
)
8158
)
8259
end
83-
84-
def payload_names_fixed_in_rails?
85-
Rails::VERSION::MAJOR > 5 ||
86-
rails_after_5_1?
87-
end
88-
89-
def rails_after_5_1?
90-
Rails::VERSION::MAJOR == 5 &&
91-
Rails::VERSION::MINOR > 1
92-
end
9360
end

0 commit comments

Comments
 (0)