Skip to content

A platform for community discussion. Free, open, simple.

DEV: Fix incorrect `github.ref` value in tests workflow (#28902)

Alan Guo Xiang Tan9a4f71353d8c
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 50b4f250244..10e4b9a2425 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -29,7 +29,7 @@ jobs:
build:
if: github.event_name == 'pull_request' || github.repository != 'discourse/discourse-private-mirror'
name: ${{ matrix.target }} ${{ matrix.build_type }} # Update fetch-job-id step if changing this
- runs-on: ${{ (github.ref == 'refs/main/head') && 'debian-12' || 'ubuntu-22.04-8core' }}
+ runs-on: ${{ ((github.ref == 'refs/heads/main') && 'debian-12') || 'ubuntu-22.04-8core' }}
container: discourse/discourse_test:slim${{ (matrix.build_type == 'frontend' || matrix.build_type == 'system') && '-browsers' || '' }}
timeout-minutes: 20
@@ -41,7 +41,7 @@ jobs:
USES_PARALLEL_DATABASES: ${{ matrix.build_type == 'backend' || matrix.build_type == 'system' }}
CAPYBARA_DEFAULT_MAX_WAIT_TIME: 10
MINIO_RUNNER_LOG_LEVEL: DEBUG
- DISCOURSE_TURBO_RSPEC_RETRY_AND_LOG_FLAKY_TESTS: ${{ (matrix.build_type == 'system' || matrix.build_type == 'backend') && github.ref == 'refs/main/head' }}
+ DISCOURSE_TURBO_RSPEC_RETRY_AND_LOG_FLAKY_TESTS: ${{ (matrix.build_type == 'system' || matrix.build_type == 'backend') && github.ref == 'refs/heads/main' && '1' }}
CHEAP_SOURCE_MAPS: "1"
TESTEM_DEFAULT_BROWSER: Chrome
@@ -358,7 +358,7 @@ jobs:
core_frontend_tests:
if: github.event_name == 'pull_request' || github.repository != 'discourse/discourse-private-mirror'
name: core frontend (${{ matrix.browser }})
- runs-on: ${{ (github.ref == 'refs/main/head' ) && 'debian-12' || 'ubuntu-22.04-8core' }}
+ runs-on: ${{ ((github.ref == 'refs/heads/main') && 'debian-12') || 'ubuntu-22.04-8core' }}
container:
image: discourse/discourse_test:slim-browsers
options: --user discourse
diff --git a/bin/turbo_rspec b/bin/turbo_rspec
index 348e17ecf5c..5e3ec255963 100755
--- a/bin/turbo_rspec
+++ b/bin/turbo_rspec
@@ -16,7 +16,7 @@ profile_print_slowest_examples_count = 10
use_runtime_info = nil
enable_system_tests = nil
disable_system_tests = nil
-retry_and_log_flaky_tests = !!ENV["DISCOURSE_TURBO_RSPEC_RETRY_AND_LOG_FLAKY_TESTS"]
+retry_and_log_flaky_tests = ENV["DISCOURSE_TURBO_RSPEC_RETRY_AND_LOG_FLAKY_TESTS"].to_s == "1"
OptionParser
.new do |opts|