Opened 10 years ago
Closed 6 years ago
#6162 closed enhancement (fixed)
Tests requiring multisite should be marked as skipped in non-multisite environments
Reported by: | DJPaul | Owned by: | boonebgorges |
---|---|---|---|
Milestone: | 4.0 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Build/Test Tools | Keywords: | needs-patch good-first-bug |
Cc: |
Description
Some of our tests rely on multisite, and we've mostly used a is_multisite
check with a return
if the tests are being run in a non-multisite environment. phpUnit interprets the test as having passed successfully, when it hasn't been run -- it's been skipped.
While this is not at all a significant issue, I believe we should either move the multisite tests into a separate test suite configuration in phpunit.xml.dist, so they aren't run at all, or we could update these tests to use phpUnit's markTestSkipped
method so that the test counts as having been skipped.
Change History (8)
#1
@
10 years ago
- Keywords needs-patch good-first-bug added
- Milestone changed from Awaiting Review to Future Release
This ticket was mentioned in Slack in #buddypress by imath. View the logs.
10 years ago
#3
follow-up:
↓ 4
@
10 years ago
move the multisite tests into a separate test suite configuration in phpunit.xml.dist, so they aren't run at all
I like this option.
#4
in reply to:
↑ 3
@
10 years ago
Replying to r-a-y:
move the multisite tests into a separate test suite configuration in phpunit.xml.dist, so they aren't run at all
I like this option.
My only misgiving is that some tests that require MS are closely related to another component (say, Activity), and moving them away from the existing activity tests makes them a bit harder to find. This is an unavoidable problem - there will always be more than one place where a test might be appropriate - but we should try to be consistent about our treatment. Multisite is just one of the possible "toggles" in a WP/BP environment - think of all of our component settings, for example. We shouldn't be overly influenced by the fact that WP (and we, by example) have a separate phpunit.dist file for multisite.
#5
@
7 years ago
- Keywords trac-tidy-2018 added
We're closing this ticket because it has not received any contribution or comments for at least two years. We have decided that it is better to close tickets that are good ideas, which have not gotten (or are unlikely to get) contributions, rather than keep things open indefinitely. This will help us share a more realistic roadmap for BuddyPress with you.
Everyone very much appreciates the time and effort that you spent sharing your idea with us. On behalf of the entire BuddyPress team, thank you.
If you feel strongly that this enhancement should still be added to BuddyPress, and you are able to contribute effort towards it, we encourage you to re-open the ticket, or start a discussion about it in our Slack channel. Please consider that time has proven that good ideas without contributions do not get built.
For more information, see https://bpdevel.wordpress.com/2018/01/21/our-awaiting-contributions-milestone-contains/
or find us on Slack, in the #buddypress channel: https://make.wordpress.org/chat/
#6
@
7 years ago
- Milestone Awaiting Contributions deleted
- Resolution set to maybelater
- Status changed from new to closed
+1. When possible, it makes the most sense to put multisite-specific (or non-multisite-specific) tests into their own files/classes, with a
markTestSkipped()
declaration insetUp()
. But where this is not possible, we should mark skipped within the tests.