Skip to content

Commit 2c79dc2

Browse files
committed
improve vm.sh for non-intreactive use
1 parent 084a327 commit 2c79dc2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/ci/vm.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,17 @@ case "${ACTION}" in
130130
;;
131131

132132
runcoverage)
133+
test -t 1 && USE_TTY="-t"
133134
# @todo clean up /tmp/phpxmlrpc and .phpunit.result.cache
134135
if [ ! -d build ]; then mkdir build; fi
135136
docker exec -t "${CONTAINER_NAME}" "${CONTAINER_WORKSPACE_DIR}/tests/ci/setup/setup_code_coverage.sh" enable
136-
docker exec -it "${CONTAINER_NAME}" su "${CONTAINER_USER}" -c "./vendor/bin/phpunit --coverage-html build/coverage -v tests"
137+
docker exec -i $USE_TTY "${CONTAINER_NAME}" su "${CONTAINER_USER}" -c "./vendor/bin/phpunit --coverage-html build/coverage -v tests"
137138
docker exec -t "${CONTAINER_NAME}" "${CONTAINER_WORKSPACE_DIR}/tests/ci/setup/setup_code_coverage.sh" disable
138139
;;
139140

140141
runtests)
141-
docker exec -it "${CONTAINER_NAME}" su "${CONTAINER_USER}" -c "./vendor/bin/phpunit -v tests"
142+
test -t 1 && USE_TTY="-t"
143+
docker exec -i $USE_TTY "${CONTAINER_NAME}" su "${CONTAINER_USER}" -c "./vendor/bin/phpunit -v tests"
142144
;;
143145

144146
start)

0 commit comments

Comments
 (0)