[P] Integrate MapView testing into CI pipeline
All checks were successful
All checks were successful
This commit was merged in pull request #39.
This commit is contained in:
@@ -49,12 +49,28 @@ jobs:
|
||||
working-directory: IoT-Systems
|
||||
run: docker-compose down -v --remove-orphans
|
||||
|
||||
mapview-test:
|
||||
name: MapView testing
|
||||
runs-on: host-arch-x86_64
|
||||
steps:
|
||||
- name: Clone repository
|
||||
run: git clone --revision ${{ gitea.sha }} --depth 1 ${{ gitea.server_url }}/${{ gitea.repository }}
|
||||
|
||||
- name: Build MapView testing container
|
||||
working-directory: IoT-Systems
|
||||
run: docker build -t local/mapview -f MapView/Dockerfile-test .
|
||||
|
||||
- name: Run MapView tests
|
||||
working-directory: IoT-Systems
|
||||
run: docker run --rm -it -v $PWD/MapView:/app:ro local/mapview
|
||||
|
||||
integration-smoke-test:
|
||||
name: Integration smoke testing
|
||||
runs-on: host-arch-x86_64
|
||||
needs:
|
||||
- hub-test
|
||||
- store-test
|
||||
- mapview-test
|
||||
steps:
|
||||
- name: Clone repository
|
||||
run: git clone --revision ${{ gitea.sha }} --depth 1 ${{ gitea.server_url }}/${{ gitea.repository }}
|
||||
|
||||
14
MapView/Dockerfile-test
Normal file
14
MapView/Dockerfile-test
Normal file
@@ -0,0 +1,14 @@
|
||||
# Use the official Python image as the base image
|
||||
FROM python:latest
|
||||
# Set the working directory inside the container
|
||||
WORKDIR /app
|
||||
# Copy the requirements.txt file and install dependencies
|
||||
COPY MapView/requirements.txt .
|
||||
RUN sed -i 's/==.*//' requirements.txt
|
||||
|
||||
RUN apt update && apt install -y libgl-dev libsdl1.2-dev
|
||||
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
RUN pip install --root-user-action ignore --no-cache-dir python-unittest kivy[base] pygame
|
||||
|
||||
CMD ["./test-entry.sh"]
|
||||
3
MapView/test-entry.sh
Executable file
3
MapView/test-entry.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
PYTHONPATH=$PWD python3 -m unittest tests.test_mp
|
||||
@@ -5,8 +5,8 @@ from unittest.mock import Mock
|
||||
sys.modules['lineMapLayer'] = Mock()
|
||||
sys.modules['config'] = Mock()
|
||||
|
||||
from MapView.main import get_lat_lon, MapViewApp
|
||||
from MapView.datasource import Datasource as DataSourceClass
|
||||
from main import get_lat_lon, MapViewApp
|
||||
from datasource import Datasource as DataSourceClass
|
||||
|
||||
|
||||
# -----------------------
|
||||
@@ -134,4 +134,4 @@ class TestMapLatLonToProcessedAgentData(unittest.TestCase):
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user