adapt PERL5LIB in a way, so that jenkins is also able to find it
(it uses /home/selenium/jenkins_docker_run)
Change-Id: I2d5ab35c77abd2dda9f676768da8cd6a36c4ddfb
Selenium::Remote::Driver v1.20 is the latest upstream release and
is missing some patches/PRs that we need for selenium tests of
ngcp-panel. Packaging the git version properly in the Debian way
is hard because of the way upsteam handles releases with separate
branches (one of them even being out-of-date, sigh). So instead
let's use a tarball from their latest git version until we see a
v.1.21 release.
Symlinking the geckodriver binary to /usr/bin/geckodriver addresses:
| Unable to find the geckodriver binary in your $PATH. at /home/selenium/Selenium-Remote-Driver/lib/Selenium/CanStartBinary/FindBinary.pm line 66.
Change-Id: I8ddf3c76a008ce5b0aa67b62154a9614f90cb659
all selenium tests are working with newest geckodriver (0.18.0) and patched S:R:D
issues:
- setting the window size: not urgent
- the unsupported move_to: fixed (new move_action)
- setting the implicit wait timeout: fixed upstream in S:R:D
Change-Id: Ic5b52cd866f4fd93682d67a4fd8a76ec54ea70cf
This package update includes further patches to address Selenium
test failures with geckodriver/Firefox:
* move_to: 4d0b8e7255
* timeouts: 2c55f3dcb9
Change-Id: I587f32230ce7cc8d912e052a93fb7d31fd7c90c1
Which confuses developers which are debugging failed tests,
as details like below are not a part of XML Jenkins displays on a WEB:
> # Failed test 'create test customer w/o profile package'
> # at t/api-rest/api-balanceintervals.t line 1578.
> # got: '500'
> # expected: '201'
> Use of uninitialized value in concatenation (.) or string at t/api-rest/api-balanceintervals.t line 1580.
> Thread 4 terminated abnormally: malformed JSON string, neither array, object, number, string or atom, at character offset 0 (before "<!DOCTYPE HTML>\n<!-...") at /usr/share/perl5/JSON.pm line 171.
'man prove' says:
> -m, --merge Merge test scripts' STDERR with their STDOUT.
Change-Id: I945d4d8867fc9c061f96d067be14125af7cc5a46
An unintended docker image rebuild of
ngcp-panel-tests-selenium-jessie resulted in failures with
our selenium tests. A series of problems started:
1) Updating the Selenium version resulted in an error message by
Selenium, requesting the geckodriver binary
(https://github.com/mozilla/geckodriver - being a proxy for using
W3C WebDriver-compatible clients to interact with Gecko-based
browsers). So Selenium versions >=3 depend on geckodriver.
2) Recent versions of Selenium also depend on Java >=8, available
only via backports for jessie. Since we avoid usage of backports
as much as possible and we'd have to upgrade once anyway we
decided to base our fresh docker image on stretch.
3) We have to backport Selenium::Remote::Driver (Debian package
libselenium-remote-driver-perl) for stretch (since it's not
available in Debian, even though there's an ITP:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=839569). It has
a bug which prevents its usage for us:
https://github.com/gempesaw/Selenium-Remote-Driver/issues/319 ->
We fixed the problem via our own backport and submitted a PR
towards upstream:
https://github.com/gempesaw/Selenium-Remote-Driver/pull/321
4) Firefox from Debian/stretch (firefox-esr 52.2.0esr-1~deb9u1)
fails with geckodriver e.g. in click events, the current Firefox
version 54 works fine though. So instead install only the
relevant runtime packages from Debian and use the Firefox version
v54 from upstream.
Resulting changes:
* switch from Debian/jessie to Debian/stretch
* no longer use selenium at all but only geckodriver instead
(recent versions of selenium depend on geckodriver anyway)
* do all package/file changes in /home/selenium/ (to clearly
see what's from us/docker and what are actual temporary files)
* testrunner related changes:
- invoke vncserver with `-localhost no` option to accept
VNC connections not only from localhost only
- adjust vncserver process name for Xvnc4->Xtigervnc switch
- start geckodriver instead of selenium
* package related changes:
- backported libtest-pretty-perl (v0.32)
- backported libselenium-remote-driver-perl (v1.20)
- add curl to package list since it's handy for debugging test
failures, like e.g. `curl -X POST localhost:4444/session --data {}`
- add procps to have pkill binary available inside testrunner
- openjdk/java is no longer needed since we don't depend on selenium anymore
- vnc4server is now a transitional package for
tigervnc-standalone-server, so directly depend on it
Change-Id: I607ffd4fce80f9e84b76c3c7a19824819ac4503c
File /.dockerinit no longer exists. With Docker versions 1.11 and
1.12 there's /.dockerenv available, though it's not yet sure
whether this will be present in the future too, so check for either
/.dockerenv or a proper cgroup setup inside the docker container.
File /proc/1/cgroup with Docker version 1.12.1 on Debian/jessie
looks like:
| root@4c3a1c6d773c:/# cat /proc/1/cgroup
| 8:freezer:/docker/4c3a1c6d773c1a5675f24ff58540ff1a290489e7325e1e66ec2c3392aa3a1145
| 7:perf_event:/docker/4c3a1c6d773c1a5675f24ff58540ff1a290489e7325e1e66ec2c3392aa3a1145
| 6:net_cls,net_prio:/docker/4c3a1c6d773c1a5675f24ff58540ff1a290489e7325e1e66ec2c3392aa3a1145
| 5:cpuset:/docker/4c3a1c6d773c1a5675f24ff58540ff1a290489e7325e1e66ec2c3392aa3a1145
| 4:blkio:/docker/4c3a1c6d773c1a5675f24ff58540ff1a290489e7325e1e66ec2c3392aa3a1145
| 3:cpu,cpuacct:/docker/4c3a1c6d773c1a5675f24ff58540ff1a290489e7325e1e66ec2c3392aa3a1145
| 2:devices:/docker/4c3a1c6d773c1a5675f24ff58540ff1a290489e7325e1e66ec2c3392aa3a1145
| 1:name=systemd:/docker/4c3a1c6d773c1a5675f24ff58540ff1a290489e7325e1e66ec2c3392aa3a1145
See https://github.com/docker/docker/issues/18355 and
https://github.com/docker/docker/pull/19490 for details.
Change-Id: I79fff0eead1a11f80b461791b2285a65d706262a
The jenkins_docker_run script is invoked from Jenkins
when running the docker image. The testrunner script
now takes two additional arguments to support sharing
test results via another docker volume and to control
output format ("pretty" as default but junit for usage
on Jenkins).
While at it fix some quoting issue identified by shellcheck.
Change-Id: Ided716e0e0ca23751b0ee2961f3e301acb80128d
This provides a setup to run ngcp-panel tests against
selenium-server using docker. It's based on Debian/jessie and
assumes are reachable NGCP system for running the tests against
(e.g. via `vagrant up ce-trunk`). For usage instructions refer
to the Dockerfile.
NOTE: replacing 'jessie' with 'wheezy' in the Dockerfile provides
a setup based on Debian/wheezy.
Change-Id: I79ca4d44c3a7c454f99148889d4b0d075a79e82b
use strict and warnings
therefore forbid unquoted strings
factor out initialisation
screenshot functionality is implemented upstream
Change-Id: I18a0dcc7a6418dc9fd2fa64d367ae226018a7645