diff --git a/.github/workflows/rubocop.yml b/.github/workflows/rubocop.yml index 8e99cae..717109b 100644 --- a/.github/workflows/rubocop.yml +++ b/.github/workflows/rubocop.yml @@ -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 diff --git a/.github/workflows/spec.yml b/.github/workflows/spec.yml index ee10825..1dfd6d4 100644 --- a/.github/workflows/spec.yml +++ b/.github/workflows/spec.yml @@ -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: diff --git a/gemfiles/Gemfile.rails-6.0.x b/gemfiles/Gemfile.rails-7.1.x similarity index 51% rename from gemfiles/Gemfile.rails-6.0.x rename to gemfiles/Gemfile.rails-7.1.x index f0549fd..d81176c 100644 --- a/gemfiles/Gemfile.rails-6.0.x +++ b/gemfiles/Gemfile.rails-7.1.x @@ -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' diff --git a/spec/requests/active_record_sql_metrics_spec.rb b/spec/requests/active_record_sql_metrics_spec.rb index 2ed0c4d..f9c2510 100644 --- a/spec/requests/active_record_sql_metrics_spec.rb +++ b/spec/requests/active_record_sql_metrics_spec.rb @@ -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( @@ -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 @@ -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