Skip to content

Allow customization of the ARTIFACTS_PATH via WP_ARTIFACTS_PATH env var - #35371

Merged
kevin940726 merged 8 commits into
WordPress:trunkfrom
gocodebox:add/ARTIFACTS_PATH-env-var
Oct 9, 2021
Merged

Allow customization of the ARTIFACTS_PATH via WP_ARTIFACTS_PATH env var#35371
kevin940726 merged 8 commits into
WordPress:trunkfrom
gocodebox:add/ARTIFACTS_PATH-env-var

Conversation

@thomasplevy

@thomasplevy thomasplevy commented Oct 5, 2021

Copy link
Copy Markdown
Contributor

Description

Per #34797

Allows 3rd-party customization of the ARTIFACTS_PATH used by @wordpress/scripts when running E2E tests by defining WP_ARTIFACTS_PATH as an environment variable.

If the env variable is empty, falls back to the default location.

How has this been tested?

I've manually patched my code into the @worpress/scripts package in my plugin's node_modules dir and run my e2e tests, forcing a failure and ran tests once without an env var set to ensure artifacts end up in the intended location and again after adding the new env var to ensure that artifacts end up in the custom location.

Edit: I've also tested this against this repo's npm run test-e2e both with the default usage (no ENV var) and with the ENV var set at runtime, eg: WP_ARTIFACTS_PATH=custom/artifacts npm run test-e2e

All these tests result in failed tests storing artifacts in the expected location

Screenshots

Types of changes

New feature (non-breaking change which adds functionality)

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR (please manually search all *.native.js files for terms that need renaming or removal).

@thomasplevy
thomasplevy marked this pull request as draft October 5, 2021 22:19
@thomasplevy
thomasplevy marked this pull request as ready for review October 5, 2021 22:42
@talldan
talldan requested a review from kevin940726 October 6, 2021 02:01
@talldan talldan added [Tool] WP Scripts /packages/scripts [Type] Enhancement A suggestion for improvement. labels Oct 6, 2021
@talldan

talldan commented Oct 6, 2021

Copy link
Copy Markdown
Contributor

It would be good to update the changelog file for the scripts package, and maybe add some documentation along with this change.

Some details here on updating the changelog - https://github.com/WordPress/gutenberg/blob/HEAD/packages/README.md#maintaining-changelogs.

@thomasplevy

Copy link
Copy Markdown
Contributor Author

@talldan Of course!

I'm not sure if the location of the documentation makes sense. I didn't see anything specific in the README already about the artifacts where it would make sense to add information about the update in this PR so I added a new section.

Also, I don't see any other section with more than one <h4> heading, each has only a single <h4> for "Additional Information" so maybe this should belong under there? I'm not clear what the precedent is here and I'm happy to move it around if I've broken an established formula that's not apparent to me.

Also, of course, notes welcome on the language and wording I've chosen.

Thanks!

talldan
talldan previously approved these changes Oct 8, 2021

@talldan talldan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks for updating the PR!

Comment thread packages/scripts/README.md Outdated
@talldan
talldan dismissed their stale review October 8, 2021 03:04

outdated

Comment thread packages/scripts/config/jest-environment-puppeteer/index.js Outdated

@kevin940726 kevin940726 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍. Thank you for making this PR ♥️

@kevin940726
kevin940726 merged commit ef26639 into WordPress:trunk Oct 9, 2021
@github-actions github-actions Bot added this to the Gutenberg 11.8 milestone Oct 9, 2021
@thomasplevy

Copy link
Copy Markdown
Contributor Author

Awesome thanks @kevin940726

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Tool] WP Scripts /packages/scripts [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants