[buddypress-trac] [BuddyPress Trac] #6540: Multisite unit tests and bp_blogs_record_existing_blogs()

buddypress-trac noreply at wordpress.org
Mon Jun 29 08:44:51 UTC 2015


#6540: Multisite unit tests and bp_blogs_record_existing_blogs()
-----------------------------------+------------------
 Reporter:  imath                  |       Owner:
     Type:  defect (bug)           |      Status:  new
 Priority:  normal                 |   Milestone:  2.4
Component:  Tools - Unit Tests     |     Version:
 Severity:  normal                 |  Resolution:
 Keywords:  has-patch 2nd-opinion  |
-----------------------------------+------------------
Description changed by imath:

Old description:

> Each time this function is used in unit tests, for a weird reason users
> and blogs are not reset between each tests causing a large amount of
> tests to fail:
> - because the domain of a blog created using
> `$this->factory->blog->create()` already exists
> - because users created using `$this->factory->user->create()` are not
> reset.
>
> I've noticed, they were already a hack into the `BP_UnitTestCase->setUP`
> method that was removing user 1. This was ok since each time
> `bp_blogs_record_existing_blogs()` was used only one user was created in
> the test. But as soon as you create more than one, you have the problem.
>
> As i'm working on a new "split" of #6026 i need to test this function.
> I'm suggesting another work around as after 2 days on it, i still don't
> get what's happening.
>
> To reproduce, simply test the
> `bp_blogs_record_existing_blogs_unittest.patch` using :
> `phpunit --group bp_blogs_record_existing_blogs -c
> tests/phpunit/multisite.xml`
> => test is ok
>
> Now run the complete suite :
>
> `phpunit -c tests/phpunit/multisite.xml`
> =>Dang! a large amount of errors and failures.
>
> If you apply `setUp.patch` > no more errors or failures !

New description:

 Each time this function is used in unit tests, for a weird reason users
 and blogs are not reset between each tests causing a large amount of tests
 to fail:
 - because the domain of a blog created using
 `$this->factory->blog->create()` already exists
 - because users created using `$this->factory->user->create()` are not
 reset.

 I've noticed, they were already a hack into the `BP_UnitTestCase->setUP`
 method that was removing user 1. This was ok since each time
 `bp_blogs_record_existing_blogs()` was used only one user was created in
 the test. But as soon as you create more than one, you have the problem.

 As i'm working on a new "split" of #6026 i need to test this function. I'm
 suggesting another work around as after 2 days on it, i still don't get
 what's happening.

 To reproduce, simply test the
 `bp_blogs_record_existing_blogs_unittest.patch` using :
 `phpunit --group bp_blogs_record_existing_blogs -c
 tests/phpunit/multisite.xml`
 => test is ok

 Now run the complete suite :

 `phpunit -c tests/phpunit/multisite.xml`
 =>Dang! a large amount of errors and failures.

 If you apply `6540.patch` > no more errors or failures !

--

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6540#comment:1>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list