From 31e98eec99c27910df8846d1825e9f30b5204550 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Fri, 15 Nov 2019 21:48:00 -0400 Subject: [PATCH] Support running specific tests in Docker Signed-off-by: Roberto Rosario --- HISTORY.rst | 2 ++ docker/rootfs/usr/local/bin/entrypoint.sh | 2 +- docker/rootfs/usr/local/bin/run_tests.sh | 7 ++++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 21d6dde6d0..81c760542c 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -145,6 +145,8 @@ "Unknown action type" will be used and allow users to delete the unknown state action. - Add workflow action to sign documents. +- Support running specific tests inside the Docker container. + docker run --rm mayanedms/mayanedms:3.3 run_tests 3.2.10 (2019-XX-XX) =================== diff --git a/docker/rootfs/usr/local/bin/entrypoint.sh b/docker/rootfs/usr/local/bin/entrypoint.sh index a877af7dcc..e43a48d847 100755 --- a/docker/rootfs/usr/local/bin/entrypoint.sh +++ b/docker/rootfs/usr/local/bin/entrypoint.sh @@ -151,7 +151,7 @@ run_frontend) run_tests) make_ready - run_tests.sh + run_tests.sh "${@:2}" ;; run_worker) diff --git a/docker/rootfs/usr/local/bin/run_tests.sh b/docker/rootfs/usr/local/bin/run_tests.sh index e7eb56b4fb..c05275963f 100755 --- a/docker/rootfs/usr/local/bin/run_tests.sh +++ b/docker/rootfs/usr/local/bin/run_tests.sh @@ -1,10 +1,11 @@ -#!/bin/sh +#!/bin/bash export DEBIAN_FRONTEND=noninteractive +TEST_ARGUMENT=${@:-"--mayan-apps"} apt-get update apt-get install -y --no-install-recommends gcc python3-dev tesseract-ocr-deu -su mayan -c "$MAYAN_PIP_BIN install -r ${MAYAN_INSTALL_DIR}/testing-base.txt" +su mayan -c "${MAYAN_PIP_BIN} install -r ${MAYAN_INSTALL_DIR}/testing-base.txt" -su mayan -c "$MAYAN_BIN test --mayan-apps --settings=mayan.settings.testing" +su mayan -c "${MAYAN_BIN} test ${TEST_ARGUMENT} --settings=mayan.settings.testing"