diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3440743a..26d2c307 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -88,4 +88,16 @@ jobs: done cat ${{ github.workspace }}/setup.sql | cockroach sql --insecure - name: Test - run: bundle exec rake test TESTOPTS='--profile=5' + run: AR_LOG=summary bundle exec rake test TESTOPTS='--profile=5 --verbose' + - name: Upload queries file + uses: actions/upload-artifact@v3 + if: always() + with: + name: query_time.json + path: tmp/query_time.json + - name: Upload stackprof dump + uses: actions/upload-artifact@v3 + if: always() + with: + name: stackprof.dump + path: tmp/stackprof.dump diff --git a/Gemfile b/Gemfile index d6a46056..19cfb0d4 100644 --- a/Gemfile +++ b/Gemfile @@ -58,6 +58,8 @@ group :development, :test do gem "minitest-github_action_reporter", github: "BuonOmo/minitest-github_action_reporter", require: "minitest/github_action_reporter_plugin" gem "ostruct", "~> 0.6" + gem "stackprof" + # Gems used for tests meta-programming. gem "parser" diff --git a/test/cases/helper_cockroachdb.rb b/test/cases/helper_cockroachdb.rb index 04d7321e..7da01e61 100644 --- a/test/cases/helper_cockroachdb.rb +++ b/test/cases/helper_cockroachdb.rb @@ -222,3 +222,7 @@ def header(stream) class BaseCompatibilityTest < ActiveRecord::TestCase self.use_transactional_tests = false end + +require "stackprof" +StackProf.start(mode: :wall, interval: 1000) +Minitest.after_run { StackProf.stop; StackProf.results("tmp/stackprof.dump") }