Select Git revision
codeception.yml
-
Bartek Jaskulski authored
Signed-off-by:
Bart Jaskulski <bjaskulski@protonmail.com>
Bartek Jaskulski authoredSigned-off-by:
Bart Jaskulski <bjaskulski@protonmail.com>
codeception.yml 5.44 KiB
.template: &job-codeception-test
tags:
- codeception
- $TESTS_TAG
image:
name: gitlab.wpdesk.dev:5050/wpdesk/docker-tests/codeception:12.0.5
entrypoint: [""]
variables:
WP_CLI_CACHE_DIR: /cache/wp-cli
APACHE_DOCUMENT_ROOT: ${CI_PROJECT_DIR}/tests/wordpress
SCREEN_WIDTH: 1200
SCREEN_HEIGHT: 1200
services:
- name: mysql:5.6
alias: mysqltests
command: [--max-allowed-packet=67108864]
- name: wpdesknet/wordpress:52
alias: wootests
- name: selenium/standalone-chrome:latest
alias: chrome
artifacts:
when: always
expire_in: 1 month
name: "acceptance logs"
paths:
- tests/codeception/tests/_output
reports:
junit: tests/codeception/tests/_output/report.xml
stage: tests
needs:
- prepare prefixed vendor
- prepare translations
- job: prepare tests
optional: true
- job: prepare npm assets
optional: true
except:
variables:
- $DISABLE_CODECEPTION
- $IS_LIBRARY
- $IS_NPM_LIBRARY
allow_failure: false
interruptible: true
before_script:
- composer config gitlab-token.gitlab.wpdesk.dev gitlab-ci-token ${CI_JOB_TOKEN}
- echo "xdebug.max_nesting_level=2560" >> /usr/local/etc/php/php.ini
- export DEPENDENT_PLUGINS_DIR=${CI_PROJECT_DIR}/tests/dependent_plugins
- mkdir -p /cache/wp-cli
- export MYSQL_IP=$(awk '/^[[:space:]]*($|#)/{next} /mysqltests/{print $1; exit}' /etc/hosts)
- export WOOTESTS_IP=$(awk '/^[[:space:]]*($|#)/{next} /wootests/{print $1; exit}' /etc/hosts)
- export TEST_SITE_WP_URL="http://${WOOTESTS_IP}"
- cd ${CI_PROJECT_DIR}
- mkdir -p /project
- if [ -f ${CI_PROJECT_DIR}/tests/codeception/bootstrap.sh ]; then cp -r ${CI_PROJECT_DIR}/. /project; fi
- if [ -f ${CI_PROJECT_DIR}/tests/codeception/bootstrap.sh ]; then cd /project; fi
- if [ -f ${CI_PROJECT_DIR}/tests/codeception/bootstrap.sh ]; then composer install --no-progress --prefer-dist --no-dev; fi
- if [ -f ${CI_PROJECT_DIR}/tests/codeception/bootstrap.sh ]; then rm auth.json; fi
- cd ${CI_PROJECT_DIR}
- mkdir -p ${APACHE_DOCUMENT_ROOT}
- cd ${APACHE_DOCUMENT_ROOT}
- if [ -f ${CI_PROJECT_DIR}/tests/codeception/bootstrap.sh ]; then wp core download ${WORDPRESS_CLI_PARAMETERS} --allow-root; fi;
- if [ -f ${CI_PROJECT_DIR}/tests/codeception/bootstrap.sh ]; then wp config create --dbhost=${MYSQL_IP} --dbname=wptest --dbuser=mysql --dbpass=mysql --allow-root; fi;
- if [ -f ${CI_PROJECT_DIR}/tests/codeception/bootstrap.sh ]; then wp config set WP_DEBUG true --raw --type=constant --allow-root; fi;
- cd ${CI_PROJECT_DIR}
- if [ -f ${CI_PROJECT_DIR}/tests/codeception/bootstrap.sh ]; then chmod a+x ./tests/codeception/bootstrap.sh; fi;
- if [ -f ${CI_PROJECT_DIR}/tests/codeception/bootstrap.sh ]; then . ./tests/codeception/bootstrap.sh; fi;
- if [ -f ${CI_PROJECT_DIR}/tests/codeception/wpdesk.yml ]; then composer prepare-wordpress-for-codeception; fi;
- if [ -f ${CI_PROJECT_DIR}/tests/codeception/wpdesk.yml ]; then composer prepare-local-codeception-tests; fi;
- mkdir -p ${CI_PROJECT_DIR}/tests/codeception/tests/_output
- mkdir -p ${CI_PROJECT_DIR}/tests/codeception/tests/acceptance