Skip to content
Snippets Groups Projects
Select Git revision
  • 73e46c779aa581cea978f77cce671c2e03971a6d
  • master default protected
  • feat/npm-publish
  • feat/demo-deploy
  • change-demo-deploy
  • remove-smoke
  • feat/acceptance-tests
  • feature/deploy-composer.json
  • feature/mysql-bin-logs
  • skip-codecept-for-libs
  • include-composer-json
  • exclude-wp-assets
  • update_codecept_image
  • fix/silenced-copy
  • remove-free-translations
  • codeception-with-optional-step
  • improve-parallelization
  • linter-exit
  • change-images
  • fix/linter
  • globally-raise-mem-limit
  • no-symlink2
22 results

codeception-parallel.yml

Blame
  • codeception-parallel.yml 7.49 KiB
    .template: &job-codeception-test-parallel
      tags:
        - codeception
        - $TESTS_TAG
      image:
        name: wpdesknet/codeception:11
        entrypoint: [""]
      dependencies:
        - prepare npm assets
        - prepare translations
      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: 1200
      services:
        - name: mysql:5.6
          alias: mysqltests
        - name: wpdesknet/wordpress:50
          alias: wootests
        - name: selenium/standalone-chrome:latest
          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
      allow_failure: false
      interruptible: true
      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 /project
        - cd ${CI_PROJECT_DIR}
        - mkdir -p ${APACHE_DOCUMENT_ROOT}
        - cd ${APACHE_DOCUMENT_ROOT}
        - cd ${CI_PROJECT_DIR}
        - composer prepare-wordpress-for-codeception
        - composer prepare-codeception-db
        - composer prepare-local-codeception-tests
        - 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}
        - composer prepare-parallel-codeception-tests 4
        - vendor/bin/codecept run acceptance $PARALLEL_JOB --steps --xml --html -f --verbose
      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'
    
    .template: &job-codeception-test-parallel-auto
      <<: *job-codeception-test-parallel
      only:
        refs:
          - master