Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,19 @@ jobs:
php-version: ${{ matrix.php-versions }}
coverage: xdebug

# Workaround for PHP 8.3 (and potentially other versions): the GitHub
# Actions ubuntu-latest runner ships with a pre-installed PHP that leaves
# an empty regular file at /run/php/php<version>-fpm.sock. setup-php
# installs a different patch version on top, but PHP-FPM never replaces
# the stale file with a real Unix socket, so nginx returns 502.
# Removing the stale file and restarting PHP-FPM forces a clean socket.
- name: Restart PHP-FPM
run: |
sudo rm -f /run/php/php${{ matrix.php-versions }}-fpm.sock
sudo systemctl restart php${{ matrix.php-versions }}-fpm
sleep 1
ls -la /run/php/

# Configure nginx to use the PHP version and WOrdPress installation at /var/www/html
- name: Configure nginx site
run: |
Expand Down Expand Up @@ -305,7 +318,7 @@ jobs:
# Run Codeception End to End Tests.
- name: Run tests/${{ matrix.test-groups }}
working-directory: ${{ env.PLUGIN_DIR }}
run: php vendor/bin/codecept run tests/${{ matrix.test-groups }} --fail-fast
run: php vendor/bin/codecept run tests/${{ matrix.test-groups }} --env headless --fail-fast

# Artifacts are data generated by this workflow that we want to access, such as log files, screenshots, HTML output.
# The if: failure() directive means that this will run when the workflow fails e.g. if a test fails, which is needed
Expand Down
25 changes: 24 additions & 1 deletion tests/EndToEnd.suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,27 @@ modules:
wpRootFolder: '%WORDPRESS_ROOT_DIR%'
dbUrl: '%WORDPRESS_DB_URL%'
domain: '%WORDPRESS_DOMAIN%'


# Environments
#
# Run with `vendor/bin/codecept run EndToEnd --env headless` to run Chrome in
# headless mode (used by GitHub Actions). Without `--env headless`, Chrome runs
# in headed mode so a developer can watch tests execute locally.
env:
headless:
modules:
config:
lucatume\WPBrowser\Module\WPWebDriver:
capabilities:
"goog:chromeOptions":
args:
- "--headless"
- "--disable-gpu"
- "--disable-dev-shm-usage"
- "--disable-software-rasterizer"
- "--proxy-server='direct://'"
- "--proxy-bypass-list=*"
- "--no-sandbox"
- "--user-agent=%TEST_SITE_HTTP_USER_AGENT%"
prefs:
download.default_directory: '%WORDPRESS_ROOT_DIR%'
Loading