To make sure my patch from #234004: Drag and drop node ordering doesn't break anything, it seems like a good idea to add test cases to the module.

(I'm aware of the old D5 cases in http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/nodequeue/t...)

First set of tests attached.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ezra-g’s picture

Status: Active » Needs review

Thanks!
Marking as needs review.

wulff’s picture

FileSize
16.82 KB

Adding tests for users with the 'administer nodequeue' permissions.

Next on the list: Tests for the API functions.

wulff’s picture

FileSize
28.9 KB

Added some more test cases.

wulff’s picture

FileSize
234.15 KB
36.43 KB

Added some more test cases. Current coverage is 70%.

ezra-g’s picture

Please accept my delayed and large thanks.

When I ran these tests, almost all pass with only a few exceptions, and then I encounter a 500 error. I need to fix my testing environment so I can finish making sure that the tests pass and then this will be committed.

wulff’s picture

FileSize
212.75 KB
49.02 KB

Finally hit 90% coverage. This set of test cases will result in a few fails until we fix a few minor issues.

ezra-g’s picture

Assigned: wulff » Unassigned
Status: Needs review » Needs work

The 500 errors were happening in part because of undefined functions called in the tests ($document->setMultiValue($key, $sqid) in nodequeue_apachesolr_update_index ) and nodequeue_ajax_add being removed from Nodequeue.module when we implemented #234004: Drag and drop node ordering. Of course, that move broke many of the tests here ;). With the nodequeue_ajax_add tests removed (and $document->setMultiValue temporarily commented out) , I'm showing 623 passes, 32 fails, and 43 exceptions.

The test results are attached as a png, which seems kind of wrong, but allows us to see the results without running the tests again.

@wulff: I'll unassign but of course feel free to join in here again ;).

Steven Merrill’s picture

FileSize
49.22 KB

Here's one with all tests passing as of today, other than ApacheSolr, which I moved into a new group so that I could not run it with the rest. Mostly, there needed to be some small changes made to stay in step with error messages. In addition, I removed the up/down testing, since the table view is now draggable.

Steven Merrill’s picture

Status: Needs work » Needs review

Review, please!

Steven Merrill’s picture

FileSize
181 bytes
187 bytes
49.07 KB

Whoops. _nodequeue_ajax_add() is no more.

Here's a new patch. It also has some tests and a mock module in place for a reroll of #606150: Hook for queue deletion .

Steven Merrill’s picture

Status: Needs review » Needs work

Some of these still fail when the site is in a subfolder. Further patch coming.

Steven Merrill’s picture

Status: Needs work » Needs review
FileSize
48.42 KB

Okay - here we go. Support for running in a subdirectory or at the site root, and a couple last fixes around how the test nodequeues were being populated.

ezra-g’s picture

Status: Needs review » Patch (to be ported)

Hooray! All tests pass on the latest 6.x-2.x branch. Committed, and marking as needs porting for 7.x-2.x :).

http://drupal.org/cvs?commit=463068

Huzzaaaah!

kenorb’s picture

penyaskito’s picture

I'm getting fatal errors when running tests with 5.3 because of use of passing references. E.g.: &$form_state is not longer needed.

kenorb’s picture

Title: Add test cases » Nodequeue: Add test cases
fizk’s picture

Issue summary: View changes
Status: Patch (to be ported) » Needs work
FileSize
49.87 KB

I've updated the tests to work for 7.x-2.x, but some are still failing.

fizk’s picture

Status: Needs work » Fixed

We have working tests for 7.x-2.x. Congrats!

fizk’s picture

For some reason two tests fail on Drupal.org test bots: #2557343: Two tests fail for nodequeue module.

Does anyone know why it breaks only for the test bots?

Status: Fixed » Closed (fixed)

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