Project description

The predicabletests module registers minimal tests which are predicable,
i.e. they always or never pass. You know which result to expect.

At first, this module will be used to illustrate articles about running tests on Drupal with drush then with Jenkins.

Here are some other use cases where this module could help:

  • in demo or tutorial: try tests that passes and others that fails;
  • make sure that a continuous integration service acts as expected, i.e. test the deployment of such a service. When you deploy a continuous integration service, at first you want to be sure that it can run tests, and then that it handles "pass" and "fail" statuses. There comes predicabletests;
  • use "quick" tests. Standards tests bundled with Drupal or simpletest are quite slow to run. So predicabletests will save us time where you just want to know whether you can successfully run tests or not;
  • make sure there is no error in your installation. As examples, errors raised during tests could be related to Drupal or any module. Predicabletests' tests are really minimal, so the risk to get collateral errors is minimal.
Project page
http://drupal.org/sandbox/benoit.bryon/1363566
Git repository
git clone --branch master benoit.bryon@git.drupal.org:sandbox/benoit.bryon/1363566.git predicabletests
Drupal core version
7.x

Comments

patrickd’s picture

Status: Needs review » Needs work

Sounds quite interesting!

Automated report:

It appears you are working in the "master" branch in git. You should really be working in a version specific branch. The most direct documentation on this is Moving from a master branch to a version branch. For additional resources please see the documentation about release naming conventions and creating a branch in git.
Review of the master branch:

  • Drupal Code Sniffer has found some code style issues (please check the Drupal coding standards):
    <p>FILE: ...w/sites/all/modules/pareview_temp/test_candidate/predicabletests.module
    --------------------------------------------------------------------------------
    FOUND 2 ERROR(S) AFFECTING 2 LINE(S)
    --------------------------------------------------------------------------------
     7 | ERROR | Files must end in a single new line character
     8 | ERROR | There must be no blank line following an inline comment
    --------------------------------------------------------------------------------</p>
    <p>FILE: ...iew/sites/all/modules/pareview_temp/test_candidate/predicabletests.test
    --------------------------------------------------------------------------------
    FOUND 15 ERROR(S) AFFECTING 15 LINE(S)
    --------------------------------------------------------------------------------
      9 | ERROR | Missing function doc comment
     12 | ERROR | String concat is not required here; use a single string instead
     13 | ERROR | String concat is not required here; use a single string instead
     14 | ERROR | String concat is not required here; use a single string instead
     20 | ERROR | Missing function doc comment
     27 | ERROR | Missing function doc comment
     30 | ERROR | String concat is not required here; use a single string instead
     31 | ERROR | String concat is not required here; use a single string instead
     32 | ERROR | String concat is not required here; use a single string instead
     38 | ERROR | Missing function doc comment
     45 | ERROR | Missing function doc comment
     48 | ERROR | String concat is not required here; use a single string instead
     49 | ERROR | String concat is not required here; use a single string instead
     50 | ERROR | String concat is not required here; use a single string instead
     56 | ERROR | Missing function doc comment
    --------------------------------------------------------------------------------</p>
  • Remove "version" from the info file, it will be added by drupal.org packaging automatically.
  • Remove "project" from the info file, it will be added by drupal.org packaging automatically.
  • predicabletests.module in predicabletests.info: It's only necessary to declare files[] if they declare a class or interface.

This automated report was generated with PAReview.sh, your friendly project application review script. Go and review some other project applications, so we can get back to yours sooner.Source: http://ventral.org/pareview - PAReview.sh online service
http://ventral.org/pareview/httpgitdrupalorgsandboxbenoitbryon1363566git

patrickd’s picture

Status: Needs work » Needs review

Switched back to needs review, so in-depth reviews won't be blocked by coding standart issues.

benoit.bryon’s picture

Improved coding standards implementation.

http://ventral.org/pareview/httpgitdrupalorgsandboxbenoitbryon1363566git no longer reports errors.

benoit.bryon’s picture

Also:

  • Removed "version" from the info file
  • Removed "project" from the info file
  • Removed "predicabletests.module" from predicabletests.info
sven.lauer’s picture

Status: Needs review » Needs work

Even though the module is really simple, I agree that there are use cases for it. I wonder though: Why isn't there a failing WebTestCase?

Also, about the name: Running words together is generally frowned upon, though I can't find a place where the naming convention is spelled out. Anyways, how about using "predictable_tests" as the short name instead? And the value of "name" in the info file should be the human-readable name of the module, so something like "Predictable tests" would be nicer.

In general, I think the module is too short to gain "Full project" access for you---I am not an authority on this, but there is not much to review, really. Of course, the module still can be promoted to a full project once it is vetted.

benoit.bryon’s picture

Title: predicabletests » predictable_tests

sven.lauer said:

how about using "predictable_tests" as the short name instead? And the value of "name" in the info file should be the human-readable name of the module, so something like "Predictable tests" would be nicer.

  • You are right, "predictable" sounds better than "predicable" here.
  • Renamed the module to "predictable_tests".
  • Used human-readable name in .info file.
benoit.bryon’s picture

sven.lauer said

Why isn't there a failing WebTestCase?

I couldn't find an usage for a failing WebTestCase. The provided tests classes are enough for my current usage. If you have ideas, let's discuss them as feature requests: I opened http://drupal.org/node/1391090 about this one.

benoit.bryon’s picture

sven.lauer said:

In general, I think the module is too short to gain "Full project" access for you---I am not an authority on this, but there is not much to review, really. Of course, the module still can be promoted to a full project once it is vetted.

Understood. I don't mind if I personally don't get full project access right now. What is important to me is that the project can be installed as any "full project" module. As an example, with drush dl predictable_tests.

Don't know if it helps trusting me, but I'm using Drupal as a Makina Corpus' team member. You can review some of our articles at Makina Corpus' blog.

benoit.bryon’s picture

Status: Needs work » Needs review

Worked on the module. See previous comments.

themebrain’s picture

Status: Needs review » Needs work

Review of the 7.x-1.x branch:

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. Get a review bonus and we will come back to your application sooner.


FILE: ...w/sites/all/modules/pareview_temp/test_candidate/predictable_tests.test
--------------------------------------------------------------------------------
FOUND 9 ERROR(S) AFFECTING 9 LINE(S)
--------------------------------------------------------------------------------
 19 | ERROR | Array indentation error, expected 6 spaces but found 0
 20 | ERROR | Array indentation error, expected 6 spaces but found 0
 21 | ERROR | Array indentation error, expected 6 spaces but found 0
 46 | ERROR | Array indentation error, expected 6 spaces but found 0
 47 | ERROR | Array indentation error, expected 6 spaces but found 0
 48 | ERROR | Array indentation error, expected 6 spaces but found 0
 73 | ERROR | Array indentation error, expected 6 spaces but found 0
 74 | ERROR | Array indentation error, expected 6 spaces but found 0
 75 | ERROR | Array indentation error, expected 6 spaces but found 0
--------------------------------------------------------------------------------

Source: http://ventral.org/pareview - PAReview.sh online service

Manual review:
- add translate function for the description for example:

      'description' => 'Asserts that TRUE is true. Use this test when you need
                        a quick test that passes. Useful to validate your test
                        workflow. NOTE: as a DrupalUnitTestCase, does not
                        requires access to the database nor files.',
klausi’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. Feel free to reopen if you are still working on this application.