A platform for community discussion. Free, open, simple.
DEV: Only retry and log flaky tests on the main branch (#24889)
Alan Guo Xiang Tan2a1952d9bae9
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.ymlindex 8f5cff61ba2..79935f97165 100644--- a/.github/workflows/tests.yml+++ b/.github/workflows/tests.yml@@ -36,6 +36,7 @@ jobs:CAPYBARA_DEFAULT_MAX_WAIT_TIME: 10MINIO_RUNNER_LOG_LEVEL: DEBUGEMBER_VERSION: ${{ (matrix.updated_ember && '5') || '3' }}+ DISCOURSE_TURBO_RSPEC_RETRY_AND_LOG_FLAKY_TESTS: ${{ (matrix.build_type == 'system' || matrix.build_type == 'backend') && github.ref_name == 'main' }}strategy:fail-fast: false@@ -218,11 +219,11 @@ jobs:- name: Core RSpecif: matrix.build_type == 'backend' && matrix.target == 'core'- run: bin/turbo_rspec --use-runtime-info --verbose --format documentation --retry-and-log-flaky-tests+ run: bin/turbo_rspec --use-runtime-info --verbose --format documentation- name: Plugin RSpecif: matrix.build_type == 'backend' && matrix.target == 'plugins'- run: bin/rake plugin:turbo_spec['*','--verbose --format documentation --use-runtime-info --retry-and-log-flaky-tests']+ run: bin/rake plugin:turbo_spec['*','--verbose --format documentation --use-runtime-info']- name: Plugin QUnitif: matrix.build_type == 'frontend' && matrix.target == 'plugins'@@ -250,25 +251,25 @@ jobs:- name: Core System Testsif: matrix.build_type == 'system' && matrix.target == 'core'- 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 --retry-and-log-flaky-tests 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 Testsif: matrix.build_type == 'system' && matrix.target == 'plugins'run: |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 --format documentation --retry-and-log-flaky-tests 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/systemshell: bashtimeout-minutes: 30- name: Chat System Testsif: matrix.build_type == 'system' && matrix.target == 'chat'- 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 --retry-and-log-flaky-tests 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/systemtimeout-minutes: 30- name: Theme System Testsif: matrix.build_type == 'system' && matrix.target == 'themes'run: |- RAILS_ENABLE_TEST_LOG=1 RAILS_TEST_LOG_LEVEL=error PARALLEL_TEST_PROCESSORS=4 bin/turbo_rspec --profile=50 --verbose --format documentation --retry-and-log-flaky-tests 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/systemshell: bashtimeout-minutes: 30diff --git a/bin/turbo_rspec b/bin/turbo_rspecindex 910d77aec0c..348e17ecf5c 100755--- a/bin/turbo_rspec+++ b/bin/turbo_rspec@@ -16,7 +16,7 @@ profile_print_slowest_examples_count = 10use_runtime_info = nilenable_system_tests = nildisable_system_tests = nil-retry_and_log_flaky_tests = false+retry_and_log_flaky_tests = !!ENV["DISCOURSE_TURBO_RSPEC_RETRY_AND_LOG_FLAKY_TESTS"]OptionParser.new do |opts|