Skip to content

Commit 12e84a4

Browse files
committed
ci(tests):added splunk health check
1 parent 21beee2 commit 12e84a4

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

.github/workflows/tests.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ jobs:
3838
--health-interval 30s
3939
--health-timeout 5s
4040
--health-retries 5
41+
--health-cmd "curl -f http://localhost:8000/en-US/account/login || exit 1"
4142
--name splunk
4243
ports:
4344
- 8000:8000
@@ -82,6 +83,20 @@ jobs:
8283
# cd test
8384
# rm -rf package-lock.json
8485
# npm install
86+
- name: Wait for Splunk Web UI to be fully ready
87+
run: |
88+
echo "Waiting for Splunk Web UI at http://localhost:8000/en-US/account/login"
89+
# Try for up to 60 * 5 = 300 seconds (5 minutes)
90+
for i in $(seq 1 60); do
91+
if curl -s -f http://localhost:8000/en-US/account/login; then
92+
echo "Splunk Web UI is ready!"
93+
exit 0
94+
fi
95+
echo "Splunk Web UI not ready yet, waiting 5 seconds... (Attempt $i/60)"
96+
sleep 5
97+
done
98+
echo "Error: Splunk Web UI did not become ready within 5 minutes."
99+
exit 1
85100
86101
- name: Cypress run
87102
uses: cypress-io/github-action@v6
@@ -92,7 +107,7 @@ jobs:
92107
DEBUG: '@cypress/github-action'
93108
ELECTRON_EXTRA_LAUNCH_ARGS: --disable-gpu
94109
with:
95-
start: npm run test
110+
# start: npm run test
96111
wait-on: 'http://localhost:8000'
97112
# No videos can be recorded w/ ff as per https://github.com/cypress-io/cypress/issues/18415
98113
# browser: firefox
@@ -110,6 +125,7 @@ jobs:
110125
path: |
111126
test/cypress/videos
112127
test/cypress/screenshots
128+
if-no-files-found: ignore
113129

114130
# Add a job in the page to visualize test result reports
115131
- name: JUnit Report

0 commit comments

Comments
 (0)