Merge pull request #4477 from danxuliu/acceptance-macos-nitpicking

Fix minor code style issues in acceptance test runner
pull/2991/merge
Roeland Jago Douma 8 years ago committed by GitHub
commit 41f492ada7
  1. 59
      tests/acceptance/run.sh

@ -48,31 +48,34 @@
# (probably you will not have containers nor images with those names, but just # (probably you will not have containers nor images with those names, but just
# in case). # in case).
# Switch between timeout on linux and gtimeout on macOS (same for mktemp and # Sets the variables that abstract the differences in command names and options
# gmktemp) # between operating systems.
#
case "$OSTYPE" in # Switches between timeout on GNU/Linux and gtimeout on macOS (same for mktemp
darwin*) # and gmktemp).
INSTALLED=$(which gtimeout) function setOperatingSystemAbstractionVariables() {
if [ "$INSTALLED" == "" ]; then case "$OSTYPE" in
echo "Please install coreutils (brew install coreutils)" darwin*)
exit 1; if [ "$(which gtimeout)" == "" ]; then
fi echo "Please install coreutils (brew install coreutils)"
exit 1
MKTEMP=gmktemp fi
TIMEOUT=gtimeout
DOCKEROPTION="-e no_proxy=localhost " MKTEMP=gmktemp
;; TIMEOUT=gtimeout
linux*) DOCKER_OPTIONS="-e no_proxy=localhost "
MKTEMP=mktemp ;;
TIMEOUT=timeout linux*)
DOCKEROPTION=" " MKTEMP=mktemp
;; TIMEOUT=timeout
*) DOCKER_OPTIONS=" "
echo "Operating system ($OSTYPE) not supported" ;;
exit 1 *)
;; echo "Operating system ($OSTYPE) not supported"
esac exit 1
;;
esac
}
# Launches the Selenium server in a Docker container. # Launches the Selenium server in a Docker container.
# #
@ -105,12 +108,12 @@ function prepareSelenium() {
SELENIUM_CONTAINER=selenium-nextcloud-local-test-acceptance SELENIUM_CONTAINER=selenium-nextcloud-local-test-acceptance
echo "Starting Selenium server" echo "Starting Selenium server"
docker run --detach --name=$SELENIUM_CONTAINER --publish 4444:4444 --publish 5900:5900 $DOCKEROPTION selenium/standalone-firefox-debug:2.53.1-beryllium docker run --detach --name=$SELENIUM_CONTAINER --publish 4444:4444 --publish 5900:5900 $DOCKER_OPTIONS selenium/standalone-firefox-debug:2.53.1-beryllium
echo "Waiting for Selenium server to be ready" echo "Waiting for Selenium server to be ready"
if ! $TIMEOUT 10s bash -c "while ! curl 127.0.0.1:4444 >/dev/null 2>&1; do sleep 1; done"; then if ! $TIMEOUT 10s bash -c "while ! curl 127.0.0.1:4444 >/dev/null 2>&1; do sleep 1; done"; then
echo "Could not start Selenium server; running" \ echo "Could not start Selenium server; running" \
"\"docker run --rm --publish 4444:4444 --publish 5900:5900 $DOCKEROPTION selenium/standalone-firefox-debug:2.53.1-beryllium\"" \ "\"docker run --rm --publish 4444:4444 --publish 5900:5900 $DOCKER_OPTIONS selenium/standalone-firefox-debug:2.53.1-beryllium\"" \
"could give you a hint of the problem" "could give you a hint of the problem"
exit 1 exit 1
@ -197,6 +200,8 @@ cd "$(dirname $0)"
# If no parameter is provided to this script all the acceptance tests are run. # If no parameter is provided to this script all the acceptance tests are run.
SCENARIO_TO_RUN=$1 SCENARIO_TO_RUN=$1
setOperatingSystemAbstractionVariables
prepareSelenium prepareSelenium
prepareDocker prepareDocker

Loading…
Cancel
Save