Compare commits
1 Commits
0a37d45eb6
...
a672f48f7c
| Author | SHA1 | Date | |
|---|---|---|---|
| a672f48f7c |
@@ -49,12 +49,32 @@ jobs:
|
|||||||
working-directory: IoT-Systems
|
working-directory: IoT-Systems
|
||||||
run: docker-compose down -v --remove-orphans
|
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/${{gitea.sha}} -f MapView/Dockerfile-test .
|
||||||
|
|
||||||
|
- name: Run MapView tests
|
||||||
|
working-directory: IoT-Systems
|
||||||
|
run: docker run --rm -it local/mapview/${{gitea.sha}}
|
||||||
|
|
||||||
|
- name: Clean up containers
|
||||||
|
if: ${{always()}}
|
||||||
|
run: docker image rm local/mapview/${{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
|
||||||
needs:
|
needs:
|
||||||
- hub-test
|
- hub-test
|
||||||
- store-test
|
- store-test
|
||||||
|
- mapview-test
|
||||||
steps:
|
steps:
|
||||||
- name: Clone repository
|
- name: Clone repository
|
||||||
run: git clone --revision ${{ gitea.sha }} --depth 1 ${{ gitea.server_url }}/${{ gitea.repository }}
|
run: git clone --revision ${{ gitea.sha }} --depth 1 ${{ gitea.server_url }}/${{ gitea.repository }}
|
||||||
|
|||||||
15
MapView/Dockerfile-test
Normal file
15
MapView/Dockerfile-test
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# 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 pip install --no-cache-dir -r requirements.txt
|
||||||
|
RUN pip install --root-user-action ignore --no-cache-dir unittest
|
||||||
|
# Copy the entire application into the container
|
||||||
|
COPY MapView/. .
|
||||||
|
# Run the main.py script inside the container when it starts
|
||||||
|
#CMD ["uvicorn", "main:app", "--host", "0.0.0.0"]
|
||||||
|
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
|
||||||
@@ -6,8 +6,8 @@ sys.modules['lineMapLayer'] = Mock()
|
|||||||
sys.modules['datasource'] = Mock()
|
sys.modules['datasource'] = Mock()
|
||||||
sys.modules['config'] = Mock()
|
sys.modules['config'] = Mock()
|
||||||
|
|
||||||
from MapView.main import get_lat_lon, MapViewApp
|
from main import get_lat_lon, MapViewApp
|
||||||
from MapView.datasource import Datasource as DataSourceClass
|
from datasource import Datasource as DataSourceClass
|
||||||
|
|
||||||
|
|
||||||
# -----------------------
|
# -----------------------
|
||||||
@@ -89,4 +89,4 @@ class TestMapLatLonToProcessedAgentData(unittest.TestCase):
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|||||||
Reference in New Issue
Block a user