From 584ae5a2c400571cac62ccd727ad3f2d784ccf07 Mon Sep 17 00:00:00 2001 From: Max Lyuchin Date: Tue, 22 Feb 2022 14:52:16 +0300 Subject: [PATCH 1/3] Permalinks in multiple configurations --- _includes/markdown/Testing.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/_includes/markdown/Testing.md b/_includes/markdown/Testing.md index 4deb808..82b2738 100644 --- a/_includes/markdown/Testing.md +++ b/_includes/markdown/Testing.md @@ -45,6 +45,10 @@ cy.visit( `/wp-admin` ); The purpose of E2E testing is to ensure the user-facing features work as expected. In the WordPress context, we can extend that purpose to "working as expected against supported WP versions and plugins/themes". At 10up, we're using GitHub Actions matrix and `wp-env` config override to solve that problem by [generating `wp-env` config](https://github.com/10up/simple-podcasting/blob/develop/tests/bin/set-core-version.js) for [each matrix](https://github.com/10up/simple-podcasting/blob/develop/.github/workflows/test-branch.yml#L30-L31). We're doing it for WP core version only, but it can be adapted and updated to handle more complex configurations. +### Permalinks in multiple configurations + +When testing against non-default (latest) WordPress core, there is [known issue with file permissions](https://github.com/WordPress/gutenberg/issues/28201). This prevents us to use permalinks in testing because `.htaccess` file could not be created in GitHub Actions environment. File permissions could be fixed with [`npm run wp-env run tests-wordpress "chmod -c ugo+w /var/www/html"`](https://github.com/10up/ads-txt/pull/84/files) during the initialization. + ### Debugging Cypress on GitHub Actions In rare scenarios, tests may pass locally but fail on CI. To debug such cases, we use Cypress' [screenshot and video recording capabilities](https://docs.cypress.io/guides/guides/screenshots-and-videos#Screenshots) in tandem with the [Upload Artifact Action](https://github.com/actions/upload-artifact). From 943207e309a3050aeaff49098561388162cba9be Mon Sep 17 00:00:00 2001 From: Max Lyuchin Date: Thu, 24 Feb 2022 09:54:40 +0300 Subject: [PATCH 2/3] Updated title of permalinks section, removed WordPress core reference --- _includes/markdown/Testing.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_includes/markdown/Testing.md b/_includes/markdown/Testing.md index 82b2738..fc74aed 100644 --- a/_includes/markdown/Testing.md +++ b/_includes/markdown/Testing.md @@ -45,9 +45,9 @@ cy.visit( `/wp-admin` ); The purpose of E2E testing is to ensure the user-facing features work as expected. In the WordPress context, we can extend that purpose to "working as expected against supported WP versions and plugins/themes". At 10up, we're using GitHub Actions matrix and `wp-env` config override to solve that problem by [generating `wp-env` config](https://github.com/10up/simple-podcasting/blob/develop/tests/bin/set-core-version.js) for [each matrix](https://github.com/10up/simple-podcasting/blob/develop/.github/workflows/test-branch.yml#L30-L31). We're doing it for WP core version only, but it can be adapted and updated to handle more complex configurations. -### Permalinks in multiple configurations +### Fixing permalinks issue -When testing against non-default (latest) WordPress core, there is [known issue with file permissions](https://github.com/WordPress/gutenberg/issues/28201). This prevents us to use permalinks in testing because `.htaccess` file could not be created in GitHub Actions environment. File permissions could be fixed with [`npm run wp-env run tests-wordpress "chmod -c ugo+w /var/www/html"`](https://github.com/10up/ads-txt/pull/84/files) during the initialization. +There is [known issue with file permissions](https://github.com/WordPress/gutenberg/issues/28201). This prevents us to use permalinks in testing because `.htaccess` file could not be created in GitHub Actions environment. File permissions could be fixed with [`npm run wp-env run tests-wordpress "chmod -c ugo+w /var/www/html"`](https://github.com/10up/ads-txt/pull/84/files) during the initialization. ### Debugging Cypress on GitHub Actions From b5f3867fb5e607df9bfa6782d92cb025e5e9d97d Mon Sep 17 00:00:00 2001 From: Max Lyuchin Date: Thu, 24 Feb 2022 10:56:40 +0300 Subject: [PATCH 3/3] Typos in _includes/markdown/Testing.md Co-authored-by: Tung Du --- _includes/markdown/Testing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_includes/markdown/Testing.md b/_includes/markdown/Testing.md index fc74aed..56e325f 100644 --- a/_includes/markdown/Testing.md +++ b/_includes/markdown/Testing.md @@ -47,7 +47,7 @@ The purpose of E2E testing is to ensure the user-facing features work as expecte ### Fixing permalinks issue -There is [known issue with file permissions](https://github.com/WordPress/gutenberg/issues/28201). This prevents us to use permalinks in testing because `.htaccess` file could not be created in GitHub Actions environment. File permissions could be fixed with [`npm run wp-env run tests-wordpress "chmod -c ugo+w /var/www/html"`](https://github.com/10up/ads-txt/pull/84/files) during the initialization. +There is [a known issue with file permissions](https://github.com/WordPress/gutenberg/issues/28201). This prevents us to use permalinks in testing because the `.htaccess` file could not be created in the GitHub Actions environment. File permissions could be fixed with [`npm run wp-env run tests-wordpress "chmod -c ugo+w /var/www/html"`](https://github.com/10up/ads-txt/pull/84/files) during the initialization. ### Debugging Cypress on GitHub Actions