Skip to content

Commit 4177ea9

Browse files
committed
DEV: Add SKIP_DB_AND_REDIS bootability check to CI
1 parent d5b72a5 commit 4177ea9

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

.github/workflows/tests.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,21 @@ jobs:
244244
exit 1
245245
fi
246246
247+
- name: Check SKIP_DB_AND_REDIS bootability
248+
if: matrix.build_type == 'backend'
249+
env:
250+
LOAD_PLUGINS: ${{ (matrix.target == 'plugins') && '1' || '0' }}
251+
run: |
252+
if ! (SKIP_DB_AND_REDIS=1 DISCOURSE_DEV_DB="nonexist" bin/rails runner "puts 'booted successfully'"); then
253+
echo
254+
echo "---------------------------------------------"
255+
echo
256+
echo "::error::SKIP_DB_AND_REDIS boot failed. Make sure the database is not being accessed during the Rails boot process."
257+
echo "To reproduce locally, run \`SKIP_DB_AND_REDIS=1 DISCOURSE_DEV_DB='nonexist' bin/rails runner \"puts 'booted successfully'\"\`."
258+
echo
259+
exit 1
260+
fi
261+
247262
- name: Core RSpec
248263
if: matrix.build_type == 'backend' && matrix.target == 'core'
249264
run: bin/turbo_rspec --use-runtime-info --verbose --format=documentation --profile=50

0 commit comments

Comments
 (0)