diff --git a/FlinkSqlServicesOperator/Dockerfile b/FlinkSqlServicesOperator/Dockerfile index 2904dc5f..a6e8f549 100644 --- a/FlinkSqlServicesOperator/Dockerfile +++ b/FlinkSqlServicesOperator/Dockerfile @@ -1,12 +1,11 @@ -FROM python:3.8 as precheck -RUN pip3 install kubernetes kopf==1.32.1 oisp pycodestyle pylint coverage aiounittest pytimeparse +FROM python:3.12 as precheck +RUN pip3 install kubernetes kopf==1.37.3 oisp pycodestyle pylint coverage aiounittest pytimeparse ADD test/requirements.txt /opt/test/ -RUN cd /opt/test && pip install -r requirements.txt +RUN cd /opt/test && pip3 install -r requirements.txt ADD *.py /opt/ ADD test/*.py /opt/test/ -#RUN PYTHONPATH=/opt python3 -m pycodestyle /opt/*.py -RUN PYTHONPATH=/opt python3 -m pylint --disable=fixme /opt/*.py -RUN PYTHONPATH=/opt coverage run /opt/test/test_beamservicesoperator.py && \ +RUN PYTHONPATH=/opt python3 -m pylint --disable=fixme,R0917,C0103 /opt/*.py +RUN PYTHONPATH=/opt coverage run /opt/test/test_beamservicesoperator.py && \ PYTHONPATH=/opt coverage run -a /opt/test/test_tables_and_views.py && \ PYTHONPATH=/opt coverage run -a /opt/test/test_util.py && \ PYTHONPATH=/opt coverage run -a /opt/test/test_beamsqlstatementsetoperator.py && \ @@ -14,8 +13,8 @@ PYTHONPATH=/opt coverage run -a /opt/test/test_flink_util.py && \ PYTHONPATH=/opt coverage run -a /opt/test/test_util.py RUN coverage report --omit "*/test*" -m --fail-under 80 -FROM python:3.8 -RUN pip install kubernetes kopf==1.32.1 oisp pytimeparse +FROM python:3.12 +RUN pip3 install kubernetes python-json-logger==2.0.7 kopf==1.37.3 oisp pytimeparse COPY --from=precheck /opt/*.py /opt/ WORKDIR /opt RUN groupadd -r bsoperator && useradd -r -g bsoperator bsoperator diff --git a/FlinkSqlServicesOperator/test/requirements.txt b/FlinkSqlServicesOperator/test/requirements.txt index 1e92d89c..0cede157 100644 --- a/FlinkSqlServicesOperator/test/requirements.txt +++ b/FlinkSqlServicesOperator/test/requirements.txt @@ -1,2 +1,3 @@ -bunch==1.0.1 -mock==4.0.3 \ No newline at end of file +bunch-py3==2.0.0 +mock==4.0.3 +python-json-logger==2.0.7 \ No newline at end of file diff --git a/FlinkSqlServicesOperator/test/test_beamservicesoperator.py b/FlinkSqlServicesOperator/test/test_beamservicesoperator.py index 391a0f53..02e838cc 100644 --- a/FlinkSqlServicesOperator/test/test_beamservicesoperator.py +++ b/FlinkSqlServicesOperator/test/test_beamservicesoperator.py @@ -1,7 +1,7 @@ """Unit test for beamservicesoperator.py""" from unittest import TestCase, mock import unittest -from bunch import Bunch +from bunch_py3 import Bunch from mock import patch, mock_open import aiounittest diff --git a/FlinkSqlServicesOperator/test/test_beamsqlstatementsetoperator.py b/FlinkSqlServicesOperator/test/test_beamsqlstatementsetoperator.py index 802aab31..2463a61e 100644 --- a/FlinkSqlServicesOperator/test/test_beamsqlstatementsetoperator.py +++ b/FlinkSqlServicesOperator/test/test_beamsqlstatementsetoperator.py @@ -18,7 +18,7 @@ """ from unittest import TestCase import unittest -from bunch import Bunch +from bunch_py3 import Bunch from mock import patch import kopf import requests diff --git a/FlinkSqlServicesOperator/test/test_flink_util.py b/FlinkSqlServicesOperator/test/test_flink_util.py index d2ba0911..6a71b10c 100644 --- a/FlinkSqlServicesOperator/test/test_flink_util.py +++ b/FlinkSqlServicesOperator/test/test_flink_util.py @@ -3,7 +3,7 @@ """ from unittest import TestCase import unittest -from bunch import Bunch +from bunch_py3 import Bunch from mock import patch import requests diff --git a/FlinkSqlServicesOperator/test/test_tables_and_views.py b/FlinkSqlServicesOperator/test/test_tables_and_views.py index 7c36c162..8e1ab7b9 100644 --- a/FlinkSqlServicesOperator/test/test_tables_and_views.py +++ b/FlinkSqlServicesOperator/test/test_tables_and_views.py @@ -3,7 +3,7 @@ """ from unittest import TestCase import unittest -from bunch import Bunch +from bunch_py3 import Bunch from mock import patch import tables_and_views as target diff --git a/FlinkSqlServicesOperator/test/test_util.py b/FlinkSqlServicesOperator/test/test_util.py index 0048f3e4..58c6ce4f 100644 --- a/FlinkSqlServicesOperator/test/test_util.py +++ b/FlinkSqlServicesOperator/test/test_util.py @@ -4,7 +4,7 @@ from unittest import TestCase import unittest -from bunch import Bunch +from bunch_py3 import Bunch from mock import patch import util as target