Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0b8d2eb18b | |||
| 2846130e4e | |||
| 30af132033 |
@@ -0,0 +1,16 @@
|
|||||||
|
name: Reset docker state
|
||||||
|
on: workflow_dispatch
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
reset:
|
||||||
|
runs-on: host-arch-x86_64
|
||||||
|
name: Reset docker state
|
||||||
|
steps:
|
||||||
|
- name: Stop all containers
|
||||||
|
run: docker stop $(docker ps -a | cut -d " " -f 1 | tail -n +2)
|
||||||
|
|
||||||
|
- name: Remove all containers
|
||||||
|
run: docker rm $(docker ps -a | cut -d " " -f 1 | tail -n +2)
|
||||||
|
|
||||||
|
- name: Remove extra volumes
|
||||||
|
run: docker volume rm road_vision_postgres_data road_vision_pgadmin-data
|
||||||
@@ -30,20 +30,20 @@ jobs:
|
|||||||
|
|
||||||
- name: Build Store testing container
|
- name: Build Store testing container
|
||||||
working-directory: IoT-Systems
|
working-directory: IoT-Systems
|
||||||
run: docker build -t local/hub/${{gitea.sha}} -f hub/Dockerfile-test .
|
run: docker build -t local/store/${{gitea.sha}} -f store/Dockerfile-test .
|
||||||
|
|
||||||
- name: Run Store tests
|
- name: Run Store tests
|
||||||
working-directory: IoT-Systems
|
working-directory: IoT-Systems
|
||||||
run: docker run --rm -it local/hub/${{gitea.sha}}
|
run: docker run --rm -it local/store/${{gitea.sha}}
|
||||||
|
|
||||||
- name: Clean up containers
|
- name: Clean up containers
|
||||||
if: ${{always()}}
|
if: ${{always()}}
|
||||||
run: docker image rm local/hub/${{gitea.sha}}
|
run: docker image rm local/store/${{gitea.sha}}
|
||||||
|
|
||||||
integration-smoke-test:
|
integration-smoke-test:
|
||||||
name: Integration smoke testing
|
name: Integration smoke testing
|
||||||
runs-on: host-arch-x86_64
|
runs-on: host-arch-x86_64
|
||||||
depends:
|
needs:
|
||||||
- hub-test
|
- hub-test
|
||||||
- store-test
|
- store-test
|
||||||
steps:
|
steps:
|
||||||
@@ -67,4 +67,5 @@ jobs:
|
|||||||
|
|
||||||
- name: Clean up
|
- name: Clean up
|
||||||
if: ${{always()}}
|
if: ${{always()}}
|
||||||
run: docker image rm local/hub/${{gitea.sha}}
|
working-directory: IoT-Systems
|
||||||
|
run: docker-compose down -v
|
||||||
|
|||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
python3 test/main_test.py
|
PYTHONPATH=$PWD python3 test/main_test.py
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
import ..main
|
from schemas import AccelerometerData, AgentData, GpsData, ProcessedAgentData
|
||||||
|
|
||||||
|
import main
|
||||||
|
|
||||||
def _test_ProcessedAgentData_to_td():
|
def _test_ProcessedAgentData_to_td():
|
||||||
processed_data_batch = [
|
processed_data_batch = [
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
import sys
|
||||||
|
|
||||||
|
print("Checking for dead containers...")
|
||||||
|
|
||||||
|
l = [i for i in sys.stdin.read().split("\n") if i]
|
||||||
|
header, statuses = l[0], l[1:]
|
||||||
|
|
||||||
|
status_index = header.find('STATUS')
|
||||||
|
name_index = header.find('NAMES')
|
||||||
|
|
||||||
|
exit_code = 0
|
||||||
|
|
||||||
|
for i in statuses:
|
||||||
|
if not i[status_index:].startswith("Up "):
|
||||||
|
service_name = i[name_index:]
|
||||||
|
print(f"Crash detected in {service_name}")
|
||||||
|
exit_code = 1
|
||||||
|
|
||||||
|
sys.exit(exit_code)
|
||||||
Reference in New Issue
Block a user