[CI] Upload log after test run

Should make it easier to understand why random failures are happening.
Remove the manual logging in the application controller. Just look in your logs instead.

This also reduces the log level for tests.
Log files are now 700KB instead of 28MB per run.
This commit is contained in:
Earlopain 2023-02-26 15:53:26 +01:00
parent 49275af9b0
commit 7fdb7368db
No known key found for this signature in database
GPG Key ID: 6CFB948E15246897
3 changed files with 8 additions and 7 deletions

View File

@ -53,3 +53,10 @@ jobs:
- name: Run Tests
run: $DOCKER_RUN tests
- name: Upload Test Results
uses: actions/upload-artifact@v3
if: always()
with:
name: test-results
path: log/test.log

View File

@ -52,13 +52,6 @@ class ApplicationController < ActionController::Base
# If InvalidAuthenticityToken was raised, CurrentUser isn't set so we have to do it here manually.
CurrentUser.user ||= User.anonymous
if Rails.env.test? && ENV["DEBUG"]
puts "---"
STDERR.puts("#{exception.class} exception thrown: #{exception.message}")
exception.backtrace.each {|x| STDERR.puts(x)}
puts "---"
end
case exception
when ProcessingError
render_expected_error(400, exception)

View File

@ -15,6 +15,7 @@ Rails.application.configure do
# this probably isn't necessary. It's a good idea to do in a continuous integration
# system, or in some way before deploying your code.
config.eager_load = ENV["CI"].present?
config.log_level = :info
# Configure public file server for tests with Cache-Control for performance.
config.public_file_server.enabled = true