Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing build #303

Merged
merged 10 commits into from
Aug 28, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 41 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,62 @@
language: php

sudo: false
dist: trusty

cache:
directories:
- $HOME/.composer/cache/files
services:
- docker

php: [5.4, 5.5, 5.6, 7.0, 7.1, 7.2]
php:
- 5.4
- 5.5
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3

env:
global:
- WEBDRIVER=selenium
- DISPLAY=:99.0

cache:
directories:
- $HOME/.composer/cache/files

matrix:
fast_finish: true
include:
- php: 7.0
env: WEBDRIVER=selenium-remote
sudo: required
services:
- docker
- php: 5.3
dist: precise
# Force using PHP 5.6 for the test server as PHP 5.3 does not have the builtin webserver
env: MINK_PHP_BIN=~/.phpenv/versions/5.6/bin/php
oleg-andreyev marked this conversation as resolved.
Show resolved Hide resolved

before_script:
- sh bin/run-"$WEBDRIVER".sh

- composer install

# Start a webserver for web fixtures.
- vendor/bin/mink-test-server > /dev/null 2>&1 &
install:
- travis_retry composer install --no-interaction
oleg-andreyev marked this conversation as resolved.
Show resolved Hide resolved

script: phpunit -v --coverage-clover=coverage.clover
before_script:
- mkdir ./logs
- |
if [[ ${TRAVIS_PHP_VERSION:0:3} == "5.3" ]]; then
wget http://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.1.jar
sh -e /etc/init.d/xvfb start
java -jar selenium-server-standalone-2.53.1.jar &> ./logs/selenium.log &
else
docker run -p 4444:4444 --network=host -v /dev/shm:/dev/shm --shm-size 2g selenium/standalone-firefox:2.53.1 &> ./logs/selenium.log &
fi;
- until $(echo | nc localhost 4444); do sleep 1; echo Waiting for Selenium server on port 4444...; done; echo "Selenium server started"
oleg-andreyev marked this conversation as resolved.
Show resolved Hide resolved
# https://bugs.php.net/bug.php?id=71443
- |
if [[ ${TRAVIS_PHP_VERSION:0:3} == "5.3" ]]; then
export MINK_PHP_BIN=~/.phpenv/versions/5.4/bin/php
fi;
USE_ZEND_ALLOC=0 travis_retry ${MINK_PHP_BIN-php} -d memory_limit=8G -S localhost:8002 -t ./vendor/mink/driver-testsuite/web-fixtures &> ./logs/mink-test-server.log &
oleg-andreyev marked this conversation as resolved.
Show resolved Hide resolved
- until $(echo | nc localhost 8002); do sleep 1; echo waiting for PHP server on port 8002...; done; echo "PHP server started"

script:
- phpunit -v --coverage-clover=coverage.clover

after_script:
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover

after_failure:
- cat /tmp/webdriver_output.txt
- cat ./logs/selenium.log
- cat ./logs/mink-test-server.log
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,29 @@ $> curl -sS http://getcomposer.org/installer | php
$> php composer.phar install
```

Testing
------------

1. Start WebDriver
1. If you have Docker installed, run
```bash
docker run -p 4444:4444 selenium/standalone-firefox:2.53.1
```
2. If you do not have Docker, but you have Java
```bash
curl -L http://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.1.jar > selenium-server-standalone-2.53.1.jar
java -jar selenium-server-standalone-2.53.1.jar
```
2. Start WebServer by running
``` bash
php -S localhost:8002 -t ./vendor/mink/driver-testsuite/web-fixtures
oleg-andreyev marked this conversation as resolved.
Show resolved Hide resolved
```
3. Start PhpUnit
```bash
composer require --dev phpunit/phpunit
./vendor/bin/phpunit -v --coverage-clover=coverage.clover
```

Copyright
---------

Expand Down
7 changes: 0 additions & 7 deletions bin/run-selenium-remote.sh

This file was deleted.

11 changes: 0 additions & 11 deletions bin/run-selenium.sh

This file was deleted.