Skip to content
Snippets Groups Projects
Select Git revision
  • ca2415a05a1918fb177b5dc0c4ee5c1d1555d971
  • 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

unit.yml

Blame
  • unit.yml 1.55 KiB
    test:unit:
      image: gitlab.wpdesk.dev:5050/wpdesk/docker-tests/php-box:8.3.2
      variables:
        PHPUNIT_OPTIONS: "--no-coverage"
      tags:
        - unit
      stage: tests
      rules:
        - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
          when: never
        - if: $IS_NPM_LIBRARY
          when: never
        - if: $CI_COMMIT_BRANCH == "devel"
          exists:
            - phpunit-unit.xml
        - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_TAG
          exists:
            - phpunit-unit.xml
          variables:
            PHPUNIT_OPTIONS: "--coverage-text --coverage-html tmp_artifacts/unit/coverage --colors=never"
        - exists:
            - phpunit-unit.xml
          when: manual
          allow_failure: true
      coverage: '/^\s*Lines:\s*\d+.\d+\%/'
      artifacts:
        paths:
          - tmp_artifacts/unit
        reports:
          junit: tmp_artifacts/unit/report.xml
        expire_in: 3 mos
      interruptible: true
      before_script:
        - echo ${WPDESK_CI_VERSION}
        - php --version
        - echo "xdebug.mode=coverage" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
      script:
        - vendor/bin/phpunit -d memory_limit=-1 --configuration phpunit-unit.xml --log-junit tmp_artifacts/unit/report.xml $PHPUNIT_OPTIONS
      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=file=@tmp_artifacts/unit/report.xml;type=text/xml;type=text/xml;filename=${CI_PROJECT_NAME}-${CI_COMMIT_REF_SLUG}-unit.xml"; fi'