Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't Use Real Paths In wp-env Tests #50800

Closed
ObliviousHarmony opened this issue May 19, 2023 · 1 comment · Fixed by #50894
Closed

Don't Use Real Paths In wp-env Tests #50800

ObliviousHarmony opened this issue May 19, 2023 · 1 comment · Fixed by #50894
Assignees
Labels
[Package] Env /packages/env [Type] Bug An existing feature does not function as intended

Comments

@ObliviousHarmony
Copy link
Contributor

Description

We have a report that the wp-env unit tests will fail if your repository directory is not named gutenberg. The problem stems from the many uses of relative paths in config/test/parse-config.js.

Step-by-step reproduction instructions

  1. Rename your Gutenberg directory
  2. Run npm run test:unit packages/env, they should fail

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@ObliviousHarmony ObliviousHarmony added [Type] Bug An existing feature does not function as intended [Package] Env /packages/env labels May 19, 2023
@ObliviousHarmony
Copy link
Contributor Author

Since none of these require reading from any real config file, there's not really a reason to have real paths either. We can replace all of the relative paths in the test file with fake absolute paths. This has the added benefit of simplifying all of the tests too.

@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label May 23, 2023
@priethor priethor removed the [Status] In Progress Tracking issues with work in progress label Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Env /packages/env [Type] Bug An existing feature does not function as intended
2 participants