make running tests optional in docker build

cv2_1
scito 2 years ago
parent 1d0b568b1e
commit 7964c687f6

@ -4,9 +4,11 @@ WORKDIR /extract
COPY . .
ARG run_tests=true
RUN apt-get update && apt-get install -y libzbar0 python3-opencv nano \
&& pip install -r requirements.txt \
&& /extract/run_pytest.sh
&& if [[ "$run_tests" == "true" ]] ; then /extract/run_pytest.sh ; else echo "Not running tests..." ; fi
WORKDIR /files

@ -4,8 +4,10 @@ WORKDIR /extract
COPY . .
ARG run_tests=true
RUN pip install protobuf qrcode Pillow \
&& /extract/run_pytest.sh test_extract_otp_secret_keys_pytest.py -k "not qreader" --relaxed
&& if [[ "$run_tests" == "true" ]] ; then /extract/run_pytest.sh test_extract_otp_secret_keys_pytest.py -k "not qreader" --relaxed ; else echo "Not running tests..." ; fi
WORKDIR /files

@ -319,6 +319,7 @@ docker run --entrypoint /bin/bash -it --rm -v "$(pwd)":/files:ro extract_otp_sec
docker run --entrypoint /extract/run_pytest.sh --rm -v "$(pwd)":/files:ro extract_otp_secret_keys
docker build . -t extract_otp_secret_keys_no_qr_reader -f Dockerfile_no_qr_reader --pull
docker build . -t extract_otp_secret_keys_no_qr_reader -f Dockerfile_no_qr_reader --pull --build-arg run_tests=false
docker run --entrypoint /extract/run_pytest.sh --rm -v "$(pwd)":/files:ro extract_otp_secret_keys_no_qr_reader
docker run --entrypoint /extract/run_pytest.sh --rm -v "$(pwd)":/files:ro extract_otp_secret_keys_no_qr_reader test_extract_otp_secret_keys_pytest.py -k "not qreader"
docker run --rm -v "$(pwd)":/files:ro extract_otp_secret_keys_no_qr_reader example_export.txt

Loading…
Cancel
Save