-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update plugin unit testing with more WordPress versions and Nightly W…
…ordPress builds (#1887) * Modernize plugin testing * Fix directory * Fix the path * Our older composer setup does not run on PHP 7.4 * Ensure we end the command * Ensure we're passing WP_VERSION * FROM should be after ARG * Update PHP version * Normalize E2E tests * Ensure we're using PHP 8.2 for all * Remove redudant steps and normalize output * Reverse the order of the E2E tests * Don't fail fast with Matrix * Reintroduce "Maybe update DB" step to E2E tests * Update DB on correct workflow * Upload fail output to correct location * Fix output path * Revert E2E changes * Use current WP version for default * Use current WP version for default * Include WP version for current E2E build * Revert plugin E2E test to WP 6.4 * Add plugin unit tests for WordPress nightly * Fix workflow name * Update test names for better identification. * Call out existing plugin E2E tests are against legacy Faust.
- Loading branch information
Chris Wiegman
authored
May 16, 2024
1 parent
ec6f4e9
commit 6e5ef28
Showing
10 changed files
with
112 additions
and
53 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: E2E Test | ||
name: E2E Test Packages (Legacy) | ||
|
||
on: | ||
pull_request: | ||
|
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: E2E Nightly Test | ||
name: E2E Test Packages (Nightly) | ||
|
||
on: | ||
workflow_run: | ||
|
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Unit Test Plugin / WordPress Nightly | ||
|
||
on: | ||
pull_request: | ||
paths-ignore: | ||
- '**/*.md' | ||
|
||
jobs: | ||
unit_test_plugin: | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Create Docker Containers | ||
working-directory: ./plugins/faustwp | ||
run: | | ||
docker-compose build \ | ||
--build-arg WP_VERSION=6.5 | ||
docker-compose up -d | ||
- name: Wait for db | ||
run: | | ||
while ! mysqladmin ping --host=127.0.0.1 --port=33066 --password=$MYSQL_ROOT_PASSWORD --silent; do | ||
sleep 1 | ||
done | ||
- name: Setup testing framework | ||
working-directory: ./plugins/faustwp | ||
run: docker exec -e COVERAGE=1 $(docker-compose ps -q wordpress) init-testing-environment.sh | ||
|
||
- name: Ensure Correct WordPress version | ||
working-directory: ./plugins/faustwp | ||
run: | | ||
docker exec -w /var/www/html/wp-content/plugins/faustwp $(docker-compose ps -q wordpress) wp core version --allow-root | ||
docker exec -w /var/www/html/wp-content/plugins/faustwp $(docker-compose ps -q wordpress) wp core upgrade --version=nightly --force --allow-root | ||
docker exec -w /var/www/html/wp-content/plugins/faustwp $(docker-compose ps -q wordpress) wp core version --allow-root | ||
- name: Install and activate WP GraphQL | ||
working-directory: ./plugins/faustwp | ||
run: docker exec -e COVERAGE=1 -w /var/www/html/wp-content/plugins/faustwp $(docker-compose ps -q wordpress) wp plugin install wp-graphql --activate --allow-root | ||
|
||
- name: Install Dependencies | ||
working-directory: ./plugins/faustwp | ||
run: docker exec -e COVERAGE=1 -w /var/www/html/wp-content/plugins/faustwp $(docker-compose ps -q wordpress) composer install | ||
|
||
- name: Run unit tests | ||
working-directory: ./plugins/faustwp | ||
run: docker exec -e COVERAGE=1 -w /var/www/html/wp-content/plugins/faustwp $(docker-compose ps -q wordpress) composer test |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Unit Test Plugin | ||
|
||
on: | ||
pull_request: | ||
paths-ignore: | ||
- '**/*.md' | ||
|
||
jobs: | ||
unit_test_plugin: | ||
name: WordPress ${{ matrix.wordpress }} | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
matrix: | ||
wordpress: [ '6.5', '6.4', '6.3', '6.2', '6.1' ] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Create Docker Containers | ||
env: | ||
WP_VERSION: ${{ matrix.wordpress }} | ||
working-directory: ./plugins/faustwp | ||
run: | | ||
docker-compose build \ | ||
--build-arg WP_VERSION=${{ matrix.wordpress }} | ||
docker-compose up -d | ||
- name: Wait for db | ||
run: | | ||
while ! mysqladmin ping --host=127.0.0.1 --port=33066 --password=$MYSQL_ROOT_PASSWORD --silent; do | ||
sleep 1 | ||
done | ||
- name: Setup testing framework | ||
working-directory: ./plugins/faustwp | ||
run: docker exec -e COVERAGE=1 $(docker-compose ps -q wordpress) init-testing-environment.sh | ||
|
||
- name: Install and activate WP GraphQL | ||
working-directory: ./plugins/faustwp | ||
run: docker exec -e COVERAGE=1 -w /var/www/html/wp-content/plugins/faustwp $(docker-compose ps -q wordpress) wp plugin install wp-graphql --activate --allow-root | ||
|
||
- name: Install Dependencies | ||
working-directory: ./plugins/faustwp | ||
run: docker exec -e COVERAGE=1 -w /var/www/html/wp-content/plugins/faustwp $(docker-compose ps -q wordpress) composer install | ||
|
||
- name: Run unit tests | ||
working-directory: ./plugins/faustwp | ||
run: docker exec -e COVERAGE=1 -w /var/www/html/wp-content/plugins/faustwp $(docker-compose ps -q wordpress) composer test |
This file contains 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
This file contains 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