Skip to content

Commit b0c80b4

Browse files
committed
test
1 parent 0fe2427 commit b0c80b4

File tree

5 files changed

+23
-4
lines changed

5 files changed

+23
-4
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
runs-on: ubuntu-latest
3939
strategy:
4040
matrix:
41-
crdb: [v23.1.11]
41+
crdb: [v23.1.15]
4242
ruby: [head]
4343
name: Test (crdb=${{ matrix.crdb }} ruby=${{ matrix.ruby }})
4444
steps:
@@ -95,4 +95,11 @@ jobs:
9595
SET CLUSTER SETTING sql.defaults.experimental_temporary_tables.enabled = 'true';
9696
"
9797
- name: Test
98-
run: bundle exec rake test TESTOPTS='--profile=3'
98+
run: bundle exec rake test TESTOPTS='--profile=3 --stackprof --profile-setup'
99+
- name: Save timing artifacts
100+
uses: actions/upload-artifact@v4
101+
with:
102+
name: performance
103+
path: |
104+
sql.ljson
105+
stackprof-minitest-*.dump

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.2.1
1+
3.2.3

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ source "https://rubygems.org"
44

55
gemspec
66

7+
gem "minitest-stackprof"
78

89
module RailsTag
910
class << self

test/cases/helper_cockroachdb.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,3 +176,14 @@ def header(stream)
176176
end
177177

178178
ActiveRecord::SchemaDumper.prepend(NoHeaderExt)
179+
180+
181+
ActiveSupport::Notifications.subscribe 'sql.active_record' do |*args|
182+
event = ActiveSupport::Notifications::Event.new(*args)
183+
sql = event.payload[:sql]
184+
duration = event.duration # ms
185+
186+
File.open("sql.ljson", "a") do |f|
187+
f.puts JSON.dump({sql: sql, duration: duration})
188+
end
189+
end

test/support/rake_helpers.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ def all_test_files
3232

3333
cockroachdb_test_files = FileList['test/cases/**/*_test.rb']
3434

35-
FileList[COCKROACHDB_TEST_HELPER] + activerecord_test_files + cockroachdb_test_files
35+
(FileList[COCKROACHDB_TEST_HELPER] + activerecord_test_files.first(2) + cockroachdb_test_files.first(2))
3636
end
3737
end

0 commit comments

Comments
 (0)