Make WordPress Core

Opened 5 weeks ago

Last modified 10 days ago

#63167 new task (blessed)

Test tool and unit test improvements for 6.9

Reported by: desrosj's profile desrosj Owned by:
Milestone: 6.9 Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: has-patch
Focuses: Cc:

Description

This ticket is for various fixes and improvements in PHPUnit tests that don't have a more specific ticket, as well as general improvements to the GitHub Actions workflows that run automated testing.

Change History (5)

#1 @peterwilsoncc
5 weeks ago

In 60100:

Build/Test Tools: Expand tests of paginate_links' format parameter.

Introduces additional tests for custom formatted pagination links to include:

  • plain permalinks
  • html file extensions
  • hyphen separated links
  • URL fragments

See #63167.

#2 @SergeyBiryukov
3 weeks ago

In 60137:

Tests: Simplify the tests for force_ssl_admin().

Includes:

  • The $forced static variable is reset to false before each test, and the function always returns the previous value on the first call, so there is no need to pass the same value from the data provider.
  • Clarifying data provider keys by removing the “first call” references to avoid confusion, as the test method always calls the function twice for each input value.
  • Replacing unnecessarily redundant test method name for consistency with other tests.
  • Moving the data provider after the test method for consistency with other tests.
  • Adjusting DocBlock formatting as per the documentation standards.

Follow-up to [59830].

See #63167.

#3 @SergeyBiryukov
3 weeks ago

In 60148:

Tests: Use the ms-required group where appropriate.

This replaces the if ( is_multisite() ) conditional wrapping entire test classes with the ms-required group for more consistency across the test suite.

Follow-up to [40520].

See #63167.

This ticket was mentioned in PR #8701 on WordPress/wordpress-develop by @desrosj.


11 days ago
#4

  • Keywords has-patch added

There are a few errors happening when running npm run env:start:

The repository at "/var/www" does not have the correct ownership and git refuses to use it:

fatal: detected dubious ownership in repository at '/var/www'
To add an exception for this directory, call:

        git config --global --add safe.directory /var/www

Composer could not detect the root package (wordpress/wordpress) version, defaulting to '1.0.0'. See https://getcomposer.org/root-version

It appears that adding a version to the composer.json file fixes both of these errors.

Trac ticket: https://core.trac.wordpress.org/ticket/63167

#5 @SirLouen
10 days ago

@desrosj
I would like to add for consideration these two tickets
https://core.trac.wordpress.org/ticket/63135
https://core.trac.wordpress.org/ticket/63172
Adding FTP and Mail support to Docker image.
For mail, Mailhog is pretty obvious.
For ftp, vsftpd for simplicity and speed
It's a little pain to test in env, without so basic tooling. Other virtualization like Chassis seem to have some plugins for all these but with docker we can control this with the start script.

Note: See TracTickets for help on using tickets.