|
32 | 32 | name: Setup folder structure and override file
|
33 | 33 | command: |
|
34 | 34 | mkdir ~/Sites
|
| 35 | + mkdir ~/Sites/unit-tests |
| 36 | + mkdir ~/Sites/unit-coverage |
35 | 37 | cd ~/Sites
|
36 | 38 | cat \<<EOF > compose.override.yml
|
37 | 39 | services:
|
|
50 | 52 | bin/cli git clone [email protected]:magento/magento2.git .
|
51 | 53 | bin/cli git checkout tags/<< parameters.magento-version >>
|
52 | 54 | bin/composer require "algolia/algoliasearch-magento-2:dev-${CIRCLE_BRANCH}"
|
| 55 | + bin/composer global require --dev phpunit/phpunit |
53 | 56 | - run:
|
54 | 57 | name: Enable AlgoliaSearch extension
|
55 | 58 | working_directory: ~/Sites
|
|
61 | 64 | command: |
|
62 | 65 | bin/magento setup:di:compile
|
63 | 66 | bin/magento module:status Algolia_AlgoliaSearch
|
| 67 | + - run: |
| 68 | + name: Run Unit Tests and copy results to CircleCI |
| 69 | + working_directory: ~/Sites |
| 70 | + command: | |
| 71 | + bin/cli vendor/bin/phpunit --log-junit /var/www/html/dev/tests/unit/report/junit.xml /var/www/html/vendor/algolia/algoliasearch-magento-2/Test/Unit |
| 72 | + docker cp $(docker compose ps -q phpfpm):/var/www/html/dev/tests/unit/report/junit.xml ./unit-tests/ |
| 73 | + - store_test_results: |
| 74 | + path: ~/Sites/unit-tests |
| 75 | + - run: |
| 76 | + name: Run Unit Test Coverage and copy results to CircleCI |
| 77 | + working_directory: ~/Sites |
| 78 | + command: | |
| 79 | + bin/cli php -d xdebug.mode=coverage vendor/bin/phpunit --log-junit /var/www/html/dev/tests/unit/report/junit.xml --coverage-html /var/www/html/dev/tests/unit/report --coverage-filter /var/www/html/vendor/algolia/algoliasearch-magento-2/ /var/www/html/vendor/algolia/algoliasearch-magento-2/Test/Unit |
| 80 | + docker cp $(docker compose ps -q phpfpm):/var/www/html/dev/tests/unit/report ./unit-coverage/ |
| 81 | + - store_artifacts: |
| 82 | + path: ~/Sites/unit-coverage/report |
| 83 | + destination: test-results/magento-<< parameters.magento-version >>-php-<< parameters.php-version >> |
64 | 84 |
|
65 | 85 | workflows:
|
66 |
| - magento-build-and-test: |
| 86 | + magento-build-and-test-workflow: |
67 | 87 | jobs:
|
68 | 88 | - magento-build:
|
69 | 89 | matrix:
|
|
0 commit comments