WordPress.org

Make WordPress Core

Opened 5 months ago

Closed 5 months ago

Last modified 5 months ago

#53606 closed defect (bug) (fixed)

wp-api-generated.js needs updating, needs CI to test for changes

Reported by: johnbillion Owned by: johnbillion
Milestone: 5.8 Priority: normal
Severity: normal Version: 5.8
Component: Build/Test Tools Keywords: has-unit-tests dev-reviewed commit
Focuses: Cc:

Description

The tests/qunit/fixtures/wp-api-generated.js file is under version control and it gets written to during the test_build_wp_api_client_fixtures() test. Sometimes when the REST API schema gets updated this file gets forgotten.

This is currently the case and was introduced in [51241]. The file is not up to date with the latest REST API schema.

To reproduce:

composer test -- --filter test_build_wp_api_client_fixtures && git status --exit-code

We should:

  • Update wp-api-generated.js to reflect the latest schema
  • Add tests to CI so it fails if this happens again

Change History (9)

#1 @desrosj
5 months ago

In 51351:

Tests: Update the wp-api-generated.js fixture.

Follow up to [51241].

Props johnbillion.
See #53606.

#2 @johnbillion
5 months ago

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

#3 @desrosj
5 months ago

  • Keywords dev-reviewed commit added; dev-feedback removed

PR looks good. Marking for commit and backport.

#4 @johnbillion
5 months ago

  • Component changed from REST API to Build/Test Tools
  • Owner set to johnbillion
  • Status changed from new to accepted

#5 @johnbillion
5 months ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 51355:

Build/Test Tools: Add assertions to ensure version-controlled files are not modified during CI, and fix the grunt clean command.

Some tests and some commands that run during the build steps modify files that are under version control. This adds assertions to ensure that these files don't remain in a modified state after the test runs on CI.

This also fixes the grunt clean command which erroneously deletes script-loader-packages.php. This file is re-populated during the build, but deleting it during the clean is undesirable.

Fixes #53606

#6 @johnbillion
5 months ago

In 51357:

Build/Test Tools: Add assertions to ensure version-controlled files are not modified during CI, and fix the grunt clean command.

Some tests and some commands that run during the build steps modify files that are under version control. This adds assertions to ensure that these files don't remain in a modified state after the test runs on CI.

This also fixes the grunt clean command which erroneously deletes script-loader-packages.php. This file is re-populated during the build, but deleting it during the clean is undesirable.

Merges [51355] to the 5.8 branch.

Fixes #53606

#7 @peterwilsoncc
5 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

[51351] looks good for backporting to the 5.8 branch.

#8 @desrosj
5 months ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 51361:

Tests: Update the wp-api-generated.js fixture.

Follow up to [51241].

Props johnbillion, peterwilsoncc.
Merges [51351] to the 5.8 branch.
Fixes #53606.

Note: See TracTickets for help on using tickets.