Skip to content
Snippets Groups Projects
Commit 85a741c4 authored by Grzegorz Rola's avatar Grzegorz Rola
Browse files

Feature/codeception includes

parent 45f0f772
No related branches found
No related tags found
No related merge requests found
......@@ -19,74 +19,16 @@ stages:
- pre-deploy
- deploy
.template: &job-test-template
cache:
key: ${CI_PROJECT_NAME}-vendor
paths:
- vendor/
stage: tests
coverage: '/^\s*Lines:\s*\d+.\d+\%/'
artifacts:
reports:
junit: tmp_artifacts/report.xml
.template: &job-test-integration-template
<<: *job-test-template
dependencies:
- prepare prefixed vendor
services:
- mysql:5.6
before_script:
- export DEPENDENT_PLUGINS_DIR=${CI_PROJECT_DIR}/tests/dependent_plugins
- echo ${WPDESK_CI_VERSION}
- ls -l
- php --version
- cat /tmp/wordpress-develop/src/wp-includes/version.php
- cat /tmp/woocommerce/woocommerce.php
- COMPOSER_MEMORY_LIMIT=-1 composer install --no-progress --prefer-dist
- ln -s $CI_PROJECT_DIR /tmp/wordpress-develop/src/wp-content/plugins/$CI_PROJECT_NAME
script:
- vendor/bin/phpunit -d memory_limit=-1 --configuration phpunit-integration.xml --coverage-text --colors=never --log-junit tmp_artifacts/report.xml
only:
- master
except:
variables:
- $DISABLE_COVERAGE
.template: &job-test-integration-template-fast
<<: *job-test-integration-template
script:
- vendor/bin/phpunit -d memory_limit=-1 --configuration phpunit-integration.xml --no-coverage --log-junit tmp_artifacts/report.xml
except:
- tags
only:
.template: &job-test-unit-template
<<: *job-test-template
script:
- echo ${WPDESK_CI_VERSION}
- ls -l
- php --version
- cat /tmp/wordpress-develop/src/wp-includes/version.php
- cat /tmp/woocommerce/woocommerce.php
- COMPOSER_MEMORY_LIMIT=-1 composer install --no-progress --prefer-dist
- vendor/bin/phpunit -d memory_limit=-1 --configuration phpunit-unit.xml --coverage-text --colors=never --log-junit tmp_artifacts/report.xml
only:
- master
except:
variables:
- $DISABLE_COVERAGE
.template: &job-test-unit-template-fast
<<: *job-test-template
script:
- echo ${WPDESK_CI_VERSION}
- ls -l
- php --version
- cat /tmp/wordpress-develop/src/wp-includes/version.php
- cat /tmp/woocommerce/woocommerce.php
- COMPOSER_MEMORY_LIMIT=-1 composer install --no-progress --prefer-dist
- vendor/bin/phpunit -d memory_limit=-1 --configuration phpunit-unit.xml --no-coverage --log-junit tmp_artifacts/report.xml
include:
- project: 'wpdesk/gitlab-ci'
ref: 'master'
file: '/includes/tests/unit.yml'
- project: 'wpdesk/gitlab-ci'
ref: 'master'
file: '/includes/tests/codeception.yml'
- project: 'wpdesk/gitlab-ci'
ref: 'master'
file: '/includes/tests/integration.yml'
.template: &job-deploy-template
image: wpdesknet/amazon-svn-deploy
......@@ -121,6 +63,7 @@ before_script:
prepare prefixed vendor:
image: wpdesknet/phpunit-woocommerce:0-0
stage: prepare
interruptible: true
artifacts:
name: "vendor_prefixed"
paths:
......@@ -176,87 +119,6 @@ churn metrics:
# - composer install --no-progress --prefer-dist
# - vendor/bin/phpcs
unit test lastest:
<<: *job-test-unit-template-fast
image: wpdesknet/phpunit-woocommerce:0-0
integration test lastest:
<<: *job-test-integration-template-fast
image: wpdesknet/phpunit-woocommerce:0-0
except:
variables:
- $DISABLE_INTEGRATION_TESTS
unit test lastest coverage:
<<: *job-test-unit-template
image: wpdesknet/phpunit-woocommerce:0-0
integration test lastest coverage:
<<: *job-test-integration-template
image: wpdesknet/phpunit-woocommerce:0-0
except:
variables:
- $DISABLE_INTEGRATION_TESTS
- $DISABLE_COVERAGE
integration test php7-1 wc-1:
<<: *job-test-integration-template-fast
image: wpdesknet/phpunit-woocommerce:1-1
except:
variables:
- $DISABLE_INTEGRATION_TESTS
integration test php7 wc-2:
<<: *job-test-integration-template-fast
image: wpdesknet/phpunit-woocommerce:2-2
except:
variables:
- $DISABLE_INTEGRATION_TESTS
integration test php-7 wc-3:
<<: *job-test-integration-template-fast
image: wpdesknet/phpunit-woocommerce:2-3
except:
variables:
- $DISABLE_INTEGRATION_TESTS
integration test php5-6:
<<: *job-test-integration-template-fast
image: wpdesknet/phpunit-woocommerce:3-0
except:
variables:
- $DISABLE_INTEGRATION_TESTS
integration test php5-5:
<<: *job-test-integration-template-fast
image: wpdesknet/phpunit-woocommerce:4-0
except:
variables:
- $DISABLE_PHP_5_5
- $DISABLE_INTEGRATION_TESTS
integration test current woocommerce:
<<: *job-test-integration-template-fast
image: wpdesknet/phpunit-woocommerce:0-0
allow_failure: true
before_script:
- export DEPENDENT_PLUGINS_DIR=${CI_PROJECT_DIR}/tests/dependent_plugins
- cd ${CI_PROJECT_DIR}
- mkdir -p .tmp
- cd .tmp
- if [[ ! -d woocommerce ]]; then git clone https://github.com/woocommerce/woocommerce.git; fi
- cd woocommerce
- git pull
- ln -s ${CI_PROJECT_DIR}/.tmp/woocommerce /tmp/woocommerce
- cat /tmp/wordpress-develop/src/wp-includes/version.php
- cat /tmp/woocommerce/woocommerce.php
- cd ${CI_PROJECT_DIR}
- COMPOSER_MEMORY_LIMIT=-1 composer install --no-progress --prefer-dist
- ln -s $CI_PROJECT_DIR /tmp/wordpress-develop/src/wp-content/plugins/$CI_PROJECT_NAME
except:
variables:
- $DISABLE_INTEGRATION_TESTS
apigen docs:
<<: *docs-generation
allow_failure: true
......@@ -387,87 +249,3 @@ library:
only:
variables:
- $IS_LIBRARY
.template: &job-codeception-test
image: wpdesknet/wordpresscli:24
cache:
key: ${CI_PROJECT_NAME}-vendor
paths:
- vendor/
variables:
WP_CLI_CACHE_DIR: /cache/wp-cli
APACHE_DOCUMENT_ROOT: ${CI_PROJECT_DIR}/tests/wordpress
CI_DEBUG_SERVICES: trace
SCREEN_WIDTH: 1200
SCREEN_HEIGHT: 1600
services:
- name: mysql:5.6
alias: mysqltests
- name: wpdesknet/wordpress:49
alias: wootests
- name: selenium/standalone-chrome:3.141.59-oxygen
alias: chrome
artifacts:
when: always
expire_in: 1 month
name: "acceptance logs"
paths:
- tests/codeception/tests/_output
- ${APACHE_DOCUMENT_ROOT}/wp-content/debug.log
- ${APACHE_DOCUMENT_ROOT}/wp-content/uploads/wpdesk-logs/wpdesk_debug.log
reports:
junit: tests/codeception/tests/_output/report.xml
stage: tests
except:
variables:
- $DISABLE_CODECEPTION
allow_failure: false
before_script:
- 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)
- cd ${CI_PROJECT_DIR}
- mkdir -p /tmp/project
- cp -r ${CI_PROJECT_DIR}/. /tmp/project
- cd /tmp/project
- COMPOSER_MEMORY_LIMIT=-1 composer install --no-progress --prefer-dist --no-dev
- cd ${CI_PROJECT_DIR}
- mkdir -p ${APACHE_DOCUMENT_ROOT}
- cd ${APACHE_DOCUMENT_ROOT}
- wp core download ${WORDPRESS_CLI_PARAMETERS} --allow-root
- wp config create --dbhost=${MYSQL_IP} --dbname=wptest --dbuser=mysql --dbpass=mysql --allow-root
- wp config set WP_DEBUG true --raw --type=constant --allow-root
- cp -r /tmp/project/. ${APACHE_DOCUMENT_ROOT}/wp-content/plugins/${CI_PROJECT_NAME}
- chmod a+x ${CI_PROJECT_DIR}/tests/codeception/bootstrap.sh
- cd ${CI_PROJECT_DIR}
- . ./tests/codeception/bootstrap.sh
- mkdir -p ${CI_PROJECT_DIR}/tests/codeception/tests/_output
- mkdir -p ${CI_PROJECT_DIR}/tests/codeception/tests/acceptance
- mkdir -p ${CI_PROJECT_DIR}/tests/codeception/tests/functional
- mkdir -p ${CI_PROJECT_DIR}/tests/codeception/tests/unit
- chmod -R a+w ${APACHE_DOCUMENT_ROOT}/wp-content/uploads
- touch ${APACHE_DOCUMENT_ROOT}/wp-content/debug.log
- chmod a+w ${APACHE_DOCUMENT_ROOT}/wp-content/debug.log
- echo "End before"
- cd ${CI_PROJECT_DIR}
script:
- vendor/bin/codecept run --report --steps --xml --html
codeception test:
<<: *job-codeception-test
script:
- vendor/bin/codecept run --steps --xml --html -d
codeception test latest woocommerce:
<<: *job-codeception-test
variables:
WP_CLI_CACHE_DIR: /cache/wp-cli
APACHE_DOCUMENT_ROOT: ${CI_PROJECT_DIR}/tests/wordpress
CI_DEBUG_SERVICES: trace
SCREEN_WIDTH: 1200
SCREEN_HEIGHT: 1600
WOOCOMMERCE_VERSION: github
allow_failure: true
script:
- vendor/bin/codecept run --steps --xml --html -d
include: 'https://gitlab.com/wpdesk/gitlab-ci/raw/master/gitlab-ci-1.2.yml'
include:
- project: 'wpdesk/gitlab-ci'
ref: 'master'
file: '/gitlab-ci-1.2.yml'
deploy to repository:
when: on_success
......
include: 'https://gitlab.com/wpdesk/gitlab-ci/raw/master/gitlab-ci-1.2.yml'
include:
- project: 'wpdesk/gitlab-ci'
ref: 'master'
file: '/gitlab-ci-1.2.yml'
deploy to shop:
when: on_success
......
.template: &job-codeception-test
image: wpdesknet/wordpresscli:24
cache:
key: ${CI_PROJECT_NAME}-vendor
paths:
- vendor/
variables:
WP_CLI_CACHE_DIR: /cache/wp-cli
APACHE_DOCUMENT_ROOT: ${CI_PROJECT_DIR}/tests/wordpress
CI_DEBUG_SERVICES: trace
SCREEN_WIDTH: 1200
SCREEN_HEIGHT: 1600
services:
- name: mysql:5.6
alias: mysqltests
- name: wpdesknet/wordpress:49
alias: wootests
- name: selenium/standalone-chrome:3.141.59-oxygen
alias: chrome
artifacts:
when: always
expire_in: 1 month
name: "acceptance logs"
paths:
- tests/codeception/tests/_output
- ${APACHE_DOCUMENT_ROOT}/wp-content/debug.log
- ${APACHE_DOCUMENT_ROOT}/wp-content/uploads/wpdesk-logs/wpdesk_debug.log
reports:
junit: tests/codeception/tests/_output/report.xml
stage: tests
except:
variables:
- $DISABLE_CODECEPTION
allow_failure: false
interruptible: true
before_script:
- 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)
- cd ${CI_PROJECT_DIR}
- mkdir -p /tmp/project
- cp -r ${CI_PROJECT_DIR}/. /tmp/project
- cd /tmp/project
- COMPOSER_MEMORY_LIMIT=-1 composer install --no-progress --prefer-dist --no-dev
- cd ${CI_PROJECT_DIR}
- mkdir -p ${APACHE_DOCUMENT_ROOT}
- cd ${APACHE_DOCUMENT_ROOT}
- wp core download ${WORDPRESS_CLI_PARAMETERS} --allow-root
- wp config create --dbhost=${MYSQL_IP} --dbname=wptest --dbuser=mysql --dbpass=mysql --allow-root
- wp config set WP_DEBUG true --raw --type=constant --allow-root
- cp -r /tmp/project/. ${APACHE_DOCUMENT_ROOT}/wp-content/plugins/${CI_PROJECT_NAME}
- chmod a+x ${CI_PROJECT_DIR}/tests/codeception/bootstrap.sh
- cd ${CI_PROJECT_DIR}
- . ./tests/codeception/bootstrap.sh
- mkdir -p ${CI_PROJECT_DIR}/tests/codeception/tests/_output
- mkdir -p ${CI_PROJECT_DIR}/tests/codeception/tests/acceptance
- mkdir -p ${CI_PROJECT_DIR}/tests/codeception/tests/functional
- mkdir -p ${CI_PROJECT_DIR}/tests/codeception/tests/unit
- chmod -R a+w ${APACHE_DOCUMENT_ROOT}/wp-content/uploads
- touch ${APACHE_DOCUMENT_ROOT}/wp-content/debug.log
- chmod a+w ${APACHE_DOCUMENT_ROOT}/wp-content/debug.log
- echo "End before"
- cd ${CI_PROJECT_DIR}
script:
- vendor/bin/codecept run --steps --xml --html -d
.template: &job-codeception-test-latest-woocommerce
<<: *job-codeception-test
variables:
WP_CLI_CACHE_DIR: /cache/wp-cli
APACHE_DOCUMENT_ROOT: ${CI_PROJECT_DIR}/tests/wordpress
CI_DEBUG_SERVICES: trace
SCREEN_WIDTH: 1200
SCREEN_HEIGHT: 1600
WOOCOMMERCE_VERSION: github
allow_failure: true
codeception test:
<<: *job-codeception-test
only:
refs:
- master
- devel
codeception test latest woocommerce:
<<: *job-codeception-test-latest-woocommerce
only:
refs:
- master
- devel
codeception test manual:
<<: *job-codeception-test
when: manual
allow_failure: true
except:
refs:
- master
- devel
variables:
- $DISABLE_CODECEPTION
codeception test latest woocommerce manual:
<<: *job-codeception-test-latest-woocommerce
when: manual
allow_failure: true
except:
refs:
- master
- devel
variables:
- $DISABLE_CODECEPTION
.template: &job-test-template
cache:
key: ${CI_PROJECT_NAME}-vendor
paths:
- vendor/
stage: tests
coverage: '/^\s*Lines:\s*\d+.\d+\%/'
artifacts:
reports:
junit: tmp_artifacts/report.xml
interruptible: true
.template: &job-test-integration-template
<<: *job-test-template
dependencies:
- prepare prefixed vendor
services:
- mysql:5.6
before_script:
- export DEPENDENT_PLUGINS_DIR=${CI_PROJECT_DIR}/tests/dependent_plugins
- echo ${WPDESK_CI_VERSION}
- ls -l
- php --version
- cat /tmp/wordpress-develop/src/wp-includes/version.php
- cat /tmp/woocommerce/woocommerce.php
- COMPOSER_MEMORY_LIMIT=-1 composer install --no-progress --prefer-dist
- ln -s $CI_PROJECT_DIR /tmp/wordpress-develop/src/wp-content/plugins/$CI_PROJECT_NAME
script:
- vendor/bin/phpunit -d memory_limit=-1 --configuration phpunit-integration.xml --coverage-text --colors=never --log-junit tmp_artifacts/report.xml
only:
refs:
- master
except:
variables:
- $DISABLE_COVERAGE
.template: &job-test-integration-template-fast
<<: *job-test-integration-template
script:
- vendor/bin/phpunit -d memory_limit=-1 --configuration phpunit-integration.xml --no-coverage --log-junit tmp_artifacts/report.xml
except:
- tags
only:
.template: &integration_test_lastest
<<: *job-test-integration-template-fast
image: wpdesknet/phpunit-woocommerce:0-0
except:
variables:
- $DISABLE_INTEGRATION_TESTS
.template: &integration_test_lastest_coverage
<<: *job-test-integration-template
image: wpdesknet/phpunit-woocommerce:0-0
except:
variables:
- $DISABLE_INTEGRATION_TESTS
- $DISABLE_COVERAGE
.template: &integration_test_php7-1_wc-1
<<: *job-test-integration-template-fast
image: wpdesknet/phpunit-woocommerce:1-1
except:
variables:
- $DISABLE_INTEGRATION_TESTS
.template: &integration_test_php7_wc-2
<<: *job-test-integration-template-fast
image: wpdesknet/phpunit-woocommerce:2-2
except:
variables:
- $DISABLE_INTEGRATION_TESTS
.template: &integration_test_php-7_wc-3
<<: *job-test-integration-template-fast
image: wpdesknet/phpunit-woocommerce:2-3
except:
variables:
- $DISABLE_INTEGRATION_TESTS
.template: &integration_test_php5-6
<<: *job-test-integration-template-fast
image: wpdesknet/phpunit-woocommerce:3-0
except:
variables:
- $DISABLE_INTEGRATION_TESTS
.template: &integration_test_php5-5
<<: *job-test-integration-template-fast
image: wpdesknet/phpunit-woocommerce:4-0
except:
variables:
- $DISABLE_PHP_5_5
- $DISABLE_INTEGRATION_TESTS
.template: &integration_test_current_woocommerce
<<: *job-test-integration-template-fast
image: wpdesknet/phpunit-woocommerce:0-0
allow_failure: true
before_script:
- export DEPENDENT_PLUGINS_DIR=${CI_PROJECT_DIR}/tests/dependent_plugins
- cd ${CI_PROJECT_DIR}
- mkdir -p .tmp
- cd .tmp
- if [[ ! -d woocommerce ]]; then git clone https://github.com/woocommerce/woocommerce.git; fi
- cd woocommerce
- git pull
- ln -s ${CI_PROJECT_DIR}/.tmp/woocommerce /tmp/woocommerce
- cat /tmp/wordpress-develop/src/wp-includes/version.php
- cat /tmp/woocommerce/woocommerce.php
- cd ${CI_PROJECT_DIR}
- COMPOSER_MEMORY_LIMIT=-1 composer install --no-progress --prefer-dist
- ln -s $CI_PROJECT_DIR /tmp/wordpress-develop/src/wp-content/plugins/$CI_PROJECT_NAME
except:
variables:
- $DISABLE_INTEGRATION_TESTS
integration test lastest:
<<: *integration_test_lastest
only:
refs:
- master
- devel
integration test lastest coverage:
<<: *integration_test_lastest_coverage
only:
refs:
- master
- devel
integration test php7-1 wc-1:
<<: *integration_test_php7-1_wc-1
only:
refs:
- master
- devel
integration test php7 wc-2:
<<: *integration_test_php7_wc-2
only:
refs:
- master
- devel
integration test php-7 wc-3:
<<: *integration_test_php-7_wc-3
only:
refs:
- master
- devel
integration test php5-6:
<<: *integration_test_php5-6
only:
refs:
- master
- devel
integration test php5-5:
<<: *integration_test_php5-5
only:
refs:
- master
- devel
integration test current woocommerce:
<<: *integration_test_current_woocommerce
only:
refs:
- master
- devel
integration test lastest manual:
<<: *integration_test_lastest
when: manual
allow_failure: true
except:
refs:
- master
- devel
variables:
- $DISABLE_INTEGRATION_TESTS
integration test lastest coverage manual:
<<: *integration_test_lastest_coverage
when: manual
allow_failure: true
except:
refs:
- master
- devel
variables:
- $DISABLE_INTEGRATION_TESTS
integration test php7-1 wc-1 manual:
<<: *integration_test_php7-1_wc-1
when: manual
allow_failure: true
except:
refs:
- master
- devel
variables:
- $DISABLE_INTEGRATION_TESTS
integration test php7 wc-2 manual:
<<: *integration_test_php7_wc-2
when: manual
allow_failure: true
except:
refs:
- master
- devel
variables:
- $DISABLE_INTEGRATION_TESTS
integration test php-7 wc-3 manual:
<<: *integration_test_php-7_wc-3
when: manual
allow_failure: true
except:
refs:
- master
- devel
variables:
- $DISABLE_INTEGRATION_TESTS
integration test php5-6 manual:
<<: *integration_test_php5-6
when: manual
allow_failure: true
except:
refs:
- master
- devel
variables:
- $DISABLE_INTEGRATION_TESTS
integration test php5-5 manual:
<<: *integration_test_php5-5
when: manual
allow_failure: true
except:
refs:
- master
- devel
variables:
- $DISABLE_PHP_5_5
- $DISABLE_INTEGRATION_TESTS
integration test current woocommerce manual:
<<: *integration_test_current_woocommerce
when: manual
allow_failure: true
except:
refs:
- master
- devel
variables:
- $DISABLE_INTEGRATION_TESTS
.template: &job-test-template
cache:
key: ${CI_PROJECT_NAME}-vendor
paths:
- vendor/
stage: tests
coverage: '/^\s*Lines:\s*\d+.\d+\%/'
artifacts:
reports:
junit: tmp_artifacts/report.xml
interruptible: true
.template: &job-test-unit-template
<<: *job-test-template
script:
- echo ${WPDESK_CI_VERSION}
- ls -l
- php --version
- cat /tmp/wordpress-develop/src/wp-includes/version.php
- cat /tmp/woocommerce/woocommerce.php
- COMPOSER_MEMORY_LIMIT=-1 composer install --no-progress --prefer-dist
- vendor/bin/phpunit -d memory_limit=-1 --configuration phpunit-unit.xml --coverage-text --colors=never --log-junit tmp_artifacts/report.xml
only:
- master
except:
variables:
- $DISABLE_COVERAGE
.template: &job-test-unit-template-fast
<<: *job-test-template
script:
- echo ${WPDESK_CI_VERSION}
- ls -l
- php --version
- cat /tmp/wordpress-develop/src/wp-includes/version.php
- cat /tmp/woocommerce/woocommerce.php
- COMPOSER_MEMORY_LIMIT=-1 composer install --no-progress --prefer-dist
- vendor/bin/phpunit -d memory_limit=-1 --configuration phpunit-unit.xml --no-coverage --log-junit tmp_artifacts/report.xml
unit test lastest:
<<: *job-test-unit-template-fast
image: wpdesknet/phpunit-woocommerce:0-0
only:
refs:
- master
- devel
unit test lastest coverage:
<<: *job-test-unit-template
image: wpdesknet/phpunit-woocommerce:0-0
only:
refs:
- master
- devel
unit test lastest manual:
<<: *job-test-unit-template-fast
image: wpdesknet/phpunit-woocommerce:0-0
when: manual
allow_failure: true
except:
refs:
- master
- devel
variables:
- $DISABLE_COVERAGE
unit test lastest coverage manual:
<<: *job-test-unit-template
image: wpdesknet/phpunit-woocommerce:0-0
when: manual
allow_failure: true
except:
refs:
- master
- devel
variables:
- $DISABLE_COVERAGE
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment