From a4447314e2f24ef9ccb09e675396946980193377 Mon Sep 17 00:00:00 2001 From: Gordon Inggs Date: Thu, 1 Feb 2024 12:31:50 +0200 Subject: [PATCH] Adding unit tests to python-minimal --- base/drivers/python_minimal/Dockerfile | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/base/drivers/python_minimal/Dockerfile b/base/drivers/python_minimal/Dockerfile index 14c7611..838c3c8 100644 --- a/base/drivers/python_minimal/Dockerfile +++ b/base/drivers/python_minimal/Dockerfile @@ -1,4 +1,4 @@ -FROM cityofcapetown/datascience:drivers +FROM cityofcapetown/datascience:drivers as drivers-image LABEL authors="Riaz Arbi,Gordon Inggs" @@ -20,6 +20,28 @@ COPY python_additions.sh . RUN bash python_additions.sh +FROM drivers-image as unit-test + +# Minio Utils unit tests +RUN git clone https://ds1.capetown.gov.za/ds_gitlab/OPM/db-utils.git && \ + cd db-utils && rm -rf db_utils && \ + python3 -W ignore:ImportantWarning -m unittest tst.test_exchange_utils && \ + python3 -W ignore:ImportantWarning -m unittest tst.test_minio_utils && \ + python3 -W ignore:ImportantWarning -m unittest tst.test_odbc_utils && \ + python3 -W ignore:ImportantWarning -m unittest tst.test_secrets_utils && \ + python3 -W ignore:ImportantWarning -m unittest tst.test_sharepoint_utils && \ + python3 -W ignore:ImportantWarning -m unittest tst.test_trino_utils && \ + python3 -W ignore:ImportantWarning -m unittest tst.test_minio_utils_base_funcs && \ + python3 -W ignore:ImportantWarning -m unittest tst.test_minio_utils_df_funcs + +# Pipeline Utils unit tests +RUN git clone https://ds1.capetown.gov.za/ds_gitlab/OPM/pipeline-utils.git && \ + cd pipeline-utils && rm -rf pipeline_utils && \ + python3 -W ignore:ImportantWarning -m unittest tst.test_kubernetes_dag + + +FROM unit-test as final-image + RUN apt-get clean && \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ python3 -m pip cache purge