allow to run just unit tests or just integration tests

parent 16bd217c
......@@ -14,18 +14,35 @@ function kill_selenium() {
trap "kill_selenium" EXIT
function run_tests() {
run_selenium
docker build -t enough_ci:latest ./
function run_phpunit() {
local docker_args
if ! test "$GITLAB_CI" ; then
docker_args="-v $(pwd):/opt/core/apps/enough"
fi
docker run --link enough_selenium:selenium --rm -e TRAVIS=true $docker_args enough_ci:latest /opt/vendor/bin/phpunit --bootstrap /opt/core/tests/bootstrap.php --fail-on-warning "$@"
}
function run_unit_tests() {
local phpunit_args
if ! test "$GITLAB_CI" ; then
DOCKER_ARGS="-v $(pwd):/opt/core/apps/enough"
PHPUNIT_ARGS="--coverage-html=html"
phpunit_args="--coverage-html=html"
fi
docker run --rm -e TRAVIS=true $DOCKER_ARGS enough_ci:latest /opt/vendor/bin/phpunit $PHPUNIT_ARGS --bootstrap /opt/core/tests/bootstrap.php --fail-on-warning --configuration phpunit.xml
run_phpunit $phpunit_args --configuration phpunit.xml
if ! test "$GITLAB_CI" ; then
firefox html/index.html
fi
docker run --link enough_selenium:selenium --rm $DOCKER_ARGS enough_ci:latest /opt/vendor/bin/phpunit --bootstrap /opt/core/tests/bootstrap.php --fail-on-warning --configuration phpunit.integration.xml
}
run_tests
function run_acceptance_tests() {
run_phpunit --configuration phpunit.integration.xml
}
function run_tests() {
run_selenium
docker build -t enough_ci:latest ./
for suite in "$@" ; do
$suite || return 1
done
}
run_tests "${@:-run_acceptance_tests run_unit_tests}"
......@@ -53,7 +53,8 @@ class EnoughAcceptenceTest extends AcceptanceTest {
$this->webDriver->get($this->url . '/index.php/login');
$this->assertContains('Nextcloud', $this->webDriver->getTitle());
var_dump($this->user);
// Log in
$this->webDriver->findElement(WebDriverBy::id('user'))->sendKeys($this->user->getUID());
$this->webDriver->findElement(WebDriverBy::id('password'))->sendKeys('password');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment