Skip to content
Snippets Groups Projects
Verified Commit 7a02351e authored by Bartek Jaskulski's avatar Bartek Jaskulski
Browse files

feat: remove smoke tests


Smoke tests in this configuration doesn't make much sense, as in fact it
is just an outdated version of regular codeception acceptance tests. The
purpose of smoke tests is to randomize access or patterns of plugin
usage and this is not fulfilled by this job. Instead, it only is
a maintenance burden, when requiring an update.

Signed-off-by: default avatarBart Jaskulski <bjaskulski@protonmail.com>
parent a5230304
Branches
Tags
No related merge requests found
......@@ -20,7 +20,6 @@ stages:
- tools
- tests
- pre-deploy
- smoke-tests
- deploy
- post-deploy
......@@ -38,7 +37,6 @@ include:
- '/includes/tests/codeception-integration.yml'
- '/includes/tests/codeception.yml'
- '/includes/tests/codeception-parallel.yml'
- '/includes/tests/codeception-smoke.yml'
- '/includes/tests/integration.yml'
- '/includes/deploy.yml'
- '/includes/pages.yml'
......
.template: &job-codeception-smoke-test
tags:
- codeception
- $TESTS_TAG
image: wpdesknet/wordpresscli:25
needs:
- prepare prefixed vendor
- build to deploy
- job: prepare tests
optional: true
- job: prepare npm assets
optional: true
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: smoke-tests
except:
variables:
- $DISABLE_CODECEPTION
- $DISABLE_SMOKE_TESTS
- $IS_LIBRARY
- $IS_NPM_LIBRARY
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)
- export TEST_SITE_WP_URL="http://${WOOTESTS_IP}"
- 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;
- if [ -d "${APACHE_DOCUMENT_ROOT}/wp-content/plugins/$CI_PROJECT_NAME" ]; then rm -r ${APACHE_DOCUMENT_ROOT}/wp-content/plugins/$CI_PROJECT_NAME; fi
- cp -r ${CI_PROJECT_DIR}/release/* ${APACHE_DOCUMENT_ROOT}/wp-content/plugins/
- 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 -f --verbose
after_script:
- !reference [.after-codeception, after_script]
- 'if [[ ${REPORTPORTAL_AUTHORIZATION} && ${REPORTPORTAL_PROJECT} ]]; then curl -X POST "http://195.201.225.204:8080/api/v1/${REPORTPORTAL_PROJECT}/launch/import" -H "accept: */*" -H "Content-Type: multipart/form-data" -H "${REPORTPORTAL_AUTHORIZATION}" -F "file=@tests/codeception/tests/_output/report.xml;type=text/xml;filename=${CI_PROJECT_NAME}-${CI_COMMIT_REF_SLUG}-codeception.xml"; fi'
codeception smoke test:
<<: *job-codeception-smoke-test
only:
refs:
- tags
codeception smoke test recorded manual:
<<: *job-codeception-smoke-test
when: manual
allow_failure: true
script:
- cp vendor/wpdesk/wp-codeception/configuration/codeception-with-recorder.dist.yml codeception-with-recorder.dist.yml
- vendor/bin/codecept -c codeception-with-recorder.dist.yml run --steps --xml --html -d
after_script:
- rm -r ${APACHE_DOCUMENT_ROOT}
- 'if [[ ${REPORTPORTAL_AUTHORIZATION} && ${REPORTPORTAL_PROJECT} ]]; then curl -X POST "http://195.201.225.204:8080/api/v1/${REPORTPORTAL_PROJECT}/launch/import" -H "accept: */*" -H "Content-Type: multipart/form-data" -H "${REPORTPORTAL_AUTHORIZATION}" -F "file=@tests/codeception/tests/_output/report.xml;type=text/xml;filename=${CI_PROJECT_NAME}-${CI_COMMIT_REF_SLUG}-codeception.xml"; fi'
- 'curl -X POST --data-urlencode "payload={\"text\": \"Smoke testy projektu <${CI_PROJECT_URL}|${CI_PROJECT_NAME}> zostały wykonane. <${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/browse/tests/codeception/tests/_output/records.html|Zapis testu>\", }" https://hooks.slack.com/services/${SLACK_AUTH}'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment