From 7a08c923f6b5d4f159fc38bb64402e70102b1038 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Fri, 27 Nov 2015 02:20:33 +0100 Subject: [PATCH] Added new browser tests. --- .gitlab-ci.yml | 26 +++++++++++++++++++++++--- script/build/test_shutdown.sh | 6 +++++- script/build/test_startup.sh | 9 ++++++--- 3 files changed, 34 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1f53975fb..1da07ee92 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -156,6 +156,26 @@ job_integration_autowizard: - cp contrib/auto_wizard_example.json auto_wizard.json - script/bootstrap.sh - rake assets:precompile - - script/build/test_startup.sh $RAILS_ENV 3011 - - ruby -I test/ test/integration/auto_wizard_test.rb || script/build/test_shutdown.sh $RAILS_ENV 3011 && exit 1 - - script/build/test_shutdown.sh $RAILS_ENV 3011 + - script/build/test_startup.sh $RAILS_ENV 3011 3012 + - ruby -I test/ test/integration/auto_wizard_test.rb || script/build/test_shutdown.sh $RAILS_ENV 3011 3012 1 + - script/build/test_shutdown.sh $RAILS_ENV 3011 3012 + +job_integration_browser_ff: + stage: browser + script: + - export RAILS_ENV=production + - export Z_LOCALES=en-us:de-de + - export IP=$(ip -f inet -o addr show eth0|cut -d\ -f 7 | cut -d/ -f 1) + - export BROWSER_URL=http://$IP:3021 + - export REMOTE_URL=http://192.168.122.175:4445/wd/hub + - export BROWSER=firefox + - export RAILS_SERVE_STATIC_FILES=true + - script/build/test_db_config.sh production ci_zammad_browser_ff + - script/build/test_db_config.sh test ci_zammad_browser_ff_test + - RAILS_ENV=test rake db:create + - cp contrib/auto_wizard_example.json auto_wizard.json + - script/bootstrap.sh + - rake assets:precompile + - script/build/test_startup.sh $RAILS_ENV 3021 3022 + - rake test:browser || script/build/test_shutdown.sh $RAILS_ENV 3021 3022 1 + - script/build/test_shutdown.sh $RAILS_ENV 3021 3022 diff --git a/script/build/test_shutdown.sh b/script/build/test_shutdown.sh index 117aa4a43..eb8e82d74 100755 --- a/script/build/test_shutdown.sh +++ b/script/build/test_shutdown.sh @@ -1,7 +1,11 @@ #!/bin/bash RAILS_ENV=$1 -PORT=$2 +APP_PORT=$2 +WS_PORT=$3 +EXIT=$4 || 0 script/scheduler.rb stop script/websocket-server.rb stop kill $(cat tmp/pids/puma.pid) + +exit $EXIT diff --git a/script/build/test_startup.sh b/script/build/test_startup.sh index 458e069de..1b682be98 100755 --- a/script/build/test_startup.sh +++ b/script/build/test_startup.sh @@ -1,7 +1,10 @@ #!/bin/bash RAILS_ENV=$1 -PORT=$2 +APP_PORT=$2 +WS_PORT=$3 -pumactl start --pidfile tmp/pids/puma.pid -d -p $PORT -e $RAILS_ENV -script/websocket-server.rb start -d +rails r "Setting.set('websocket_port', '#{WS_PORT}')" + +pumactl start --pidfile tmp/pids/puma.pid -d -p $APP_PORT -e $RAILS_ENV +script/websocket-server.rb start -d -p $WS_PORT script/scheduler.rb start