diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ee317c18..998422c8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -52,6 +52,7 @@ jobs: env: TARGET_DB: ${{ matrix.database }} BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile + RAILS_ENV: test steps: - name: Checkout code uses: actions/checkout@v4 @@ -68,3 +69,12 @@ jobs: bin/rails db:setup - name: Run tests run: bin/rails test + - name: Upload logs on failure + if: ${{ failure() }} + uses: actions/upload-artifact@v4 + with: + name: logs-${{ matrix.database }}-${{ matrix.gemfile }}-ruby${{ matrix.ruby-version }}-attempt${{ github.run_attempt }} + path: | + test/dummy/log/test.log + if-no-files-found: ignore + retention-days: 7 diff --git a/test/dummy/config/environments/test.rb b/test/dummy/config/environments/test.rb index a5a99232..4a07d140 100644 --- a/test/dummy/config/environments/test.rb +++ b/test/dummy/config/environments/test.rb @@ -59,4 +59,9 @@ config.solid_queue.logger = ActiveSupport::Logger.new(nil) config.solid_queue.shutdown_timeout = 2.seconds + + config.log_formatter = proc do |severity, timestamp, progname, msg| + ts = timestamp.getlocal.strftime("%H:%M:%S.%3N") + "#{ts} #{msg}\n" + end end