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

Feature/prepare

parent 0475f6b6
No related branches found
No related tags found
No related merge requests found
...@@ -3,4 +3,12 @@ variables: ...@@ -3,4 +3,12 @@ variables:
DISABLE_ACCEPTANCE: 1 DISABLE_ACCEPTANCE: 1
DISABLE_PHP_5_5: 1 DISABLE_PHP_5_5: 1
include: '${CI_SERVER_URL}/wpdesk/gitlab-ci/raw/master/gitlab-ci-1.2.yml' fake job:
image: composer:2.0
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: never
- if: $CI_PROJECT_NAME == 'gitlab-ci'
when: always
script:
- echo "It works"
...@@ -15,7 +15,7 @@ variables: ...@@ -15,7 +15,7 @@ variables:
stages: stages:
- prepare-vendor - prepare-vendor
- prepare-node - prepare-node
- prepare-translations - prepare-translations-and-tests
- tools - tools
- tests - tests
- pre-deploy - pre-deploy
......
...@@ -6,11 +6,10 @@ ...@@ -6,11 +6,10 @@
- vendor_prefixed - vendor_prefixed
- lang - lang
- assets - assets
- tests/dependent_plugins
prepare prefixed vendor: prepare prefixed vendor:
<<: *job-prepare <<: *job-prepare
image: gitlab.wpdesk.dev:5050/wpdesk/docker-tests/phpunit-woocommerce:0 image: composer:2.0
tags: tags:
- vendor - vendor
stage: prepare-vendor stage: prepare-vendor
...@@ -19,15 +18,10 @@ prepare prefixed vendor: ...@@ -19,15 +18,10 @@ prepare prefixed vendor:
- $IS_NPM_LIBRARY - $IS_NPM_LIBRARY
interruptible: true interruptible: true
script: script:
- export DEPENDENT_PLUGINS_DIR=${CI_PROJECT_DIR}/tests/dependent_plugins
- echo ${DEPENDENT_PLUGINS_DIR}
- echo ${WPDESK_CI_VERSION} - echo ${WPDESK_CI_VERSION}
- php --version - php --version
- ls -l - ls -l
- COMPOSER_MEMORY_LIMIT=-1 && php -d memory_limit=-1 /usr/local/bin/composer install - COMPOSER_MEMORY_LIMIT=-1 && composer install
- mkdir -p ${DEPENDENT_PLUGINS_DIR}
- if [[ -f tests/integration/prepare.sh ]]; then sh tests/integration/prepare.sh; fi
- if [[ -f tests/codeception/prepare.sh ]]; then sh tests/codeception/prepare.sh; fi
prepare npm assets: prepare npm assets:
<<: *job-prepare <<: *job-prepare
...@@ -57,7 +51,7 @@ prepare translations: ...@@ -57,7 +51,7 @@ prepare translations:
image: composer:2.0 image: composer:2.0
tags: tags:
- vendor - vendor
stage: prepare-translations stage: prepare-translations-and-tests
dependencies: dependencies:
- prepare npm assets - prepare npm assets
except: except:
...@@ -69,3 +63,29 @@ prepare translations: ...@@ -69,3 +63,29 @@ prepare translations:
- composer generate-pot - composer generate-pot
- composer merge-translations - composer merge-translations
- composer generate-pot - composer generate-pot
prepare tests:
<<: *job-prepare
image: wpdesknet/phpunit-woocommerce:0-0
tags:
- vendor
stage: prepare-translations-and-tests
needs:
- prepare prefixed vendor
artifacts:
name: "dependent_plugins"
paths:
- tests/dependent_plugins
except:
variables:
- $IS_LIBRARY
- $IS_NPM_LIBRARY
interruptible: true
script:
- echo "xdebug.max_nesting_level=2560" >> /usr/local/etc/php/php.ini
- export DEPENDENT_PLUGINS_DIR=${CI_PROJECT_DIR}/tests/dependent_plugins
- echo ${DEPENDENT_PLUGINS_DIR}
- echo ${WPDESK_CI_VERSION}
- mkdir -p ${DEPENDENT_PLUGINS_DIR}
- if [[ -f tests/integration/prepare.sh ]]; then sh tests/integration/prepare.sh; fi
- if [[ -f tests/codeception/prepare.sh ]]; then sh tests/codeception/prepare.sh; fi
...@@ -13,7 +13,8 @@ integration codeception tests: ...@@ -13,7 +13,8 @@ integration codeception tests:
- name: mysql:5.6 - name: mysql:5.6
alias: mysqltests alias: mysqltests
command: [--max-allowed-packet=67108864] command: [--max-allowed-packet=67108864]
dependencies: needs:
- prepare tests
- prepare translations - prepare translations
artifacts: artifacts:
when: always when: always
...@@ -32,6 +33,7 @@ integration codeception tests: ...@@ -32,6 +33,7 @@ integration codeception tests:
allow_failure: false allow_failure: false
interruptible: true interruptible: true
before_script: before_script:
- echo "xdebug.max_nesting_level=2560" >> /usr/local/etc/php/php.ini
- export DEPENDENT_PLUGINS_DIR=${CI_PROJECT_DIR}/tests/dependent_plugins - export DEPENDENT_PLUGINS_DIR=${CI_PROJECT_DIR}/tests/dependent_plugins
- export MYSQL_IP=$(awk '/^[[:space:]]*($|#)/{next} /mysqltests/{print $1; exit}' /etc/hosts) - export MYSQL_IP=$(awk '/^[[:space:]]*($|#)/{next} /mysqltests/{print $1; exit}' /etc/hosts)
- export WOOTESTS_IP=127.0.0.1 - export WOOTESTS_IP=127.0.0.1
......
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
image: image:
name: wpdesknet/codeception:11 name: wpdesknet/codeception:11
entrypoint: [""] entrypoint: [""]
dependencies: needs:
- prepare npm assets
- prepare translations - prepare translations
- prepare tests
variables: variables:
WP_CLI_CACHE_DIR: /cache/wp-cli WP_CLI_CACHE_DIR: /cache/wp-cli
APACHE_DOCUMENT_ROOT: ${CI_PROJECT_DIR}/tests/wordpress APACHE_DOCUMENT_ROOT: ${CI_PROJECT_DIR}/tests/wordpress
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
allow_failure: false allow_failure: false
interruptible: true interruptible: true
script: script:
- echo "xdebug.max_nesting_level=2560" >> /usr/local/etc/php/php.ini
- export DEPENDENT_PLUGINS_DIR=${CI_PROJECT_DIR}/tests/dependent_plugins - export DEPENDENT_PLUGINS_DIR=${CI_PROJECT_DIR}/tests/dependent_plugins
- mkdir -p /cache/wp-cli - mkdir -p /cache/wp-cli
- export MYSQL_IP=$(awk '/^[[:space:]]*($|#)/{next} /mysqltests/{print $1; exit}' /etc/hosts) - export MYSQL_IP=$(awk '/^[[:space:]]*($|#)/{next} /mysqltests/{print $1; exit}' /etc/hosts)
...@@ -104,6 +105,7 @@ ...@@ -104,6 +105,7 @@
- name: selenium/standalone-chrome:latest - name: selenium/standalone-chrome:latest
alias: chrome alias: chrome
script: script:
- echo "xdebug.max_nesting_level=2560" >> /usr/local/etc/php/php.ini
- export DEPENDENT_PLUGINS_DIR=${CI_PROJECT_DIR}/tests/dependent_plugins - export DEPENDENT_PLUGINS_DIR=${CI_PROJECT_DIR}/tests/dependent_plugins
- mkdir -p /cache/wp-cli - mkdir -p /cache/wp-cli
- export MYSQL_IP=$(awk '/^[[:space:]]*($|#)/{next} /mysqltests/{print $1; exit}' /etc/hosts) - export MYSQL_IP=$(awk '/^[[:space:]]*($|#)/{next} /mysqltests/{print $1; exit}' /etc/hosts)
......
...@@ -3,8 +3,9 @@ ...@@ -3,8 +3,9 @@
- codeception - codeception
- $TESTS_TAG - $TESTS_TAG
image: wpdesknet/wordpresscli:25 image: wpdesknet/wordpresscli:25
dependencies: needs:
- prepare npm assets - prepare translations
- prepare tests
- build to deploy - build to deploy
variables: variables:
WP_CLI_CACHE_DIR: /cache/wp-cli WP_CLI_CACHE_DIR: /cache/wp-cli
......
...@@ -28,12 +28,16 @@ ...@@ -28,12 +28,16 @@
reports: reports:
junit: tests/codeception/tests/_output/report.xml junit: tests/codeception/tests/_output/report.xml
stage: tests stage: tests
needs:
- prepare translations
- prepare tests
except: except:
variables: variables:
- $DISABLE_CODECEPTION - $DISABLE_CODECEPTION
allow_failure: false allow_failure: false
interruptible: true interruptible: true
before_script: before_script:
- echo "xdebug.max_nesting_level=2560" >> /usr/local/etc/php/php.ini
- export DEPENDENT_PLUGINS_DIR=${CI_PROJECT_DIR}/tests/dependent_plugins - export DEPENDENT_PLUGINS_DIR=${CI_PROJECT_DIR}/tests/dependent_plugins
- mkdir -p /cache/wp-cli - mkdir -p /cache/wp-cli
- export MYSQL_IP=$(awk '/^[[:space:]]*($|#)/{next} /mysqltests/{print $1; exit}' /etc/hosts) - export MYSQL_IP=$(awk '/^[[:space:]]*($|#)/{next} /mysqltests/{print $1; exit}' /etc/hosts)
......
...@@ -7,8 +7,9 @@ ...@@ -7,8 +7,9 @@
interruptible: true interruptible: true
tags: tags:
- integration - integration
dependencies: needs:
- prepare translations - prepare translations
- prepare tests
services: services:
- mysql:5.6 - mysql:5.6
before_script: before_script:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment