Skip to content

Commit 4f1bb80

Browse files
author
Janne Rönkkö
committed
Single verifier
1 parent b9d3adb commit 4f1bb80

File tree

1 file changed

+75
-100
lines changed

1 file changed

+75
-100
lines changed

.github/workflows/shared-run-e2e.yml

Lines changed: 75 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -303,114 +303,89 @@ jobs:
303303
docker logs mssqltestdb
304304
shell: bash
305305

306-
- name: Verify that UI is up and running standalone
307-
uses: HSLdevcom/jore4-tools/github-actions/healthcheck@healthcheck-v1
308-
with:
309-
command: "curl --fail http://localhost:3302 --output /dev/null --silent"
310-
311-
- name: Verify that UI is up and running through proxy
312-
uses: HSLdevcom/jore4-tools/github-actions/healthcheck@healthcheck-v1
306+
- name: Setup Python
307+
uses: actions/setup-python@v6
313308
with:
314-
command: "curl --fail http://localhost:3300 --output /dev/null --silent"
309+
python-version: '3.13'
315310

316-
- name: Verify that hasura is up and running standalone
317-
uses: HSLdevcom/jore4-tools/github-actions/healthcheck@healthcheck-v1
318-
with:
319-
command: "curl --fail http://localhost:3201/healthz --output /dev/null --silent"
320-
321-
- name: Verify that hasura is up and running through proxy
322-
uses: HSLdevcom/jore4-tools/github-actions/healthcheck@healthcheck-v1
323-
with:
324-
command: "curl --fail http://localhost:3300/api/graphql/healthz --output
325-
/dev/null --silent"
326-
327-
- name: Verify that jore3 importer is up and running standalone
328-
if: ${{ inputs.start_jore3_importer == 'true' }}
329-
uses: HSLdevcom/jore4-tools/github-actions/healthcheck@healthcheck-v1
330-
with:
331-
command:
332-
"curl --fail http://localhost:3004/actuator/health --output /dev/null
333-
--silent"
311+
- name: Setup Development Environment
312+
run: |
313+
python \
314+
<<EOF
315+
import asyncio
316+
import sys
317+
318+
319+
async def main():
320+
for i in range(0, 60):
321+
print(f"Try #{i + 1}")
322+
323+
# Create a list of tasks for each command
324+
tasks = [
325+
check_service_status(name, url)
326+
for name, url in (
327+
("UI", "http://localhost:3302"),
328+
("UI (through proxy)", "http://localhost:3300"),
329+
("Hasura", "http://localhost:3201/healthz"),
330+
("Hasura (proxy)", "http://localhost:3300/api/graphql/healthz"),
331+
("Auth backend", "http://localhost:3200/actuator/health"),
332+
("Auth backend (database)", "http://localhost:3200/public/v1/login"),
333+
("Auth backend (proxy)", "http://localhost:3300/api/auth/actuator/health"),
334+
("mbtiles server", "http://localhost:3203/services"),
335+
("mbtiles server (proxy)", "http://localhost:3300/api/mbtiles/services"),
336+
# JORE3 IMPORTER PUUTTUU
337+
("map matching", "http://localhost:3005/actuator/health"),
338+
("map matching (proxy)", "http://localhost:3300/api/mapmatching/actuator/health"),
339+
("hastus", "http://localhost:3008/actuator/health"),
340+
("hastus (proxy)", "http://localhost:3300/api/hastus/actuator/health"),
341+
("timetables-api", "http://localhost:3009/actuator/health"),
342+
("tiamat", "http://localhost:3010/actuator/health"),
343+
)
344+
]
345+
346+
# Run all tasks concurrently and get their results
347+
results = await asyncio.gather(*tasks)
348+
349+
if all(results):
350+
break
351+
352+
await asyncio.sleep(1)
353+
354+
355+
if all(results):
356+
print("\n✅ All commands succeeded. Exiting.")
357+
else:
358+
print("Fail")
359+
sys.exit(1)
360+
361+
async def check_service_status(name, url):
362+
process = await asyncio.create_subprocess_exec(
363+
"curl",
364+
"--fail",
365+
"--silent",
366+
url,
367+
stdout=asyncio.subprocess.PIPE,
368+
stderr=asyncio.subprocess.PIPE
369+
)
370+
371+
await process.wait()
372+
373+
result = process.returncode == 0
374+
375+
print(f"{url}: {result}")
376+
377+
return result
378+
379+
380+
if __name__ == "__main__":
381+
asyncio.run(main())
382+
EOF
334383
335384
- name: Verify that cypress test container is up and running standalone
336385
uses: HSLdevcom/jore4-tools/github-actions/healthcheck@healthcheck-v1
337386
with:
338387
command: "docker exec cypress yarn cypress --version"
339388

340-
- name: Verify that timetables-api is up and running standalone
341-
uses: HSLdevcom/jore4-tools/github-actions/healthcheck@healthcheck-v1
342-
with:
343-
command: "curl --fail http://localhost:3009/actuator/health --output
344-
/dev/null --silent"
345-
346-
- name: Verify that mbtiles server is up and running standalone
347-
uses: HSLdevcom/jore4-tools/github-actions/healthcheck@healthcheck-v1
348-
with:
349-
command: "curl --fail http://localhost:3203/services --output /dev/null
350-
--silent"
351-
352-
- name: Verify that mbtiles server is up and running through proxy
353-
uses: HSLdevcom/jore4-tools/github-actions/healthcheck@healthcheck-v1
354-
with:
355-
command:
356-
"curl --fail http://localhost:3300/api/mbtiles/services --output
357-
/dev/null --silent"
358-
359-
- name: Verify that map matching server is up and running standalone
360-
uses: HSLdevcom/jore4-tools/github-actions/healthcheck@healthcheck-v1
361-
with:
362-
command:
363-
"curl --fail http://localhost:3005/actuator/health --output /dev/null
364-
--silent"
365-
366-
- name: Verify that map matching server is up and running through proxy
367-
uses: HSLdevcom/jore4-tools/github-actions/healthcheck@healthcheck-v1
368-
with:
369-
command:
370-
"curl --fail http://localhost:3300/api/mapmatching/actuator/health
371-
--output /dev/null --silent"
372-
373-
- name: Verify that hastus importer is up and running standalone
374-
uses: HSLdevcom/jore4-tools/github-actions/healthcheck@healthcheck-v1
375-
with:
376-
command:
377-
"curl --fail http://localhost:3008/actuator/health --output /dev/null
378-
--silent"
379-
380-
- name: Verify that hastus importer is up and running through proxy
381-
uses: HSLdevcom/jore4-tools/github-actions/healthcheck@healthcheck-v1
382-
with:
383-
command:
384-
"curl --fail http://localhost:3300/api/hastus/actuator/health --output
385-
/dev/null --silent"
386-
387-
- name: Verify that auth backend is up and running standalone
388-
uses: HSLdevcom/jore4-tools/github-actions/healthcheck@healthcheck-v1
389-
with:
390-
command:
391-
"curl --fail http://localhost:3200/actuator/health --output /dev/null
392-
--silent"
393-
394-
- name: Verify that auth backend has access to database
395-
uses: HSLdevcom/jore4-tools/github-actions/healthcheck@healthcheck-v1
396-
with:
397-
command:
398-
"curl --fail http://localhost:3200/public/v1/login --output /dev/null
399-
--silent"
400-
401-
- name: Verify that auth backend is up and running through proxy
402-
uses: HSLdevcom/jore4-tools/github-actions/healthcheck@healthcheck-v1
403-
with:
404-
command:
405-
"curl --fail http://localhost:3300/api/auth/actuator/health --output
406-
/dev/null --silent"
407-
408-
- name: Verify that tiamat is up and running standalone
409-
uses: HSLdevcom/jore4-tools/github-actions/healthcheck@healthcheck-v1
410-
with:
411-
command: "curl --fail http://localhost:3010/actuator/health --output
412-
/dev/null --silent"
413-
414389
- name: Reload Hasura metadata to re-establish connection to Tiamat
415390
# Hasura remote schema will break if it cannot establish connection on startup. Force reload after everything is running.
416391
env:

0 commit comments

Comments
 (0)