Comments

legovaer created an issue. See original summary.

legovaer’s picture

legovaer’s picture

Assigned: Unassigned » legovaer
legovaer’s picture

Status: Active » Needs review
StatusFileSize
new3.84 KB

This patch introduces a PHPUnit test for the BuildData class. It also contains 2 fixes of code which was apparently broken (and caused me a headache while developing these unit tests).

jonathan1055’s picture

I suggest you might as well commit this immediately. Then you can enable automated testing on d.o. and we can all see how the first test performs! Having a failing test but with automated testing running is better than no tests, and things can only get better from that point.

jonathan1055’s picture

In testSetModuleType($actual, $expected)

   if ($expected !== FALSE) {
     $this->buildData->setModuleType($actual);
     $this->assertEquals($expected, $actual);
   }

The assertEquals will always pass, as you are sending the same values in to the function. I think you probably meant

     $this->assertEquals($expected, $this->buildData->getModuleType();

  • legovaer committed 276bb06 on 8.x-1.x
    Issue #2811489 by legovaer, jonathan1055: Develop phpunit tests for...
legovaer’s picture

StatusFileSize
new3.87 KB

Thanks for reviewing. I've committed this patch to 8.x-1.x so that we can enable the automated testing.

All tests are passing.. seems like we have our first unit tests in place ;)

jonathan1055’s picture

Version: » 8.x-1.x-dev

That's a great start. Well done!

I notice that the default core version for testing is 8.3. It might be useful to run a one-off custom test on D8.1 and D8.2 as I have found there to be differing results sometimes. It would be useful to have this information.

legovaer’s picture

All of the tests have passed except one. But this seems to be a bug in Drupal CI so I created an issue for that. RTBC?

jonathan1055’s picture

Status: Needs review » Reviewed & tested by the community

That's useful to see those extra test configurations passing. I have commented on #2813495: Test fail because supervisorctl: command not found as I've seen exactly that problem with Scheduler.

RTBC for sure, but you have already committed the code, so I will let you have the pleasure of setting it to 'fixed' ;-)

The last submitted patch, 4: dcc-test-builddata-2811489-4.patch, failed testing.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 8: dcc-test-builddata-2811489-7.patch, failed testing.

jonathan1055’s picture

That's interesting. It must be due to continual assessment testing - I set the status to RTBC but I did not manually ask for re-testing of the patches, that must have been automatic. Now the status has been reverted to 'needs work' because the patches no longer apply, as the work has already been committed. I won't set it to RTBC again, as I expect that may trigger another set of tests.

legovaer’s picture

Right! I was mixing up several issues. Let's just close this one :)

legovaer’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.