From 2c79dc261569a70ef9cd047b234a49be23598a3d Mon Sep 17 00:00:00 2001 From: gggeek Date: Mon, 15 Apr 2024 11:49:22 +0000 Subject: [PATCH] improve vm.sh for non-intreactive use --- tests/ci/vm.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/ci/vm.sh b/tests/ci/vm.sh index 55d2759..b724124 100755 --- a/tests/ci/vm.sh +++ b/tests/ci/vm.sh @@ -130,15 +130,17 @@ case "${ACTION}" in ;; runcoverage) + test -t 1 && USE_TTY="-t" # @todo clean up /tmp/phpxmlrpc and .phpunit.result.cache if [ ! -d build ]; then mkdir build; fi docker exec -t "${CONTAINER_NAME}" "${CONTAINER_WORKSPACE_DIR}/tests/ci/setup/setup_code_coverage.sh" enable - docker exec -it "${CONTAINER_NAME}" su "${CONTAINER_USER}" -c "./vendor/bin/phpunit --coverage-html build/coverage -v tests" + docker exec -i $USE_TTY "${CONTAINER_NAME}" su "${CONTAINER_USER}" -c "./vendor/bin/phpunit --coverage-html build/coverage -v tests" docker exec -t "${CONTAINER_NAME}" "${CONTAINER_WORKSPACE_DIR}/tests/ci/setup/setup_code_coverage.sh" disable ;; runtests) - docker exec -it "${CONTAINER_NAME}" su "${CONTAINER_USER}" -c "./vendor/bin/phpunit -v tests" + test -t 1 && USE_TTY="-t" + docker exec -i $USE_TTY "${CONTAINER_NAME}" su "${CONTAINER_USER}" -c "./vendor/bin/phpunit -v tests" ;; start)