From baa53e3b0d7367fd74519745e8ecabc2f7f0a788 Mon Sep 17 00:00:00 2001 From: Bart Jaskulski <bjaskulski@protonmail.com> Date: Tue, 7 Nov 2023 14:32:58 +0100 Subject: [PATCH] fix: silence errors after moving tests artifacts Signed-off-by: Bart Jaskulski <bjaskulski@protonmail.com> --- gitlab-ci-1.2.yml | 3 ++- includes/mixins/.after-codeception.yml | 5 +++++ includes/tests/codeception-integration.yml | 6 ++---- includes/tests/codeception-parallel.yml | 8 ++------ includes/tests/codeception-smoke.yml | 4 +--- includes/tests/codeception.yml | 4 +--- 6 files changed, 13 insertions(+), 17 deletions(-) create mode 100644 includes/mixins/.after-codeception.yml diff --git a/gitlab-ci-1.2.yml b/gitlab-ci-1.2.yml index b62f253..b4cf115 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 0000000..aa71574 --- /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 de3a088..4e322d8 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 e4d4537..3731748 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 70eb974..d245df8 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 e571975..6d2f3b5 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: -- GitLab