@@ -23,6 +23,8 @@ cleanup() {
2323 echo " CLEANUP"
2424 rm -rf tmp/cache/parallel*
2525
26+ # kill hocuspocus running in background:
27+ killall node || true
2628 if [ ! $exit_code -eq " 0" ]; then
2729 echo " ERROR: exit code $exit_code "
2830 tail -n 1000 $LOG_FILE
@@ -95,6 +97,24 @@ reset_dbs() {
9597 done
9698}
9799
100+ setup_hocuspocus () {
101+ if [ -d " vendor/hocuspocus" ]; then
102+ cd vendor/hocuspocus
103+ npm install --omit=dev
104+ cd -
105+ else
106+ echo ' Could not find Hocuspocus in vendor/hocuspocus!'
107+ fi
108+ }
109+
110+ start_hocuspocus () {
111+ if [ -d " vendor/hocuspocus" ]; then
112+ execute " cd vendor/hocuspocus && SECRET=secret12345 npm run start"
113+ else
114+ echo ' Could not find Hocuspocus in vendor/hocuspocus!'
115+ fi
116+ }
117+
98118backend_stuff () {
99119 # create test database "app" and dump schema because db/structure.sql is not checked in
100120 execute_quiet " time bundle exec rails db:create db:migrate db:schema:dump zeitwerk:check"
@@ -122,6 +142,7 @@ setup_tests() {
122142 run_background execute " JOBS=8 time npm install --quiet && npm prune --quiet && echo NPM DONE"
123143 wait_for_background
124144
145+ setup_hocuspocus
125146 run_background backend_stuff
126147 run_background frontend_stuff
127148 # pre-cache browsers and their drivers binaries
@@ -138,6 +159,7 @@ run_units() {
138159}
139160
140161run_features () {
162+ run_background start_hocuspocus
141163 reset_dbs
142164 execute " time bundle exec turbo_tests --verbose -n $JOBS --runtime-log spec/support/runtime-logs/turbo_runtime_features.log {,modules/*/}spec/features"
143165 cleanup
@@ -149,7 +171,7 @@ run_all() {
149171 cleanup
150172}
151173
152- export -f cleanup execute execute_quiet run_psql create_db_cluster reset_dbs setup_tests backend_stuff frontend_stuff run_units run_features run_all
174+ export -f cleanup execute execute_quiet run_psql create_db_cluster reset_dbs setup_tests setup_hocuspocus start_hocuspocus backend_stuff frontend_stuff run_units run_features run_all
153175
154176if [ " $1 " == " setup-tests" ]; then
155177 shift
0 commit comments