Add testRigor Integration to MFTF for Enhanced E2E Testing #256
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright © Magento, Inc. All rights reserved. | |
| # See COPYING.txt for license details. | |
| name: CI | |
| on: [pull_request] | |
| jobs: | |
| unit-tests: | |
| name: Unit Tests | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php-versions: ["8.2", "8.3", "8.4"] | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@master | |
| with: | |
| php-version: ${{ matrix.php-versions }} | |
| extensions: curl, dom, intl, json, openssl | |
| coverage: xdebug | |
| - name: Cache Composer packages | |
| id: composer-cache | |
| uses: actions/cache@v2 | |
| with: | |
| path: vendor | |
| key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-php- | |
| - name: Install dependencies | |
| if: steps.composer-cache.outputs.cache-hit != 'true' | |
| run: composer install --prefer-dist --no-progress --no-suggest | |
| - name: Run tests | |
| run: vendor/bin/phpunit --configuration dev/tests/phpunit.xml --testsuite unit --coverage-clover clover.xml | |
| # - name: Monitor coverage | |
| # if: github.event_name == 'pull_request' | |
| # uses: slavcodev/coverage-monitor-action@1.2.0 | |
| # with: | |
| # github_token: ${{ secrets.GITHUB_TOKEN }} | |
| # clover_file: "clover.xml" | |
| # threshold_alert: 10 | |
| # threshold_warning: 20 | |
| verification-tests: | |
| name: Verification Tests | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php-versions: ["8.2", "8.3", "8.4"] | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@master | |
| with: | |
| php-version: ${{ matrix.php-versions }} | |
| extensions: curl, dom, intl, json, openssl | |
| - name: Cache Composer packages | |
| id: composer-cache | |
| uses: actions/cache@v2 | |
| with: | |
| path: vendor | |
| key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-php- | |
| - name: Install dependencies | |
| if: steps.composer-cache.outputs.cache-hit != 'true' | |
| run: composer install --prefer-dist --no-progress --no-suggest | |
| - name: Run tests | |
| run: vendor/bin/phpunit --configuration dev/tests/phpunit.xml --testsuite verification | |
| static-tests: | |
| name: Static Tests | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php-versions: ["8.2", "8.3", "8.4"] | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@master | |
| with: | |
| php-version: ${{ matrix.php-versions }} | |
| extensions: curl, dom, intl, json, openssl | |
| - name: Cache Composer packages | |
| id: composer-cache | |
| uses: actions/cache@v2 | |
| with: | |
| path: vendor | |
| key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-php- | |
| - name: Install dependencies | |
| if: steps.composer-cache.outputs.cache-hit != 'true' | |
| run: composer install --prefer-dist --no-progress --no-suggest | |
| - name: Run tests | |
| run: bin/static-checks | |
| functional-tests: | |
| name: Functional Tests | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php-versions: ["8.2", "8.3", "8.4"] | |
| services: | |
| chrome: | |
| image: selenium/standalone-chrome:3.141.59-zirconium | |
| ports: | |
| - 4444:4444 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@master | |
| with: | |
| php-version: ${{ matrix.php-versions }} | |
| extensions: curl, dom, intl, json, openssl | |
| - name: Cache Composer packages | |
| id: composer-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: vendor | |
| key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-php- | |
| - name: Install dependencies | |
| if: steps.composer-cache.outputs.cache-hit != 'true' | |
| run: composer install --prefer-dist --no-progress --no-suggest | |
| - name: Run tests | |
| run: bin/functional | |
| testrigor-tests: | |
| name: testRigor Tests | |
| runs-on: ubuntu-latest | |
| env: | |
| # testRigor variables | |
| MAGENTO_TEST_SUITE_ID: ${{vars.MAGENTO_TEST_SUITE_ID}} | |
| MAGENTO_AUTH_TOKEN: ${{secrets.MAGENTO_AUTH_TOKEN}} | |
| # MFTF Magento connection variables | |
| MAGENTO_BASE_URL: ${{vars.MAGENTO_BASE_URL}} | |
| MAGENTO_BACKEND_NAME: ${{vars.MAGENTO_BACKEND_NAME}} | |
| MAGENTO_ADMIN_USERNAME: ${{vars.MAGENTO_ADMIN_USERNAME}} | |
| MAGENTO_ADMIN_PASSWORD: ${{secrets.MAGENTO_ADMIN_PASSWORD}} | |
| # MFTF configuration | |
| SELENIUM_CLOSE_ALL_SESSIONS: true | |
| BROWSER: chrome | |
| WINDOW_WIDTH: 1920 | |
| WINDOW_HEIGHT: 1080 | |
| WAIT_TIMEOUT: 60 | |
| MAGENTO_CLI_WAIT_TIMEOUT: 60 | |
| TEST_ENV: ci | |
| HEADLESS: true | |
| services: | |
| chrome: | |
| image: selenium/standalone-chrome:3.141.59-zirconium | |
| ports: | |
| - 4444:4444 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@master | |
| with: | |
| php-version: "8.2" | |
| extensions: curl, dom, intl, json, openssl, zip | |
| - name: Cache Composer packages | |
| id: composer-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: vendor | |
| key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-php- | |
| - name: Install dependencies | |
| if: steps.composer-cache.outputs.cache-hit != 'true' | |
| run: composer install --prefer-dist --no-progress --no-suggest | |
| - name: Verify Magento connection | |
| run: | | |
| echo "Testing connection to $MAGENTO_BASE_URL" | |
| curl -f -s -o /dev/null $MAGENTO_BASE_URL || echo "Warning: Cannot connect to Magento" | |
| - name: Build MFTF project | |
| run: php bin/mftf build:project | |
| - name: Verify MFTF configuration | |
| run: php bin/mftf doctor || true | |
| - name: Run testRigor tests | |
| run: | | |
| echo "Running MFTF testRigor tests..." | |
| php bin/mftf run:testrigor | |
| - name: Upload test artifacts | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: mftf-test-artifacts | |
| path: | | |
| dev/tests/acceptance/_output/ | |
| var/log/ | |
| retention-days: 7 |