Skip to content

Commit

Permalink
Merge pull request #227 from eduardoj/fix/ci
Browse files Browse the repository at this point in the history
Fix and upate the CI
  • Loading branch information
hennevogel authored May 28, 2024
2 parents be69214 + c18ff3e commit 52f6d70
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ jobs:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0
ruby-version: 3.1
bundler-cache: true
- run: bundle exec rake rubocop
4 changes: 2 additions & 2 deletions .github/workflows/spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby: [ '3.0', '3.1', '3.2', 'head' ]
rails: [ 'gemfiles/Gemfile.rails-6.0.x', 'gemfiles/Gemfile.rails-6.1.x', 'gemfiles/Gemfile.rails-7.0.x']
ruby: [ '3.1', '3.2', '3.3', 'head' ]
rails: [ 'gemfiles/Gemfile.rails-6.1.x', 'gemfiles/Gemfile.rails-7.0.x', 'gemfiles/Gemfile.rails-7.1.x']
exclude: []
continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'debug' }}
env:
Expand Down
6 changes: 3 additions & 3 deletions gemfiles/Gemfile.rails-6.0.x → gemfiles/Gemfile.rails-7.1.x
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
source "https://rubygems.org"

gem 'actionpack', '~> 6.0.0'
gem 'activesupport', '~> 6.0.0'
gem 'activemodel', '~> 6.0.0'
gem 'actionpack', '~> 7.1.0'
gem 'activesupport', '~> 7.1.0'
gem 'activemodel', '~> 7.1.0'
gem 'sqlite3', '~> 1.4'
gem 'rspec-rails'

Expand Down
35 changes: 1 addition & 34 deletions spec/requests/active_record_sql_metrics_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
end

it "writes metric" do
skip("https://github.com/rails/rails/issues/30586") unless payload_names_fixed_in_rails?

get "/metrics"

expect_metric(
Expand All @@ -29,28 +27,7 @@
additional_field: :value,
request_id: :request_id,
value: be_between(1, 500),
sql: "INSERT INTO \"metrics\" (\"name\", \"created_at\", \"updated_at\") VALUES (xxx)"
)
)
end

it "writes metric" do
skip("https://github.com/rails/rails/issues/30586") if payload_names_fixed_in_rails?

get "/metrics"

expect_metric(
tags: a_hash_including(
hook: "sql",
name: "SQL",
class_name: "SQL",
operation: "INSERT"
),
fields: a_hash_including(
additional_field: :value,
request_id: :request_id,
value: be_between(1, 500),
sql: "INSERT INTO \"metrics\" (\"name\", \"created_at\", \"updated_at\") VALUES (xxx)"
sql: /^INSERT INTO "metrics" \("name", "created_at", "updated_at"\) VALUES \(xxx\)( RETURNING "id")?$/
)
)
end
Expand Down Expand Up @@ -80,14 +57,4 @@
)
)
end

def payload_names_fixed_in_rails?
Rails::VERSION::MAJOR > 5 ||
rails_after_5_1?
end

def rails_after_5_1?
Rails::VERSION::MAJOR == 5 &&
Rails::VERSION::MINOR > 1
end
end

0 comments on commit 52f6d70

Please sign in to comment.