WordPress.org

Make WordPress Core

Opened 6 months ago

Closed 6 months ago

Last modified 6 months ago

#48933 closed defect (bug) (fixed)

Incorrect configuration value name in unit tests

Reported by: Rarst Owned by: SergeyBiryukov
Milestone: 5.4 Priority: low
Severity: minor Version:
Component: Build/Test Tools Keywords:
Focuses: Cc:

Description

The default test configuration in phpunit.xml.dist has threshold entry for slow tests that is incorrectly named.

The current config says <element key="slow_threshold"> and the name expected by code is slowThreshold.

While the code defaults to same 500ms value anyway, this is very confusing when config is edited or followed as an example and the new value doesn't apply.

Change History (3)

#1 @SergeyBiryukov
6 months ago

  • Milestone changed from Awaiting Review to 5.4

Good catch! This was committed as slowThreshold in [35214], then switched to slow_threshold in [45607] per the coding standards.

Either the option name change should be reverted (I think the coding standards only apply to the variable name), or the option handling in SpeedTrapListener::loadOptions() should be changed too.

#2 @SergeyBiryukov
6 months ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 46881:

Tests: Correct the slowThreshold option name for SpeedTrapListener.

The previous change in [45607] appears to be accidental.

Props Rarst.
Fixes #48933.

#3 @SergeyBiryukov
6 months ago

Incidentally, the option name in tests/phpunit/multisite.xml was not altered in [45607] and is still correct.

Note: See TracTickets for help on using tickets.