It would be good to get an initial test suite as to how most people set up and configure the module, and then enable testing for the project & require additional tests for any bug fix issues.

Comments

eileen’s picture

Subscribe. It's totally unclear how to configure many of the features of Workbench.

becw’s picture

@eileen: there's now Workbench Moderation documentation here on drupal.org.

@Dave Reid: since you created this issue, I've added some tests to the module. As you've mentioned elsewhere, it might make sense to consolidate the tests into a single test class (or something).

becw’s picture

Title: Write initial test suite » review and update test suite

Tests are failing when they run on d.o, but not on my development environment. I'm updating this issue because we might as well keep all the talk of testing in one place for now.

becw’s picture

Dave suggested that the tests are probably failing because some of them rely on the Workbench module, and the testbot doesn't pull in external dependencies. There's not much we can do about that.

dave reid’s picture

Yep - there isn't but it is being worked on actively by the qa.drupal.org team. What we can do is add 'dependencies' => array('workbench') to the moderation tests' getInfo() functions. This will prevent the tests from running on qa.drupal.org, and report back '0 fails' but also '0 passes' but still a green. It will allow us to test if patches apply to the current code base or not.

becw’s picture

Status: Active » Needs review
StatusFileSize
new1.3 KB

Actually, we can make workbench a dependency of just one of the tests--not all require workbench.

dave reid’s picture

Status: Needs review » Needs work
+++ b/tests/workbench_moderation.testundefined
@@ -9,8 +9,9 @@ class WorkbenchModerationTestCase extends DrupalWebTestCase {
+  function setUp($modules = array()) {

Changing the parameters for one setUp function without changing anything that depends on it as well will cause a PHP strict notice.

becw’s picture

Status: Needs work » Needs review
StatusFileSize
new2.08 KB

Well, how about this.

dave reid’s picture

Looks good initially - will test.

dave reid’s picture

Status: Needs review » Needs work
+++ b/tests/workbench_moderation.testundefined
@@ -111,15 +112,14 @@ class WorkbenchModerationDraftTabTestCase extends WorkbenchModerationTestCase {
-  function setUp() {
-    parent::setUp();
-
-    // Workbench is now required for the mini moderation form.
-    module_enable(array('workbench'));
-
+  function setUp($modules = array()) {
+    parent::setUp(array('workbench'));
     $this->drupalLogin($this->moderator_user);

This should do an $modules[] = 'workbench';

+++ b/tests/workbench_moderation.testundefined
@@ -111,15 +112,14 @@ class WorkbenchModerationDraftTabTestCase extends WorkbenchModerationTestCase {
@@ -182,7 +182,7 @@ class WorkbenchModerationPublishFromNodeFormTestCase extends WorkbenchModeration

@@ -182,7 +182,7 @@ class WorkbenchModerationPublishFromNodeFormTestCase extends WorkbenchModeration
     );
   }
 
-  function setUp() {
+  function setUp($modules = array()) {
     parent::setUp();
     $this->drupalLogin($this->admin_user);
   }
@@ -222,7 +222,7 @@ class WorkbenchModerationUnpublishTestCase extends WorkbenchModerationTestCase {

@@ -222,7 +222,7 @@ class WorkbenchModerationUnpublishTestCase extends WorkbenchModerationTestCase {
     );
   }
 
-  function setUp() {
+  function setUp($modules = array()) {
     parent::setUp();
     $this->drupalLogin($this->admin_user);

These setUp functions should probably pass $modules into parent::setUp().

dave reid’s picture

Assigned: dave reid » becw
becw’s picture

Assigned: becw » dave reid
Status: Needs work » Needs review
StatusFileSize
new2.22 KB

Ok, here's a revised patch.

dave reid’s picture

Status: Needs review » Reviewed & tested by the community

If this passes tests locally this looks good to me.

becw’s picture

Status: Reviewed & tested by the community » Active

I committed the patch from #12 in 1d0e2d.

This issue should remain open; the tests in general could still stand some review.

  • becw committed 1d0e2d4 on 7.x-3.x
    Issue #1166390: revise tests. Maybe the ones that are not dependent on...
damienmckenna’s picture

Assigned: dave reid » Unassigned
Issue summary: View changes
Status: Active » Needs review
Related issues: +#2865390: Rerun Workbench Moderation tests with each patch
StatusFileSize
new5.99 KB

This tidies up the setUp() methods, hopefully it might help with the mysterious errors I'm getting in #2865390: Rerun Workbench Moderation tests with each patch.

damienmckenna’s picture

Version: 7.x-1.x-dev » 7.x-3.x-dev

The 7.x-3.x branch is the current one.

Status: Needs review » Needs work

The last submitted patch, 16: workbench_moderation-n1166390-16.patch, failed testing. View results

damienmckenna’s picture

Status: Needs work » Needs review
damienmckenna’s picture

Status: Needs review » Fixed

You know, given that this is so old, lets just close it as-is and we'll pick up the cleanup work in another issue.

Status: Fixed » Closed (fixed)

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