Skip to content
Snippets Groups Projects
Select Git revision
  • a1b8491a7b3ffad63f5fc5a328d3c0ba17595d6e
  • 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 2.39 KiB
    .template: &job-test-template
      tags:
        - unit
      stage: tests
      except:
        variables:
          - $IS_NPM_LIBRARY
      coverage: '/^\s*Lines:\s*\d+.\d+\%/'
      artifacts:
        reports:
          junit: tmp_artifacts/report.xml
      interruptible: true
    
    .template: &job-test-unit-template
      <<: *job-test-template
      before_script:
        - echo ${WPDESK_CI_VERSION}
        - ls -l
        - php --version
        - cat /tmp/wordpress-develop/src/wp-includes/version.php
        - cat /tmp/woocommerce/woocommerce.php
        - 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 --coverage-text --colors=never --log-junit tmp_artifacts/report.xml
      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/report.xml;type=text/xml;type=text/xml;filename=${CI_PROJECT_NAME}-${CI_COMMIT_REF_SLUG}-unit.xml"; fi'
      only:
        - master
        - main
      except:
        variables:
          - $DISABLE_COVERAGE
    
    .template: &job-test-unit-template-fast
      <<: *job-test-template
      script:
        - echo ${WPDESK_CI_VERSION}
        - ls -l
        - php --version
        - cat /tmp/wordpress-develop/src/wp-includes/version.php
        - cat /tmp/woocommerce/woocommerce.php
        - vendor/bin/phpunit  -d memory_limit=-1 --configuration phpunit-unit.xml --no-coverage --log-junit tmp_artifacts/report.xml
    
    unit test lastest:
      <<: *job-test-unit-template-fast
      image: wpdesknet/phpunit-woocommerce:0-0
      only:
        refs:
          - devel
          - tags
      except:
        variables:
          - $IS_NPM_LIBRARY
    
    unit test lastest coverage:
      <<: *job-test-unit-template
      image: wpdesknet/phpunit-woocommerce:0-0
      only:
        refs:
          - master
          - main
    
    unit test lastest manual:
      <<: *job-test-unit-template-fast
      image: wpdesknet/phpunit-woocommerce:0-0
      when: manual
      allow_failure: true
      except:
        refs:
          - master