diff --git a/gitlab-ci-1.2.yml b/gitlab-ci-1.2.yml index b62f253de2c8771a02509b055bb5906f99e2353d..b4cf115046f3a795762f0fefe5c9a6b70fb8498f 100644 --- a/gitlab-ci-1.2.yml +++ b/gitlab-ci-1.2.yml @@ -1,5 +1,5 @@ variables: - WPDESK_CI_VERSION: "2023.07.19" + WPDESK_CI_VERSION: "2023.11.07" MYSQL_ROOT_PASSWORD: "mysql" MYSQL_DATABASE: "wptest" MYSQL_USER: "mysql" @@ -41,3 +41,4 @@ include: - '/includes/tests/integration.yml' - '/includes/deploy.yml' - '/includes/pages.yml' + - '/includes/mixins/.after-codeception.yml' diff --git a/includes/mixins/.after-codeception.yml b/includes/mixins/.after-codeception.yml new file mode 100644 index 0000000000000000000000000000000000000000..aa71574c1b029372c24d3e00f96148b1406c7521 --- /dev/null +++ b/includes/mixins/.after-codeception.yml @@ -0,0 +1,5 @@ +.after-codeception: + after_script: + - cp ${APACHE_DOCUMENT_ROOT}/wp-content/debug.log tests/codeception/tests/_output/debug.log &>/dev/null || true + - cp ${APACHE_DOCUMENT_ROOT}/wp-content/uploads/wpdesk-logs/wpdesk_debug.log tests/codeception/tests/_output/wpdesk_debug.log &>/dev/null || true + - rm -r ${APACHE_DOCUMENT_ROOT} diff --git a/includes/tests/codeception-integration.yml b/includes/tests/codeception-integration.yml index de3a0880f9ed6ba57c34c5a09dca1c307aca5df7..4e322d8d6535894735f9850d853b51ccc2126d1c 100644 --- a/includes/tests/codeception-integration.yml +++ b/includes/tests/codeception-integration.yml @@ -5,6 +5,8 @@ integration codeception tests: image: name: wpdesknet/codeception:11 entrypoint: [""] + extends: + - .after-codeception variables: WP_CLI_CACHE_DIR: /cache/wp-cli APACHE_DOCUMENT_ROOT: ${CI_PROJECT_DIR}/tests/wordpress @@ -58,7 +60,3 @@ integration codeception tests: - cd ${CI_PROJECT_DIR} script: - vendor/bin/codecept run integration --steps --xml --html -f --verbose - after_script: - - cp ${APACHE_DOCUMENT_ROOT}/wp-content/debug.log tests/codeception/tests/_output/debug.log || true - - cp ${APACHE_DOCUMENT_ROOT}/wp-content/uploads/wpdesk-logs/wpdesk_debug.log tests/codeception/tests/_output/wpdesk_debug.log || true - - rm -r ${APACHE_DOCUMENT_ROOT} diff --git a/includes/tests/codeception-parallel.yml b/includes/tests/codeception-parallel.yml index e4d45373ef9457151af3ac08971075e7db0f5092..37317489caba3d1019bd8b0897981724ea00f0ae 100644 --- a/includes/tests/codeception-parallel.yml +++ b/includes/tests/codeception-parallel.yml @@ -120,9 +120,7 @@ prepare codeception parallel: - composer prepare-parallel-codeception-tests ${CI_NODE_TOTAL} - vendor/bin/codecept run acceptance $PARALLEL_JOB --steps --xml --html -f --verbose after_script: - - cp ${APACHE_DOCUMENT_ROOT}/wp-content/debug.log tests/codeception/tests/_output/debug.log || true - - cp ${APACHE_DOCUMENT_ROOT}/wp-content/uploads/wpdesk-logs/wpdesk_debug.log tests/codeception/tests/_output/wpdesk_debug.log || true - - rm -r ${APACHE_DOCUMENT_ROOT} + - !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' .template: &job-codeception-test-parallel-auto @@ -151,9 +149,7 @@ prepare codeception parallel: before_script: - cp vendor/wpdesk/wp-codeception/configuration/codeception-with-recorder.dist.yml codeception-with-recorder.dist.yml after_script: - - cp ${APACHE_DOCUMENT_ROOT}/wp-content/debug.log tests/codeception/tests/_output/debug.log || true - - cp ${APACHE_DOCUMENT_ROOT}/wp-content/uploads/wpdesk-logs/wpdesk_debug.log tests/codeception/tests/_output/wpdesk_debug.log || true - - rm -r ${APACHE_DOCUMENT_ROOT} + - !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' - 'curl -X POST --data-urlencode "payload={\"text\": \"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}' diff --git a/includes/tests/codeception-smoke.yml b/includes/tests/codeception-smoke.yml index 70eb97451ae95040bd0cf497475497324c8d199e..d245df8157168403b7d8682af0895bc44cafe712 100644 --- a/includes/tests/codeception-smoke.yml +++ b/includes/tests/codeception-smoke.yml @@ -70,9 +70,7 @@ script: - vendor/bin/codecept run --steps --xml --html -f --verbose after_script: - - cp ${APACHE_DOCUMENT_ROOT}/wp-content/debug.log tests/codeception/tests/_output/debug.log || true - - cp ${APACHE_DOCUMENT_ROOT}/wp-content/uploads/wpdesk-logs/wpdesk_debug.log tests/codeception/tests/_output/wpdesk_debug.log || true - - rm -r ${APACHE_DOCUMENT_ROOT} + - !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: diff --git a/includes/tests/codeception.yml b/includes/tests/codeception.yml index e5719752f333e332e1dc86bddb344647090be622..6d2f3b59a09d2dca56010a89fa5296a857b11a3d 100644 --- a/includes/tests/codeception.yml +++ b/includes/tests/codeception.yml @@ -77,9 +77,7 @@ script: - vendor/bin/codecept run --steps --xml --html -f --verbose after_script: - - cp ${APACHE_DOCUMENT_ROOT}/wp-content/debug.log tests/codeception/tests/_output/debug.log || true - - cp ${APACHE_DOCUMENT_ROOT}/wp-content/uploads/wpdesk-logs/wpdesk_debug.log tests/codeception/tests/_output/wpdesk_debug.log || true - - rm -r ${APACHE_DOCUMENT_ROOT} + - !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 test: