Download & Extend

TestingParty08: book node types

Project:Drupal core
Version:7.x-dev
Component:book.module
Category:task
Priority:normal
Assigned:Unassigned
Status:needs work

Issue Summary

Tests needed for:
Updating book node types.
Setting another node type to be a book page type.

Comments

#1

Status:active» needs review

Heres a stab at this...

patch does the following:
* checks editing of book nodes. These edits modify the book structure
* adds an additional content type as a book page type, checks to ensure it can add this content type to the book outline
* checks the addition of a content type as the default book child page type

AttachmentSizeStatusTest resultOperations
book_test.patch5.42 KBIdleFailed: 7315 passes, 21 fails, 10 exceptionsView details | Re-test

#2

Status:needs review» needs work

@beeradb: I also have a patch that could be quite similar in #299136: TestingParty08: Deleting and editing book pages. Could you try to merge the two?

#3

Updated. Merged the parts of Damien's patch which weren't covered by my first one (deletion and the associated checks), and made the new book page type and default book page type tests use a dynamically generated content type. Interestingly enough I think I may have uncovered a bug in either core or the testing framework through doing this. After calling drupalWebTestCase::drupalCreateContentType() I have to do a menu_rebuild() to go to 'node/type/$type'. This rebuild is typically handled by node_type_form_submit which is never called in this context.

There are three options here...

  • The menu_rebuild should be moved to node_types_rebuild.
  • A menu_rebuild should be added to drupalCreateContentType()
  • The menu_rebuild should be the tests responsibility to invoke, in this context

depending on feedback here I'll either roll a patch for this or not. I think it probably shouldn't be the tests responsibility personally :).

Otherwise, I'd appreciate feedback on the rest of this patch as well.

AttachmentSizeStatusTest resultOperations
book.test.patch8.21 KBIdleFailed: 7394 passes, 10 fails, 3 exceptionsView details | Re-test

#4

Status:needs work» needs review

#5

After a chat with chx on irc I've gone with option #1, "The menu_rebuild should be moved to node_types_rebuild.".

This patch is now dependent on #306316: Regression: node_types_rebuild should rebuild menu

AttachmentSizeStatusTest resultOperations
book_test.patch8.13 KBIdleFailed: Failed to apply patch.View details | Re-test

#6

Status:needs review» needs work

The last submitted patch failed testing.

#7

Status:needs work» needs review

Fairly certain this failed testing due to the listed dependencies. It would still be nice to have this reviewed.

#8

Status:needs review» needs work

The last submitted patch failed testing.

#9

Component:tests» book.module
Status:needs work» needs review

with #306316: Regression: node_types_rebuild should rebuild menu now committed, marking this back to CNR

#10

Status:needs review» needs work

The last submitted patch failed testing.

#11

Status:needs work» needs review

I rerolled this patch against the latest Drupal HEAD. I have not tested it locally, though.

AttachmentSizeStatusTest resultOperations
book_update.patch4.68 KBIdlePassed: 11001 passes, 0 fails, 0 exceptionsView details | Re-test

#12

This is failing fairly spectacularly in local testing (all book tests results in 292 passes, 9 fails, and 17 exceptions). I hit the bot for a retest. Will try and check back to see how that goes and re-roll unless someone beats me to it.

#13

Status:needs review» needs work

Ok, just figured out that there is an error which is keeping the testing bot from running the book.test at all:

Fatal error: Cannot use object of type stdClass as array in /Library/WebServer/Documents/botsite/modules/book/book.test on line 121

Will fix and re-roll patch and post in a bit unless someone else beats me to it.

UPDATE: Still working on this - the last patch post was quite a mess and not well commented. Taking forever actually. If someone gets impatient I'm glad to post my progress to date, otherwise will try to post a proper patch when I can.

#14

Category:bug report» task
Priority:critical» normal

Moving this out of the critical bugs queue - see #607038: Meta issue: fix gaps in code coverage.

nobody click here