WordPress.org

Make WordPress Core

Opened 6 weeks ago

Last modified 5 weeks ago

#52689 new defect (bug)

Error with `npm run build` as `verify:source-maps` task runs in `build/wp-content`

Reported by: afragen Owned by:
Milestone: 5.8 Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: has-patch has-unit-tests
Focuses: Cc:

Description

Apparently since r50441 there are new assertions that run after the build is finished. https://wordpress.slack.com/archives/C02RQBWTW/p1614633511079100

This results in an error and script aborting depending upon the contents of build/wp-content this can be in any of the subfolders. In my case I have a number of inactive plugins in build/wp-content/plugins.

It would seem skipping some of these tests in build/wp-content would be a solution.

Pinging @johnbillion and @desrosj

Change History (5)

#1 @desrosj
6 weeks ago

  • Milestone changed from Awaiting Review to 5.8

#2 @johnbillion
6 weeks ago

What gets skipped should technically match what's in .gitignore I think. No this is not true because that would defeat the point of scanning the build dir.

I've used gitignore-globs successfully in the past for this.

Last edited 6 weeks ago by johnbillion (previous) (diff)

#3 @johnbillion
6 weeks ago

  • Keywords needs-patch added

This ticket was mentioned in PR #1061 on WordPress/wordpress-develop by johnbillion.


5 weeks ago

  • Keywords has-patch has-unit-tests added; needs-patch removed

https://core.trac.wordpress.org/ticket/52689

In [50441] the tests were switched to run against src by default instead of build.

This introduced one issue, the test_php_and_js_shortcode_attribute_regexes_match() now fails when run against build because it assumes the js/_enqueues/wp/shortcode.js file exists, which it does not in build. Running the tests against build is still possible so we should fix this, especially as existing contributors will see this unless (or until) they switch to using src for their tests.

## To test:

  1. Delete the build directory if you have one
  2. Change ABSPATH in wp-tests-config.php to point to src
  3. Run npm run env:restart
  4. Run npm run test:php -- --filter test_php_and_js_shortcode_attribute_regexes_match and confirm it passes
  5. Change ABSPATH in wp-tests-config.php to point to build
  6. Run npm run env:restart
  7. Run npm run build
  8. Run npm run test:php -- --filter test_php_and_js_shortcode_attribute_regexes_match and confirm it passes
Note: See TracTickets for help on using tickets.