Skip to:
Content

BuddyPress.org

Opened 10 years ago

Closed 10 years ago

#5876 closed defect (bug) (fixed)

Unit tests against unclosed tickets not being skipped correctly

Reported by: boonebgorges's profile boonebgorges Owned by: boonebgorges's profile boonebgorges
Milestone: 2.1 Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords:
Cc:

Description

Marking a unit test with @ticket BP1234 should cause the test to be skipped if ticket 1234 is not closed (unless forcing all tests or running that specific test group). This is not currently working, with result that the suite is failing on Travis CI and elsewhere.

The cause appears to be this:

  • We're passing http://buddypress.trac.wordpress.org (non-SSL) to TracTickets::isTracTicketClosed in BP_UnitTestCase::knownBPbug()
  • When the TracTickets class goes to fetch this content, the wordpress.org servers are redirecting away from the non-SSL version to the SSL version
  • During the redirect, the URL-encoded exclamation point in %21closed is being re-encoded as %2521closed (%25 is a URL-encoded %). This breaks the status=!closed param. Trac doesn't know what to do with the invalid status, so it returns an empty set of ticket IDs
  • As such, TracTickets thinks that no tickets are unclosed on BP (would that this were the case), which means that that open-ticket tests are not being skipped

Change History (1)

#1 @boonebgorges
10 years ago

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

In 9022:

Use https rather than http when querying for open Trac tickets when running unit tests

Querying the HTTP version was causing a redirect, which in turn was mangling
the query params and forcing Trac to return an empty CSV. As a result, all
tickets were being registered as closed, causing all tests to run.

This fix ensures that tests marked @ticket with the number of a closed ticket
will not be run (unless the force-known-bugs flag is flipped)

Fixes #5876

Note: See TracTickets for help on using tickets.