TT#46791 Teach Jenkins job ngcp-panel-test-selenium-docker run one test only

It should speedup the testing when we debug one specific test only.

Change-Id: I7a2235bd3225836f3dcbdda6af2eaa6b65e71cff
changes/75/26275/2
Alexander Lutay 7 years ago
parent 0ff1d1d3f3
commit 653291b07a

@ -2,4 +2,4 @@
# This script is used for running the tests with proper arguments
# from within Jenkins
# this is a workaround with PERL5LIB= ... until we've a proper libselenium-remote-driver-perl package again
su - selenium -c "cd /code && PERL5LIB=/home/selenium/Selenium-Remote-Driver/ ./t/selenium/testrunner $* /results/ junit"
su - selenium -c "cd /code && PERL5LIB=/home/selenium/Selenium-Remote-Driver/ ./t/selenium/testrunner $1 /results/ junit $2"

@ -11,17 +11,19 @@ set -u
PASSWORD="selenium"
if [ -z "${1:-}" ] ; then
echo "Usage: $0 <testsystem> [<output_directory>] [junit]" >&2
echo "Usage: $0 <testsystem> [<output_directory>] [junit] [test_plan]" >&2
echo
echo "Usage examples:
$0 192.168.88.162
$0 192.168.88.162 /results/ junit"
$0 192.168.88.162 /results/ junit controller_billing.t"
exit 1
fi
SERVER="${1}"
OUTPUT_DIRECTORY="${2:-/code/}"
OUTPUT_TYPE=${3:-}
TEST_PLAN="${4:-*.t}"
# workaround for new Selenium::Remote::Driver (see Dockerfile)
export PERL5LIB=/home/selenium/Selenium-Remote-Driver/lib/
@ -51,12 +53,14 @@ echo "Selenium server log file available at /home/selenium/selenium.log"
echo "Watch at test runs by connecting via VNC (password: '${PASSWORD}'):"
echo "echo -e '$PASSWORD_ENCODED' >/tmp/vncpasswd ; vncviewer geometry=1280x1024x16 passwd=/tmp/vncpasswd localhost:5999"
if [ -n "${3:-}" ] && [ "${3:-}" = "junit" ] ; then
CATALYST_SERVER=https://${SERVER}:1443/ prove -ofmv --formatter TAP::Formatter::JUnit -l -It/lib t/selenium/*.t | \
if [ "${OUTPUT_TYPE:-}" = "junit" ] ; then
# shellcheck disable=SC2086
CATALYST_SERVER=https://${SERVER}:1443/ prove -ofmv --formatter TAP::Formatter::JUnit -l -It/lib t/selenium/${TEST_PLAN} | \
tee -a "${OUTPUT_DIRECTORY}/selenium.xml"
RC="${PIPESTATUS[0]}"
else
CATALYST_SERVER="https://${SERVER}:1443" prove -ofmv --color -l -It/lib t/selenium/*.t | \
# shellcheck disable=SC2086
CATALYST_SERVER="https://${SERVER}:1443" prove -ofmv --color -l -It/lib t/selenium/${TEST_PLAN} | \
tee -a "${OUTPUT_DIRECTORY}/selenium.pretty"
RC="${PIPESTATUS[0]}"
fi

Loading…
Cancel
Save