From 7f9291dc2ec7221f9ca8d834a048fb39a73afc9f Mon Sep 17 00:00:00 2001 From: Dovid Levine Date: Thu, 6 Feb 2025 00:57:13 +0200 Subject: [PATCH] ci: enable codeclimate/coveralls reporting (#68) * ci: enable codeclimate/coveralls reporting * chore: format * ci: fix coverage * . * . * chore: cleanup --- .github/ISSUE_TEMPLATE/bug-report.yml | 82 +- .github/ISSUE_TEMPLATE/feature_request.yml | 70 +- .github/workflows/deploy.yml | 72 +- .github/workflows/perform-lints.yml | 912 +++++++++---------- .github/workflows/upload-release.yml | 108 +-- .github/workflows/upload-schema-artifact.yml | 112 +-- bin/run-codeception.sh | 10 +- docker-compose.yml | 84 +- tests/Acceptance.suite.dist.yml | 66 +- tests/Integration.suite.dist.yml | 45 +- 10 files changed, 781 insertions(+), 780 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index e91fc47..71f995f 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -1,47 +1,47 @@ name: Bug Report description: >- - A bug report. This should be a client-facing issue that needs to be resolved. + A bug report. This should be a client-facing issue that needs to be resolved. title: 'Bug: ' labels: - - 'type: bug 🐛' + - 'type: bug 🐛' body: - - type: textarea - attributes: - label: Description - description: >- - Please write a brief description of the bug, including what you expected and what actually happened. - validations: - required: true - - type: textarea - attributes: - label: Steps to reproduce - description: >- - Please list the all the steps needed to reproduce the bug in an *isolated* way. - placeholder: >- - 1. Go to "..." - 2. ... - 3. Result show X but should be Y - validations: - required: true - - type: textarea - id: additional-notes - attributes: - label: Additional Notes - description: Include any additional notes, context, considerations. - - type: checkboxes - attributes: - label: Please confirm that you have searched existing issues in the repo. - description: >- - You can do this by searching - https://github.com/axewp/wp-graphql-headless-login/issues and making sure the - bug is not related to another plugin. - options: - - label: 'Yes' + - type: textarea + attributes: + label: Description + description: >- + Please write a brief description of the bug, including what you expected and what actually happened. + validations: + required: true + - type: textarea + attributes: + label: Steps to reproduce + description: >- + Please list the all the steps needed to reproduce the bug in an *isolated* way. + placeholder: >- + 1. Go to "..." + 2. ... + 3. Result show X but should be Y + validations: + required: true + - type: textarea + id: additional-notes + attributes: + label: Additional Notes + description: Include any additional notes, context, considerations. + - type: checkboxes + attributes: + label: Please confirm that you have searched existing issues in the repo. + description: >- + You can do this by searching + https://github.com/axewp/wp-graphql-headless-login/issues and making sure the + bug is not related to another plugin. + options: + - label: 'Yes' + required: true + - type: textarea + id: site-health + attributes: + label: Site Health Info + description: Please include the output of the Site Health Info page, by going to Tools > Site Health > Info, clicking `Copy site info to clipboard`, and pasting the output here. + validations: required: true - - type: textarea - id: site-health - attributes: - label: Site Health Info - description: Please include the output of the Site Health Info page, by going to Tools > Site Health > Info, clicking `Copy site info to clipboard`, and pasting the output here. - validations: - required: true diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index 855c9fb..a2f07d5 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -1,40 +1,40 @@ name: Feature request description: Suggest an idea for SnapWP Helper body: - - type: markdown - attributes: - value: >- - Thank you for taking the time to submit a feature request. + - type: markdown + attributes: + value: >- + Thank you for taking the time to submit a feature request. - Please make sure to search the repo for [existing feature - requests](https://github.com/rtCamp/snapwp-helper/issues?q=is%3Aopen+is%3Aissue) - before creating a new one. - - type: textarea - attributes: - label: What problem does this address? - description: >- - Please describe the problem you are trying to solve, including why you - think this is a problem. - placeholder: I'm always frustrated when [...] - validations: - required: true - - type: textarea - attributes: - label: What is your proposed solution? - description: >- - Please provide a clear and concise description of your suggested - solution. - placeholder: What I'd like to see happen is [...] - validations: - required: true - - type: textarea - attributes: - label: What alternatives have you considered? - description: >- - Please list any alternatives you have considered, and why you think your - solution is better. - - type: textarea - attributes: - label: Additional Context - description: Add any other context or screenshots about the feature request here. + Please make sure to search the repo for [existing feature + requests](https://github.com/rtCamp/snapwp-helper/issues?q=is%3Aopen+is%3Aissue) + before creating a new one. + - type: textarea + attributes: + label: What problem does this address? + description: >- + Please describe the problem you are trying to solve, including why you + think this is a problem. + placeholder: I'm always frustrated when [...] + validations: + required: true + - type: textarea + attributes: + label: What is your proposed solution? + description: >- + Please provide a clear and concise description of your suggested + solution. + placeholder: What I'd like to see happen is [...] + validations: + required: true + - type: textarea + attributes: + label: What alternatives have you considered? + description: >- + Please list any alternatives you have considered, and why you think your + solution is better. + - type: textarea + attributes: + label: Additional Context + description: Add any other context or screenshots about the feature request here. diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 682d964..0d60f8c 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,40 +1,40 @@ on: - push: - branches: - - main - - develop - workflow_dispatch: + push: + branches: + - main + - develop + workflow_dispatch: name: Deploying Headless Server env: - # Please keep in install-links to avoid npm install errors on the server - build-command: npm i --include-dev --install-links && npm run build:dist + # Please keep in install-links to avoid npm install errors on the server + build-command: npm i --include-dev --install-links && npm run build:dist jobs: - deploy: - name: Deploy - runs-on: ubuntu-latest - concurrency: - group: ${{ github.workflow }} - cancel-in-progress: false - steps: - - uses: actions/checkout@v4 - - name: Setup hosts file - run: | - cat < '${{ github.workspace }}/.github/hosts.yml' - ${{ secrets.HOSTS_FILE }} - EOF - - name: Get node version - id: node-version - run: | - cd '${{ github.workspace }}' - NODE_VERSION="$(cat .nvmrc)" - echo "node_version=${NODE_VERSION}" >> "$GITHUB_ENV" - - name: Deploy - uses: rtCamp/action-deploy-wordpress@master - env: - SSH_PRIVATE_KEY: ${{ secrets.ED_DEPLOYMENT_KEY }} - NODE_VERSION: "${{ env.node_version }}" - NODE_BUILD_COMMAND: ${{ env.build-command }} - SSH_USER: ${{ secrets.SSH_USER }} - SSH_HOST: ${{ secrets.SSH_HOST }} - - if: always() - uses: rtCamp/action-cleanup@master + deploy: + name: Deploy + runs-on: ubuntu-latest + concurrency: + group: ${{ github.workflow }} + cancel-in-progress: false + steps: + - uses: actions/checkout@v4 + - name: Setup hosts file + run: | + cat < '${{ github.workspace }}/.github/hosts.yml' + ${{ secrets.HOSTS_FILE }} + EOF + - name: Get node version + id: node-version + run: | + cd '${{ github.workspace }}' + NODE_VERSION="$(cat .nvmrc)" + echo "node_version=${NODE_VERSION}" >> "$GITHUB_ENV" + - name: Deploy + uses: rtCamp/action-deploy-wordpress@master + env: + SSH_PRIVATE_KEY: ${{ secrets.ED_DEPLOYMENT_KEY }} + NODE_VERSION: '${{ env.node_version }}' + NODE_BUILD_COMMAND: ${{ env.build-command }} + SSH_USER: ${{ secrets.SSH_USER }} + SSH_HOST: ${{ secrets.SSH_HOST }} + - if: always() + uses: rtCamp/action-cleanup@master diff --git a/.github/workflows/perform-lints.yml b/.github/workflows/perform-lints.yml index 3d49536..d8d4100 100644 --- a/.github/workflows/perform-lints.yml +++ b/.github/workflows/perform-lints.yml @@ -1,466 +1,466 @@ name: Lint & Test on: - push: - branches: - - develop - - main - pull_request: - branches: - - develop - - main - workflow_dispatch: + push: + branches: + - develop + - main + pull_request: + branches: + - develop + - main + workflow_dispatch: permissions: - contents: read + contents: read # Cancel previous workflow run groups that have not completed. concurrency: - # Group workflow runs by workflow name, along with the head branch ref of the pull request - # or otherwise the branch or tag ref. - group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.ref }} - cancel-in-progress: true + # Group workflow runs by workflow name, along with the head branch ref of the pull request + # or otherwise the branch or tag ref. + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.ref }} + cancel-in-progress: true jobs: - pre-run: - name: "Pre run" - runs-on: ubuntu-latest - - outputs: - changed-php: ${{ steps.changed-files.outputs.php_any_changed }} - changed-js: ${{ steps.changed-files.outputs.js_any_changed }} - changed-workflow: ${{ steps.changed-files.outputs.gha-workflow_any_changed }} - - steps: - - name: Checkout including last 2 commits - # Fetch last 2 commits if it's not a PR, so that we can determine the list of modified files. - if: ${{ github.base_ref == null }} - uses: actions/checkout@v4 - with: - fetch-depth: 2 - - - name: Checkout - # Do usual checkout if it's a PR. - if: ${{ github.base_ref != null }} - uses: actions/checkout@v4 - - - name: Fetch base branch - # Only fetch base ref if it's a PR. - if: ${{ github.base_ref != null }} - run: git fetch --depth=1 --no-tags origin ${{ github.base_ref }} - - - name: Determine modified files for PR - id: changed-files - uses: tj-actions/changed-files@v44 - with: - # We are only interested in PHP, JS, and workflow files. - files_yaml: | - php: - - '**.php' - - 'composer.json' - - 'composer.lock' - gha-workflow: - - '**.yml' - - '**.yaml' - js: - - '**.js' - - '**.jsx' - - '**.ts' - - '**.tsx' - - 'package.json' - - 'package-lock.json' - - - name: List all PHP changed files - if: steps.changed-files.outputs.php_any_changed == 'true' - env: - PHP_CHANGED_FILES: ${{ steps.changed-files.outputs.php_all_changed_files }} - run: | - for file in "$PHP_CHANGED_FILES"; do - echo "$file was changed" - done - - - name: List all JS changed files - if: steps.changed-files.outputs.js_any_changed == 'true' - env: - JS_CHANGED_FILES: ${{ steps.changed-files.outputs.js_all_changed_files }} - run: | - for file in "$JS_CHANGED_FILES"; do - echo "$file was changed" - done - - - name: List all Workflow changed files - if: steps.changed-files.outputs.gha-workflow_any_changed == 'true' - env: - GHA_CHANGED_FILES: ${{ steps.changed-files.outputs.gha-workflow_all_changed_files }} - run: | - for file in "$GHA_CHANGED_FILES"; do - echo "$file was changed" - done - - phpcs: - needs: pre-run - if: needs.pre-run.outputs.changed-php == 'true' || needs.pre-run.outputs.changed-workflow == 'true' - name: PHP Coding Standards - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: "8.2" - coverage: none - tools: composer - - # Install/cache composer dependencies - - name: Install dependencies - uses: ramsey/composer-install@v3 - with: - composer-options: "--no-progress" - - - name: Run PHP_CodeSniffer - run: composer run-script phpcs -- --report-full --report-checkstyle=./phpcs-report.xml - - phpstan: - needs: pre-run - if: needs.pre-run.outputs.changed-php == 'true' || needs.pre-run.outputs.changed-workflow == 'true' - name: "PHP Static Analysis" - runs-on: ubuntu-latest - services: - mariadb: - image: mariadb:10 - ports: - - 3306:3306 - env: - MYSQL_ROOT_PASSWORD: password - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: "8.2" - extensions: mbstring, intl - coverage: none - tools: composer, wp-cli - - # Install/cache composer dependencies - - name: Install dependencies - uses: ramsey/composer-install@v3 - with: - composer-options: "--no-progress" - - - name: Setup WordPress - run: | - cp .env.dist .env - npm run install-test-env - - - name: Run PHPStan - working-directory: /tmp/wordpress/wp-content/plugins/snapwp-helper - run: composer run-script phpstan -- --error-format=github - - lint-js: - name: 'Lint: JS' - needs: pre-run - if: needs.pre-run.outputs.changed-workflow == 'true' || needs.pre-run.outputs.changed-js == 'true' - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: 20 - - - name: Install Node.js dependencies - run: npm ci - env: - CI: true - - - name: Run ESLint - run: npm run lint:js - - codeception: - needs: pre-run - if: needs.pre-run.outputs.changed-php == 'true' || needs.pre-run.outputs.changed-workflow == 'true' - name: "Tests - Codeception | PHP: ${{ matrix.php }} WP: ${{ matrix.wordpress }}" - runs-on: ubuntu-latest - strategy: - matrix: - php: [ '8.2', '8.1' ] - wordpress: [ '6.7' ] # @todo support older versions - include: - - php: '8.2' - wordpress: '6.7' - coverage: 1 - fail-fast: false - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: json, mbstring - tools: composer:v2 - - # Install/cache composer dependencies - - name: Install dependencies - uses: ramsey/composer-install@v3 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: 20 - - - name: Install Node.js dependencies - run: npm ci - env: - CI: true - - - name: Build JS assets - run: npm run build:js - - - name: Copy .env file - run: cp .docker/.env.ci .env - - - name: Start test environment - run: | - npm run docker:start - docker exec -e COVERAGE=${COVERAGE:-} $(docker compose ps -q wordpress) init-docker.sh - env: - WP_VERSION: ${{ matrix.wordpress }} - PHP_VERSION: ${{ matrix.php }} - COVERAGE: ${{ matrix.coverage }} - - - name: Run acceptance tests - run: bash ./bin/run-codeception.sh - env: - WP_VERSION: ${{ matrix.wordpress }} - PHP_VERSION: ${{ matrix.php }} - COVERAGE: ${{ matrix.coverage }} - DEBUG: ${{ secrets.ACTIONS_STEP_DEBUG || matrix.debug }} - SUITES: "Acceptance" - - - name: Run integration tests - working-directory: ${{ env.PROJECT_URI }} - run: bash ./bin/run-codeception.sh - env: - WP_VERSION: ${{ matrix.wordpress }} - PHP_VERSION: ${{ matrix.php }} - COVERAGE: ${{ matrix.coverage }} - DEBUG: ${{ secrets.ACTIONS_STEP_DEBUG || matrix.debug }} - SUITES: "Integration" - -# - name: Push coverage to Coveralls.io -# if: matrix.coverage == 1 -# uses: coverallsapp/github-action@v2 -# with: -# github-token: ${{ secrets.GITHUB_TOKEN }} -# path-to-lcov: tests/_output/coverage/lcov.info # todo: verify path -# -# - name: Push coverage to CodeClimate -# if: matrix.coverage == 1 -# uses: paambaati/codeclimate-action@v9 -# env: -# CC_TEST_REPORTER_ID: # todo: add code climate reporter id -# with: -# debug: true -# coverageLocations: | -# ${{github.workspace}}/tests/_output/*.xml:clover # todo: verify path - - playwright: - needs: pre-run - if: needs.pre-run.outputs.changed-workflow == 'true' || needs.pre-run.outputs.changed-js == 'true' - name: "E2E - Playwright" - runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: "8.2" - coverage: none - tools: composer - - - name: Install Composer dependencies - uses: ramsey/composer-install@v3 - with: - composer-options: "--no-progress" - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: 20 - - - name: Install Node.js dependencies - run: npm ci - env: - CI: true - - - name: Build assets - run: npm run build:dist - - - name: Install Playwright dependencies - run: npx playwright install --with-deps - - - name: Start wp-env - run: | - npm run wp-env -- start - sleep 10 - netstat -nltp - curl -iL http://localhost:8889 - - - name: Run E2E tests - run: npm run test:e2e - - - name: Upload tests artifacts - if: ${{ failure() }} - uses: actions/upload-artifact@v4 - with: - name: artifact - path: tests/_output/artifacts - retention-days: 7 - if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` - - - name: Stop wp-env - if: ${{ always() }} - working-directory: ${{ env.PROJECT_URI }} - run: | - npm run wp-env -- stop || true - npm run wp-env -- destroy <<< 'y' || true # this doesn't have a flag to skip prompt - - graphql-schema: - needs: pre-run - if: needs.pre-run.outputs.changed-php == 'true' || needs.pre-run.outputs.changed-workflow == 'true' - name: "Lint WPGraphQL Schema" - runs-on: ubuntu-latest - services: - mariadb: - image: mariadb:10 - ports: - - 3306:3306 - env: - MYSQL_ROOT_PASSWORD: password - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup PHP w/ Composer & WP-CLI - uses: shivammathur/setup-php@v2 - with: - php-version: 8.2 - extensions: mbstring, intl, bcmath, exif, gd, mysqli, opcache, zip, pdo_mysql - coverage: none - tools: composer:v2, wp-cli - - - name: Install Composer dependencies - uses: ramsey/composer-install@v3 - with: - composer-options: "--no-progress" - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: 20 - - - name: Setup GraphQL Schema Linter - run: npm install -g graphql-schema-linter@^3.0 graphql@^16 - - - name: Install Node.js dependencies - run: npm ci - env: - CI: true - - - name: Build JS assets - run: npm run build:js - - - name: Setup WordPress - run: | - cp .env.dist .env - npm run install-test-env - - - name: Generate the Static Schema - run: | - cd /tmp/wordpress/ - # Output: /tmp/schema.graphql - wp graphql generate-static-schema --allow-root - - - name: Lint the Schema - run: | - graphql-schema-linter --except=relay-connection-types-spec,relay-page-info-spec --ignore '{"defined-types-are-used":["MenuItemsWhereArgs","PostObjectUnion","TermObjectUnion","TimezoneEnum"]}' /tmp/schema.graphql - - - name: Display ignored linting errors - run: | - graphql-schema-linter /tmp/schema.graphql || true - - - name: Get Latest tag - uses: actions-ecosystem/action-get-latest-tag@v1 - id: get-latest-tag - - - name: Test Schema for breaking changes - run: | - echo "Previous tagged schema ${{ steps.get-latest-tag.outputs.tag }}" - - - name: Get Previous Released Schema - run: | - FILE_NAME="schema.graphql" - GH_API="https://api.github.com" - GH_REPO="$GH_API/repos/$GITHUB_REPOSITORY" - GH_TAG="$GH_REPO/releases/tags/${{ steps.get-latest-tag.outputs.tag }}" - AUTH="Authorization: token $GITHUB_TOKEN" - - response=$(curl -sH "$AUTH" $GH_TAG) - # Get ID of the asset based on given FILE_NAME. - id=$(echo "$response" | jq --arg name "$FILE_NAME" '.assets[] | select(.name == $name).id') - [ "$id" ] || { echo "Error: Failed to find ID for $FILE_NAME"; exit 1; } - GH_ASSET_URL="$GH_REPO/releases/assets/$id" - - echo "Fetching schema from: $GH_ASSET_URL" - - STATUS_CODE=$( - curl -H "$AUTH" \ - -H 'Accept: application/octet-stream' \ - -L -o /tmp/${{ steps.get-latest-tag.outputs.tag }}.graphql \ - -w "%{http_code}" \ - "$GH_ASSET_URL" - ) - - if [ "$STATUS_CODE" -ne 200 ]; then - echo "Failed to fetch schema. HTTP Status Code: $STATUS_CODE" - cat /tmp/${{ steps.get-latest-tag.outputs.tag }}.graphql - exit 1 - fi - - # Additional debug info - if [ ! -f /tmp/${{ steps.get-latest-tag.outputs.tag }}.graphql ]; then - echo "File not found!" - exit 1 - else - echo "File exists." - fi - - echo "Previous schema:" - cat /tmp/${{ steps.get-latest-tag.outputs.tag }}.graphql - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - # https://github.com/marketplace/actions/graphql-inspector - - name: Install Schema Inspector - run: | - npm install @graphql-inspector/config @graphql-inspector/cli - - - name: Run Schema Inspector - run: | - # This schema and previous release schema - node_modules/.bin/graphql-inspector diff /tmp/${{ steps.get-latest-tag.outputs.tag }}.graphql /tmp/schema.graphql - + pre-run: + name: 'Pre run' + runs-on: ubuntu-latest + + outputs: + changed-php: ${{ steps.changed-files.outputs.php_any_changed }} + changed-js: ${{ steps.changed-files.outputs.js_any_changed }} + changed-workflow: ${{ steps.changed-files.outputs.gha-workflow_any_changed }} + + steps: + - name: Checkout including last 2 commits + # Fetch last 2 commits if it's not a PR, so that we can determine the list of modified files. + if: ${{ github.base_ref == null }} + uses: actions/checkout@v4 + with: + fetch-depth: 2 + + - name: Checkout + # Do usual checkout if it's a PR. + if: ${{ github.base_ref != null }} + uses: actions/checkout@v4 + + - name: Fetch base branch + # Only fetch base ref if it's a PR. + if: ${{ github.base_ref != null }} + run: git fetch --depth=1 --no-tags origin ${{ github.base_ref }} + + - name: Determine modified files for PR + id: changed-files + uses: tj-actions/changed-files@v44 + with: + # We are only interested in PHP, JS, and workflow files. + files_yaml: | + php: + - '**.php' + - 'composer.json' + - 'composer.lock' + gha-workflow: + - '**.yml' + - '**.yaml' + js: + - '**.js' + - '**.jsx' + - '**.ts' + - '**.tsx' + - 'package.json' + - 'package-lock.json' + + - name: List all PHP changed files + if: steps.changed-files.outputs.php_any_changed == 'true' + env: + PHP_CHANGED_FILES: ${{ steps.changed-files.outputs.php_all_changed_files }} + run: | + for file in "$PHP_CHANGED_FILES"; do + echo "$file was changed" + done + + - name: List all JS changed files + if: steps.changed-files.outputs.js_any_changed == 'true' + env: + JS_CHANGED_FILES: ${{ steps.changed-files.outputs.js_all_changed_files }} + run: | + for file in "$JS_CHANGED_FILES"; do + echo "$file was changed" + done + + - name: List all Workflow changed files + if: steps.changed-files.outputs.gha-workflow_any_changed == 'true' + env: + GHA_CHANGED_FILES: ${{ steps.changed-files.outputs.gha-workflow_all_changed_files }} + run: | + for file in "$GHA_CHANGED_FILES"; do + echo "$file was changed" + done + + phpcs: + needs: pre-run + if: needs.pre-run.outputs.changed-php == 'true' || needs.pre-run.outputs.changed-workflow == 'true' + name: PHP Coding Standards + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.2' + coverage: none + tools: composer + + # Install/cache composer dependencies + - name: Install dependencies + uses: ramsey/composer-install@v3 + with: + composer-options: '--no-progress' + + - name: Run PHP_CodeSniffer + run: composer run-script phpcs -- --report-full --report-checkstyle=./phpcs-report.xml + + phpstan: + needs: pre-run + if: needs.pre-run.outputs.changed-php == 'true' || needs.pre-run.outputs.changed-workflow == 'true' + name: 'PHP Static Analysis' + runs-on: ubuntu-latest + services: + mariadb: + image: mariadb:10 + ports: + - 3306:3306 + env: + MYSQL_ROOT_PASSWORD: password + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.2' + extensions: mbstring, intl + coverage: none + tools: composer, wp-cli + + # Install/cache composer dependencies + - name: Install dependencies + uses: ramsey/composer-install@v3 + with: + composer-options: '--no-progress' + + - name: Setup WordPress + run: | + cp .env.dist .env + npm run install-test-env + + - name: Run PHPStan + working-directory: /tmp/wordpress/wp-content/plugins/snapwp-helper + run: composer run-script phpstan -- --error-format=github + + lint-js: + name: 'Lint: JS' + needs: pre-run + if: needs.pre-run.outputs.changed-workflow == 'true' || needs.pre-run.outputs.changed-js == 'true' + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Install Node.js dependencies + run: npm ci + env: + CI: true + + - name: Run ESLint + run: npm run lint:js + + codeception: + needs: pre-run + if: needs.pre-run.outputs.changed-php == 'true' || needs.pre-run.outputs.changed-workflow == 'true' + name: 'Tests - Codeception | PHP: ${{ matrix.php }} WP: ${{ matrix.wordpress }}' + runs-on: ubuntu-latest + strategy: + matrix: + php: ['8.2', '8.1'] + wordpress: ['6.7'] # @todo support older versions + include: + - php: '8.2' + wordpress: '6.7' + coverage: 1 + fail-fast: false + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: json, mbstring + tools: composer:v2 + + # Install/cache composer dependencies + - name: Install dependencies + uses: ramsey/composer-install@v3 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Install Node.js dependencies + run: npm ci + env: + CI: true + + - name: Build JS assets + run: npm run build:js + + - name: Copy .env file + run: cp .docker/.env.ci .env + + - name: Start test environment + run: | + npm run docker:start + docker exec -e COVERAGE=${COVERAGE:-} $(docker compose ps -q wordpress) init-docker.sh + env: + WP_VERSION: ${{ matrix.wordpress }} + PHP_VERSION: ${{ matrix.php }} + COVERAGE: ${{ matrix.coverage }} + + - name: Run acceptance tests + run: bash ./bin/run-codeception.sh + env: + WP_VERSION: ${{ matrix.wordpress }} + PHP_VERSION: ${{ matrix.php }} + DEBUG: ${{ secrets.ACTIONS_STEP_DEBUG || matrix.debug }} + SUITES: 'Acceptance' + + - name: Run integration tests + working-directory: ${{ env.PROJECT_URI }} + run: bash ./bin/run-codeception.sh + env: + WP_VERSION: ${{ matrix.wordpress }} + PHP_VERSION: ${{ matrix.php }} + COVERAGE: ${{ matrix.coverage }} + DEBUG: ${{ secrets.ACTIONS_STEP_DEBUG || matrix.debug }} + SUITES: 'Integration' + + - name: Push coverage to Coveralls.io + if: matrix.coverage == 1 + uses: coverallsapp/github-action@v2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + file: tests/_output/Integration-coverage.xml + flag-name: Integration + format: clover + + - name: Push coverage to CodeClimate + if: matrix.coverage == 1 + uses: paambaati/codeclimate-action@v9 + env: + CC_TEST_REPORTER_ID: ${{ secrets.CODECLIMATE_REPORTER_ID }} + with: + coverageLocations: | + ${{github.workspace}}/tests/_output/Integration-coverage.xml:clover + prefix: '/var/www/html/wp-content/plugins/snapwp-helper' + + playwright: + needs: pre-run + if: needs.pre-run.outputs.changed-workflow == 'true' || needs.pre-run.outputs.changed-js == 'true' + name: 'E2E - Playwright' + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.2' + coverage: none + tools: composer + + - name: Install Composer dependencies + uses: ramsey/composer-install@v3 + with: + composer-options: '--no-progress' + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Install Node.js dependencies + run: npm ci + env: + CI: true + + - name: Build assets + run: npm run build:dist + + - name: Install Playwright dependencies + run: npx playwright install --with-deps + + - name: Start wp-env + run: | + npm run wp-env -- start + sleep 10 + netstat -nltp + curl -iL http://localhost:8889 + + - name: Run E2E tests + run: npm run test:e2e + + - name: Upload tests artifacts + if: ${{ failure() }} + uses: actions/upload-artifact@v4 + with: + name: artifact + path: tests/_output/artifacts + retention-days: 7 + if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` + + - name: Stop wp-env + if: ${{ always() }} + working-directory: ${{ env.PROJECT_URI }} + run: | + npm run wp-env -- stop || true + npm run wp-env -- destroy <<< 'y' || true # this doesn't have a flag to skip prompt + + graphql-schema: + needs: pre-run + if: needs.pre-run.outputs.changed-php == 'true' || needs.pre-run.outputs.changed-workflow == 'true' + name: 'Lint WPGraphQL Schema' + runs-on: ubuntu-latest + services: + mariadb: + image: mariadb:10 + ports: + - 3306:3306 + env: + MYSQL_ROOT_PASSWORD: password + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup PHP w/ Composer & WP-CLI + uses: shivammathur/setup-php@v2 + with: + php-version: 8.2 + extensions: mbstring, intl, bcmath, exif, gd, mysqli, opcache, zip, pdo_mysql + coverage: none + tools: composer:v2, wp-cli + + - name: Install Composer dependencies + uses: ramsey/composer-install@v3 + with: + composer-options: '--no-progress' + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Setup GraphQL Schema Linter + run: npm install -g graphql-schema-linter@^3.0 graphql@^16 + + - name: Install Node.js dependencies + run: npm ci + env: + CI: true + + - name: Build JS assets + run: npm run build:js + + - name: Setup WordPress + run: | + cp .env.dist .env + npm run install-test-env + + - name: Generate the Static Schema + run: | + cd /tmp/wordpress/ + # Output: /tmp/schema.graphql + wp graphql generate-static-schema --allow-root + + - name: Lint the Schema + run: | + graphql-schema-linter --except=relay-connection-types-spec,relay-page-info-spec --ignore '{"defined-types-are-used":["MenuItemsWhereArgs","PostObjectUnion","TermObjectUnion","TimezoneEnum"]}' /tmp/schema.graphql + + - name: Display ignored linting errors + run: | + graphql-schema-linter /tmp/schema.graphql || true + + - name: Get Latest tag + uses: actions-ecosystem/action-get-latest-tag@v1 + id: get-latest-tag + + - name: Test Schema for breaking changes + run: | + echo "Previous tagged schema ${{ steps.get-latest-tag.outputs.tag }}" + + - name: Get Previous Released Schema + run: | + FILE_NAME="schema.graphql" + GH_API="https://api.github.com" + GH_REPO="$GH_API/repos/$GITHUB_REPOSITORY" + GH_TAG="$GH_REPO/releases/tags/${{ steps.get-latest-tag.outputs.tag }}" + AUTH="Authorization: token $GITHUB_TOKEN" + + response=$(curl -sH "$AUTH" $GH_TAG) + # Get ID of the asset based on given FILE_NAME. + id=$(echo "$response" | jq --arg name "$FILE_NAME" '.assets[] | select(.name == $name).id') + [ "$id" ] || { echo "Error: Failed to find ID for $FILE_NAME"; exit 1; } + GH_ASSET_URL="$GH_REPO/releases/assets/$id" + + echo "Fetching schema from: $GH_ASSET_URL" + + STATUS_CODE=$( + curl -H "$AUTH" \ + -H 'Accept: application/octet-stream' \ + -L -o /tmp/${{ steps.get-latest-tag.outputs.tag }}.graphql \ + -w "%{http_code}" \ + "$GH_ASSET_URL" + ) + + if [ "$STATUS_CODE" -ne 200 ]; then + echo "Failed to fetch schema. HTTP Status Code: $STATUS_CODE" + cat /tmp/${{ steps.get-latest-tag.outputs.tag }}.graphql + exit 1 + fi + + # Additional debug info + if [ ! -f /tmp/${{ steps.get-latest-tag.outputs.tag }}.graphql ]; then + echo "File not found!" + exit 1 + else + echo "File exists." + fi + + echo "Previous schema:" + cat /tmp/${{ steps.get-latest-tag.outputs.tag }}.graphql + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + # https://github.com/marketplace/actions/graphql-inspector + - name: Install Schema Inspector + run: | + npm install @graphql-inspector/config @graphql-inspector/cli + + - name: Run Schema Inspector + run: | + # This schema and previous release schema + node_modules/.bin/graphql-inspector diff /tmp/${{ steps.get-latest-tag.outputs.tag }}.graphql /tmp/schema.graphql diff --git a/.github/workflows/upload-release.yml b/.github/workflows/upload-release.yml index be45561..ce22cba 100644 --- a/.github/workflows/upload-release.yml +++ b/.github/workflows/upload-release.yml @@ -1,61 +1,61 @@ name: Upload Release Package on: - release: - types: [ published ] + release: + types: [published] permissions: - contents: write - packages: write + contents: write + packages: write jobs: - tag: - name: Upload New Release - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: 7.4 - coverage: none - extensions: mbstring, intl - tools: composer:v2 - - - name: Install Composer dependencies - uses: ramsey/composer-install@v3 - with: - composer-options: "--no-progress" - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: 20 - - - name: Install Node.js dependencies - run: npm ci - env: - CI: true - - - name: Build assets - run: npm run build:dist - - - name: Create Artifact - run: | - npm run plugin-zip - - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: snapwp-helper - path: snapwp-helper.zip - - - name: Upload release asset - uses: softprops/action-gh-release@v2 - with: - files: snapwp-helper.zip - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + tag: + name: Upload New Release + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 7.4 + coverage: none + extensions: mbstring, intl + tools: composer:v2 + + - name: Install Composer dependencies + uses: ramsey/composer-install@v3 + with: + composer-options: '--no-progress' + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Install Node.js dependencies + run: npm ci + env: + CI: true + + - name: Build assets + run: npm run build:dist + + - name: Create Artifact + run: | + npm run plugin-zip + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: snapwp-helper + path: snapwp-helper.zip + + - name: Upload release asset + uses: softprops/action-gh-release@v2 + with: + files: snapwp-helper.zip + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/upload-schema-artifact.yml b/.github/workflows/upload-schema-artifact.yml index 9ecdc81..6152d42 100644 --- a/.github/workflows/upload-schema-artifact.yml +++ b/.github/workflows/upload-schema-artifact.yml @@ -1,73 +1,73 @@ name: Upload Schema Artifact on: - release: - types: [ published ] + release: + types: [published] permissions: - contents: write - actions: write + contents: write + actions: write jobs: - run: - runs-on: ubuntu-latest - name: Generate and Upload WPGraphQL Schema Artifact - services: - mariadb: - image: mariadb:10 - ports: - - 3306:3306 - env: - MYSQL_ROOT_PASSWORD: password - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + run: + runs-on: ubuntu-latest + name: Generate and Upload WPGraphQL Schema Artifact + services: + mariadb: + image: mariadb:10 + ports: + - 3306:3306 + env: + MYSQL_ROOT_PASSWORD: password + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - steps: - - name: Checkout - uses: actions/checkout@v4 + steps: + - name: Checkout + uses: actions/checkout@v4 - - name: Setup PHP w/ Composer & WP-CLI - uses: shivammathur/setup-php@v2 - with: - php-version: 8.2 - extensions: mbstring, intl, bcmath, exif, gd, mysqli, opcache, zip, pdo_mysql - coverage: none - tools: composer:v2, wp-cli + - name: Setup PHP w/ Composer & WP-CLI + uses: shivammathur/setup-php@v2 + with: + php-version: 8.2 + extensions: mbstring, intl, bcmath, exif, gd, mysqli, opcache, zip, pdo_mysql + coverage: none + tools: composer:v2, wp-cli - - name: Install Composer dependencies - uses: ramsey/composer-install@v3 - with: - composer-options: "--no-progress" + - name: Install Composer dependencies + uses: ramsey/composer-install@v3 + with: + composer-options: '--no-progress' - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: 20 + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 - - name: Setup GraphQL Schema Linter - run: npm install -g graphql-schema-linter@^3.0 graphql@^16 + - name: Setup GraphQL Schema Linter + run: npm install -g graphql-schema-linter@^3.0 graphql@^16 - - name: Install Node.js dependencies - run: npm ci - env: - CI: true + - name: Install Node.js dependencies + run: npm ci + env: + CI: true - - name: Build JS assets - run: npm run build:js + - name: Build JS assets + run: npm run build:js - - name: Setup WordPress - run: | - cp .env.dist .env - npm run install-test-env + - name: Setup WordPress + run: | + cp .env.dist .env + npm run install-test-env - - name: Generate the Static Schema - run: | - cd /tmp/wordpress/ - # Output: /tmp/schema.graphql - wp graphql generate-static-schema --allow-root + - name: Generate the Static Schema + run: | + cd /tmp/wordpress/ + # Output: /tmp/schema.graphql + wp graphql generate-static-schema --allow-root - - name: Upload schema as release artifact - uses: softprops/action-gh-release@v2 - with: - files: /tmp/schema.graphql - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload schema as release artifact + uses: softprops/action-gh-release@v2 + with: + files: /tmp/schema.graphql + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/bin/run-codeception.sh b/bin/run-codeception.sh index 043a8e5..84bbafe 100644 --- a/bin/run-codeception.sh +++ b/bin/run-codeception.sh @@ -44,14 +44,14 @@ run_tests $SUITES # Set public test result files permissions. if [ -n "$(ls tests/_output)" ]; then - echo -e "$(status_message 'Setting result files permissions'.)" - container bash -c "chmod 777 -R wp-content/plugins/$PLUGIN_SLUG/tests/_output/*" + echo -e "$(status_message 'Setting result files permissions'.)" + container bash -c "chmod 777 -R wp-content/plugins/$PLUGIN_SLUG/tests/_output/*" fi # Check results and exit accordingly. if [ -f "tests/_output/failed" ]; then - echo -e "$(error_message "Uh oh, Codeception tests failed.")" - exit 1 + echo -e "$(error_message "Uh oh, Codeception tests failed.")" + exit 1 else - echo -e "$(status_message "Woohoo! Codeception tests completed succesfully!")" + echo -e "$(status_message "Woohoo! Codeception tests completed succesfully!")" fi diff --git a/docker-compose.yml b/docker-compose.yml index 49a4e1c..69118d6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,48 +1,48 @@ services: - wordpress: - build: - context: ./.docker - args: - WP_VERSION: ${WP_VERSION} - PHP_VERSION: ${PHP_VERSION} - image: ${PLUGIN_SLUG}:latest-wp${WP_VERSION}-php${PHP_VERSION} - restart: always - ports: - - "8890:80" - environment: - WP_VERSION: ${WP_VERSION} - PHP_VERSION: ${PHP_VERSION} - COVERAGE: ${COVERAGE:-} - env_file: - - .env - user: root - depends_on: - - mysql - volumes: - - wordpress_data:/var/www/html - - ./:/var/www/html/wp-content/plugins/${PLUGIN_SLUG} - networks: - - plugin_network + wordpress: + build: + context: ./.docker + args: + WP_VERSION: ${WP_VERSION} + PHP_VERSION: ${PHP_VERSION} + image: ${PLUGIN_SLUG}:latest-wp${WP_VERSION}-php${PHP_VERSION} + restart: always + ports: + - '8890:80' + environment: + WP_VERSION: ${WP_VERSION} + PHP_VERSION: ${PHP_VERSION} + COVERAGE: ${COVERAGE:-} + env_file: + - .env + user: root + depends_on: + - mysql + volumes: + - wordpress_data:/var/www/html + - ./:/var/www/html/wp-content/plugins/${PLUGIN_SLUG} + networks: + - plugin_network - mysql: - image: mariadb:10 - restart: always - ports: - - '3306:3306' - environment: - MYSQL_ROOT_PASSWORD: ${WORDPRESS_DB_PASSWORD} - MYSQL_USER: ${WORDPRESS_DB_USER} - MYSQL_PASSWORD: ${WORDPRESS_DB_PASSWORD} - MYSQL_DATABASE: ${WORDPRESS_DB_NAME} - volumes: - - db:/var/lib/mysql - networks: - - plugin_network + mysql: + image: mariadb:10 + restart: always + ports: + - '3306:3306' + environment: + MYSQL_ROOT_PASSWORD: ${WORDPRESS_DB_PASSWORD} + MYSQL_USER: ${WORDPRESS_DB_USER} + MYSQL_PASSWORD: ${WORDPRESS_DB_PASSWORD} + MYSQL_DATABASE: ${WORDPRESS_DB_NAME} + volumes: + - db:/var/lib/mysql + networks: + - plugin_network networks: - plugin_network: - driver: bridge + plugin_network: + driver: bridge volumes: - wordpress_data: - db: + wordpress_data: + db: diff --git a/tests/Acceptance.suite.dist.yml b/tests/Acceptance.suite.dist.yml index 95f2187..c489d1a 100644 --- a/tests/Acceptance.suite.dist.yml +++ b/tests/Acceptance.suite.dist.yml @@ -5,36 +5,36 @@ actor: AcceptanceTester bootstrap: _bootstrap.php modules: - enabled: - - lucatume\WPBrowser\Module\WPBrowser - - lucatume\WPBrowser\Module\WPDb - - lucatume\WPBrowser\Module\WPFilesystem - - SnapWP\Helper\Tests\Helper\Acceptance - - Asserts - config: - lucatume\WPBrowser\Module\WPBrowser: - url: "%WORDPRESS_URL%" - adminUsername: "%WORDPRESS_ADMIN_USER%" - adminPassword: "%WORDPRESS_ADMIN_PASSWORD%" - adminPath: "/wp-admin" - headers: - X_WPBROWSER_REQUEST: 1 - X_TEST_REQUEST: 1 - X_APM_REQUEST: 1 - connect_timeout: 3 - lucatume\WPBrowser\Module\WPDb: - dsn: "%TEST_DB_DSN%" - user: "%TEST_DB_USER%" - password: "%TEST_DB_PASSWORD%" - dump: "tests/_data/dump.sql" - populate: true - cleanup: true - reconnect: false - url: "%WORDPRESS_URL%" - tablePrefix: "%WORDPRESS_TABLE_PREFIX%" - lucatume\WPBrowser\Module\WPFilesystem: - wpRootFolder: "%WORDPRESS_ROOT_DIR%" - themes: "/wp-content/themes" - plugins: "/wp-content/plugins" - mu-plugins: "/wp-content/mu-plugins" - uploads: "/wp-content/uploads" + enabled: + - lucatume\WPBrowser\Module\WPBrowser + - lucatume\WPBrowser\Module\WPDb + - lucatume\WPBrowser\Module\WPFilesystem + - SnapWP\Helper\Tests\Helper\Acceptance + - Asserts + config: + lucatume\WPBrowser\Module\WPBrowser: + url: '%WORDPRESS_URL%' + adminUsername: '%WORDPRESS_ADMIN_USER%' + adminPassword: '%WORDPRESS_ADMIN_PASSWORD%' + adminPath: '/wp-admin' + headers: + X_WPBROWSER_REQUEST: 1 + X_TEST_REQUEST: 1 + X_APM_REQUEST: 1 + connect_timeout: 3 + lucatume\WPBrowser\Module\WPDb: + dsn: '%TEST_DB_DSN%' + user: '%TEST_DB_USER%' + password: '%TEST_DB_PASSWORD%' + dump: 'tests/_data/dump.sql' + populate: true + cleanup: true + reconnect: false + url: '%WORDPRESS_URL%' + tablePrefix: '%WORDPRESS_TABLE_PREFIX%' + lucatume\WPBrowser\Module\WPFilesystem: + wpRootFolder: '%WORDPRESS_ROOT_DIR%' + themes: '/wp-content/themes' + plugins: '/wp-content/plugins' + mu-plugins: '/wp-content/mu-plugins' + uploads: '/wp-content/uploads' diff --git a/tests/Integration.suite.dist.yml b/tests/Integration.suite.dist.yml index bb769d3..945e829 100644 --- a/tests/Integration.suite.dist.yml +++ b/tests/Integration.suite.dist.yml @@ -5,25 +5,26 @@ actor: IntegrationTester bootstrap: _bootstrap.php modules: - enabled: - - SnapWP\Helper\Tests\Helper\Integration - - lucatume\WPBrowser\Module\WPLoader - config: - lucatume\WPBrowser\Module\WPLoader: - loadOnly: false - wpRootFolder: "%WORDPRESS_ROOT_DIR%" - dbName: "%TEST_DB_NAME%" - dbHost: "%TEST_DB_HOST%" - dbUser: "%TEST_DB_USER%" - dbPassword: "%TEST_DB_PASSWORD%" - wpDebug: true - tablePrefix: "%TEST_TABLE_PREFIX%" - domain: "%WORDPRESS_DOMAIN%" - adminEmail: "admin@%WORDPRESS_DOMAIN%" - title: "Integration Tests" - plugins: [ - "wp-graphql/wp-graphql.php", - "wp-graphql-content-blocks/wp-graphql-content-blocks.php", - "snapwp-helper/snapwp-helper.php" - ] - theme: "twentytwentyfour" + enabled: + - SnapWP\Helper\Tests\Helper\Integration + - lucatume\WPBrowser\Module\WPLoader + config: + lucatume\WPBrowser\Module\WPLoader: + loadOnly: false + wpRootFolder: '%WORDPRESS_ROOT_DIR%' + dbName: '%TEST_DB_NAME%' + dbHost: '%TEST_DB_HOST%' + dbUser: '%TEST_DB_USER%' + dbPassword: '%TEST_DB_PASSWORD%' + wpDebug: true + tablePrefix: '%TEST_TABLE_PREFIX%' + domain: '%WORDPRESS_DOMAIN%' + adminEmail: 'admin@%WORDPRESS_DOMAIN%' + title: 'Integration Tests' + plugins: + [ + 'wp-graphql/wp-graphql.php', + 'wp-graphql-content-blocks/wp-graphql-content-blocks.php', + 'snapwp-helper/snapwp-helper.php', + ] + theme: 'twentytwentyfour'