Skip to content

Commit bd82917

Browse files
committed
Improve elasticsearch handling in rspec job
1 parent 33b7ee2 commit bd82917

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

.github/workflows/rubyonrails.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
RAILS_ENV: test
2525
DATABASE_URL: "postgis://rails:password@localhost:5432/rails_test"
2626
ES_HOST: "http://localhost"
27+
ELASTICSEARCH_URL: "http://localhost:9200"
2728
RAILS_VERSION: ${{ matrix.rails }}
2829

2930
services:
@@ -80,6 +81,12 @@ jobs:
8081
bundle exec rake -f spec/dummy/Rakefile db:schema:load
8182
continue-on-error: ${{ matrix.allowed_failure }}
8283

84+
- name: Wait for Elasticsearch
85+
if: (matrix.rails == '7.1.5.1') || steps.update.outcome == 'success'
86+
run: |
87+
echo "Waiting for Elasticsearch to be healthy..."
88+
curl -s "http://localhost:9200/_cluster/health?wait_for_status=yellow&timeout=60s" || (echo "Elasticsearch not healthy" && exit 1)
89+
8390
- name: Run RSpec
8491
if: (matrix.rails == '7.1.5.1') || steps.update.outcome == 'success'
8592
env:

0 commit comments

Comments
 (0)