Opened 3 years ago
Closed 5 weeks ago
#59707 closed enhancement (fixed)
test for wp_schedule_delete_old_privacy_export_files
| Reported by: | pbearne | Owned by: | wildworks |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.2 |
| Component: | Privacy | Version: | |
| Severity: | normal | Keywords: | has-patch has-unit-tests |
| Cc: | Focuses: | tests |
Description
Change History (15)
This ticket was mentioned in PR #5550 on WordPress/wordpress-develop by @pbearne.
3 years ago
#1
- Keywords has-patch has-unit-tests added
#2
@
2 years ago
- Component Build/Test Tools → Privacy
- Milestone Awaiting Review → Future Release
- Type defect (bug) → enhancement
#3
@
4 months ago
- Focuses tests added
Adding the tests focus, which is used to indicate a ticket is solely focused on adding tests.
@masteradhoc commented on PR #5550:
2 months ago
#4
@pbearne could you check the last feedback from @mindctrl? i'd like to milestone this for 7.1 so we can get this added soon.
This ticket was mentioned in Slack in #core by masteradhoc. View the logs.
2 months ago
#7
@
2 months ago
This was discussed in today’s bug scrub. It will be kept in the 7.1 release to be finished this week. As it adds tests only, I believe It can be safely included in the beta cycle.
@roshniahuja14 commented on PR #5550:
2 months ago
#8
Thanks @pbearne for the patch. I've prepared a refreshed version of the test that resolves the outstanding review feedback from @mindctrl on this PR:
- Calls
parent::set_up()/parent::tear_down(). - Moves the
wp_installing( false )reset intotear_down()so it always runs even if an assertion fails. - Adds a third test,
test_wp_schedule_delete_old_privacy_export_files_already_scheduled(), covering the branch where the event is already scheduled (no duplicate is created). - Adds a standard file docblock,
@group privacy(the ticket's reassigned component), and assertion failure messages.
Verified locally against trunk: OK (3 tests, 5 assertions), and PHPCS is clean.
Happy to open a PR against your branch or you're welcome to cherry-pick — whichever you prefer. See #59707.
This ticket was mentioned in PR #12563 on WordPress/wordpress-develop by @roshniahuja14.
2 months ago
#9
Adds unit-test coverage for wp_schedule_delete_old_privacy_export_files(), exercising all three branches of the function:
- Schedules the
wp_privacy_delete_old_export_filesevent when it is not already scheduled. - Skips scheduling while WordPress is installing (
wp_installing()). - Does not create a duplicate event when one is already scheduled.
This builds on @pbearne's work in #5550 and incorporates @mindctrl's review feedback from that PR:
- Calls
parent::set_up()/parent::tear_down(). - Moves the
wp_installing( false )reset intotear_down()so it always runs. - Adds the "already scheduled" branch test.
- Adds a standard file docblock,
@group privacy, and assertion failure messages.
Verified locally against trunk: OK (3 tests, 5 assertions); PHPCS clean.
Note: this is an alternative to #5550 for the same ticket — happy to fold it back into that PR instead if maintainers prefer.
@roshniahuja14 commented on PR #5550:
2 months ago
#10
This ticket was mentioned in Slack in #core by adrianduffell. View the logs.
8 weeks ago
@wildworks commented on PR #5550:
7 weeks ago
#12
@pbearne, Can you address the feedback from Copilot? Both seem like reasonable suggestions.
#13
@
6 weeks ago
- Milestone 7.1 → 7.2
As the 7.1 RC1 is approaching and the attached PR does not seem to be complete yet, I'd like to punt this to 7.2.
@masteradhoc commented on PR #5550:
6 weeks ago
#14
Thank you @pbearne! The PR would be ready for another review and merge. @t-hamano Can you help out here?
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Since this is about adding tests and not a general build or test tooling change, I'm reassigning it to the relevant component.