mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 07:53:49 +08:00
DEV: Restore RSpec 'documentation' output, but collapse in CI (#26485)
This reverts commit ef895f1c32ad406a37a10137eab38d75bc82bd38 and 57df0d526e2d131d80c878edee27c8b3a0fccfe4, but adds GitHub actions line grouping to the verbose output to reduce scrolling.
This commit is contained in:
12
.github/workflows/tests.yml
vendored
12
.github/workflows/tests.yml
vendored
@ -212,11 +212,11 @@ jobs:
|
|||||||
|
|
||||||
- name: Core RSpec
|
- name: Core RSpec
|
||||||
if: matrix.build_type == 'backend' && matrix.target == 'core'
|
if: matrix.build_type == 'backend' && matrix.target == 'core'
|
||||||
run: bin/turbo_rspec --use-runtime-info --verbose
|
run: bin/turbo_rspec --use-runtime-info --verbose --format documentation
|
||||||
|
|
||||||
- name: Plugin RSpec
|
- name: Plugin RSpec
|
||||||
if: matrix.build_type == 'backend' && matrix.target == 'plugins'
|
if: matrix.build_type == 'backend' && matrix.target == 'plugins'
|
||||||
run: bin/rake plugin:turbo_spec['*','--verbose --use-runtime-info']
|
run: bin/rake plugin:turbo_spec['*','--verbose --format documentation --use-runtime-info']
|
||||||
|
|
||||||
- name: Plugin QUnit
|
- name: Plugin QUnit
|
||||||
if: matrix.build_type == 'frontend' && matrix.target == 'plugins'
|
if: matrix.build_type == 'frontend' && matrix.target == 'plugins'
|
||||||
@ -246,7 +246,7 @@ jobs:
|
|||||||
if: matrix.build_type == 'system' && matrix.target == 'core'
|
if: matrix.build_type == 'system' && matrix.target == 'core'
|
||||||
env:
|
env:
|
||||||
CHECKOUT_TIMEOUT: 10
|
CHECKOUT_TIMEOUT: 10
|
||||||
run: RAILS_ENABLE_TEST_LOG=1 RAILS_TEST_LOG_LEVEL=error PARALLEL_TEST_PROCESSORS=4 bin/turbo_rspec --use-runtime-info --profile=50 --verbose spec/system
|
run: RAILS_ENABLE_TEST_LOG=1 RAILS_TEST_LOG_LEVEL=error PARALLEL_TEST_PROCESSORS=4 bin/turbo_rspec --use-runtime-info --profile=50 --verbose --format documentation spec/system
|
||||||
|
|
||||||
- name: Plugin System Tests
|
- name: Plugin System Tests
|
||||||
if: matrix.build_type == 'system' && matrix.target == 'plugins'
|
if: matrix.build_type == 'system' && matrix.target == 'plugins'
|
||||||
@ -254,7 +254,7 @@ jobs:
|
|||||||
CHECKOUT_TIMEOUT: 10
|
CHECKOUT_TIMEOUT: 10
|
||||||
run: |
|
run: |
|
||||||
GLOBIGNORE="plugins/chat/*";
|
GLOBIGNORE="plugins/chat/*";
|
||||||
LOAD_PLUGINS=1 RAILS_ENABLE_TEST_LOG=1 RAILS_TEST_LOG_LEVEL=error PARALLEL_TEST_PROCESSORS=4 bin/turbo_rspec --use-runtime-info --profile=50 --verbose plugins/*/spec/system
|
LOAD_PLUGINS=1 RAILS_ENABLE_TEST_LOG=1 RAILS_TEST_LOG_LEVEL=error PARALLEL_TEST_PROCESSORS=4 bin/turbo_rspec --use-runtime-info --profile=50 --verbose --format documentation plugins/*/spec/system
|
||||||
shell: bash
|
shell: bash
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
|
|
||||||
@ -262,7 +262,7 @@ jobs:
|
|||||||
if: matrix.build_type == 'system' && matrix.target == 'chat'
|
if: matrix.build_type == 'system' && matrix.target == 'chat'
|
||||||
env:
|
env:
|
||||||
CHECKOUT_TIMEOUT: 10
|
CHECKOUT_TIMEOUT: 10
|
||||||
run: LOAD_PLUGINS=1 RAILS_ENABLE_TEST_LOG=1 RAILS_TEST_LOG_LEVEL=error PARALLEL_TEST_PROCESSORS=4 bin/turbo_rspec --use-runtime-info --profile=50 --verbose plugins/chat/spec/system
|
run: LOAD_PLUGINS=1 RAILS_ENABLE_TEST_LOG=1 RAILS_TEST_LOG_LEVEL=error PARALLEL_TEST_PROCESSORS=4 bin/turbo_rspec --use-runtime-info --profile=50 --verbose --format documentation plugins/chat/spec/system
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
|
|
||||||
- name: Theme System Tests
|
- name: Theme System Tests
|
||||||
@ -270,7 +270,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
CHECKOUT_TIMEOUT: 10
|
CHECKOUT_TIMEOUT: 10
|
||||||
run: |
|
run: |
|
||||||
RAILS_ENABLE_TEST_LOG=1 RAILS_TEST_LOG_LEVEL=error PARALLEL_TEST_PROCESSORS=4 bin/turbo_rspec --profile=50 --verbose tmp/themes/*/spec/system
|
RAILS_ENABLE_TEST_LOG=1 RAILS_TEST_LOG_LEVEL=error PARALLEL_TEST_PROCESSORS=4 bin/turbo_rspec --profile=50 --verbose --format documentation tmp/themes/*/spec/system
|
||||||
shell: bash
|
shell: bash
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
|
|
||||||
|
@ -3,7 +3,22 @@
|
|||||||
module TurboTests
|
module TurboTests
|
||||||
# An RSpec formatter that prepends the process id to all messages
|
# An RSpec formatter that prepends the process id to all messages
|
||||||
class DocumentationFormatter < ::TurboTests::BaseFormatter
|
class DocumentationFormatter < ::TurboTests::BaseFormatter
|
||||||
RSpec::Core::Formatters.register(self, :example_failed, :example_passed, :example_pending)
|
RSpec::Core::Formatters.register(
|
||||||
|
self,
|
||||||
|
:example_failed,
|
||||||
|
:example_passed,
|
||||||
|
:example_pending,
|
||||||
|
:start,
|
||||||
|
:stop,
|
||||||
|
)
|
||||||
|
|
||||||
|
def start(*args)
|
||||||
|
output.puts "::group:: Verbose turbo_spec output" if ENV["GITHUB_ACTIONS"]
|
||||||
|
end
|
||||||
|
|
||||||
|
def stop(*args)
|
||||||
|
output.puts "::endgroup::" if ENV["GITHUB_ACTIONS"]
|
||||||
|
end
|
||||||
|
|
||||||
def example_passed(notification)
|
def example_passed(notification)
|
||||||
output.puts RSpec::Core::Formatters::ConsoleCodes.wrap(
|
output.puts RSpec::Core::Formatters::ConsoleCodes.wrap(
|
||||||
|
@ -48,6 +48,10 @@ module TurboTests
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def start
|
||||||
|
delegate_to_formatters(:start, RSpec::Core::Notifications::NullNotification)
|
||||||
|
end
|
||||||
|
|
||||||
def example_passed(example)
|
def example_passed(example)
|
||||||
delegate_to_formatters(:example_passed, example.notification)
|
delegate_to_formatters(:example_passed, example.notification)
|
||||||
|
|
||||||
@ -83,6 +87,8 @@ module TurboTests
|
|||||||
def finish
|
def finish
|
||||||
end_time = Time.now
|
end_time = Time.now
|
||||||
|
|
||||||
|
delegate_to_formatters(:stop, RSpec::Core::Notifications::NullNotification)
|
||||||
|
|
||||||
delegate_to_formatters(:start_dump, RSpec::Core::Notifications::NullNotification)
|
delegate_to_formatters(:start_dump, RSpec::Core::Notifications::NullNotification)
|
||||||
|
|
||||||
delegate_to_formatters(
|
delegate_to_formatters(
|
||||||
|
@ -89,6 +89,8 @@ module TurboTests
|
|||||||
start_regular_subprocess(tests, process_id + 1, **subprocess_opts)
|
start_regular_subprocess(tests, process_id + 1, **subprocess_opts)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@reporter.start
|
||||||
|
|
||||||
handle_messages
|
handle_messages
|
||||||
|
|
||||||
@reporter.finish
|
@reporter.finish
|
||||||
|
Reference in New Issue
Block a user