gcode-mirror / google-highly-open-participation-drupal

Automatically exported from code.google.com/p/google-highly-open-participation-drupal
0 stars 0 forks source link

Write Simpletest tests for the Path module #129

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Drupal supports search engine (and human) friendly URLs like 'about' in 
the form of URL aliases. This task is to write unit tests to ensure this 
functionality works.

The Simpletest module provides a framework for running automated unit 
tests in Drupal. Unit testing involves taking a small portion of code, a 
unit, and subjecting it to programmatic tests to prove its correctness. 
This can be extremely useful to help insure that new code does not 
introduce bugs into existing functionality. Thus, having a full suite of 
unit tests for Drupal 6.x core functionality using the Simpletest module 
would be a major step forward for the project and would help insure that 
only high-quality code is committed. In addition to helping developers 
test their code, new tests for core Drupal functionality will be used for 
automated testing by http://testing.drupal.org.

For this task, you need to first install and familiarize yourself with the 
simpletest module (use the cvs HEAD version with Drupal HEAD/6.x RC):
http://drupal.org/project/simpletest
http://drupal.org/simpletest
http://www.lullabot.com/articles/introduction-unit-testing

The main work for this task is to write a small suite of tests to check 
the functionality of path module, specifically:
* create an alias for a node.
* change the alias
* move the alias to another node by giving it the same alias
* add, edit, delete aliases from the administration screen

Proper validation of your new tests will ideally include changing the 
Drupal core code to break the tested functionality and then confirming 
that your tests report a failure.  Ideally, post each such change as a 
patch to help the reviewers.

This suite should be written as a single .test file and should achieve 
RTBC status in the Simpletest module issue queue.  Post files/patches to 
this issue: 

Original issue reported on code.google.com by chx1...@gmail.com on 7 Jan 2008 at 8:34

GoogleCodeExporter commented 9 years ago

Original comment by chx1...@gmail.com on 7 Jan 2008 at 8:34

GoogleCodeExporter commented 9 years ago
I forgot to mention: a very very crude start for the tests can be created from 
the 
browser with http://drupal.org/project/simpletest_automator -- generated tests 
need 
serious cleanup and editing.

Original comment by chx1...@gmail.com on 7 Jan 2008 at 8:46

GoogleCodeExporter commented 9 years ago
I claim this task.

Original comment by j.boomba...@gmail.com on 8 Jan 2008 at 1:34

GoogleCodeExporter commented 9 years ago
Also see 
http://www.lullabot.com/articles/drupal-module-developer-guide-simpletest

Original comment by chx1...@gmail.com on 8 Jan 2008 at 2:24

GoogleCodeExporter commented 9 years ago
All yours. :)

Original comment by webchick...@gmail.com on 8 Jan 2008 at 2:33

GoogleCodeExporter commented 9 years ago
Oops. Forgot to change status.

Original comment by webchick...@gmail.com on 8 Jan 2008 at 3:51

GoogleCodeExporter commented 9 years ago
The module test I created tests both the node and administration interfaces for
creating, editing, and deleting path aliases. There are two separate functions:
testAdminAlias, testNodeAlias that perform the tasks described above.

I created separate patches for showing that the tests will catch mistakes in 
the path
module. The patches modify lines in the path module that disable the 
funtionality
tested by the test case.

The atatched patches end with the suffixes insert, update, and delete refering 
to the
functionality that they will disable and allow the test case to catch. The base
attachment, that has no suffix, just adds the test case.

Original comment by j.boomba...@gmail.com on 8 Jan 2008 at 5:50

Attachments:

GoogleCodeExporter commented 9 years ago
I don't see a link to a drupal.org node like the other issues so I just posted 
it all
here. Not sure if you are intending to create one or what.

Original comment by j.boomba...@gmail.com on 8 Jan 2008 at 5:52

GoogleCodeExporter commented 9 years ago
Sorry, the issue is http://drupal.org/node/207196 . I am copying over.

Original comment by chx1...@gmail.com on 8 Jan 2008 at 7:58

GoogleCodeExporter commented 9 years ago
I copied over the file and commented there.

Original comment by chx1...@gmail.com on 8 Jan 2008 at 8:30

GoogleCodeExporter commented 9 years ago
I'm setting this to needs review.

Original comment by acli...@gmail.com on 8 Jan 2008 at 12:07

GoogleCodeExporter commented 9 years ago
I gave a review already.

Original comment by chx1...@gmail.com on 8 Jan 2008 at 12:17

GoogleCodeExporter commented 9 years ago
@chx:  I know you gave a review already, but we've mostly been setting the 
google
tasks to needs review once there's something to review at all, even if the 
student's
work needs to be revised, and we leave it as needs review until either time 
runs out
or the student finishes.

Action needed means that the student is at or very close to the due date.  
According
to the official rules, once set to action needed, the student has 3 days to 
complete
the task or we reopen it for other students.

Certainly not a perfect system though.  This is why we like to primarily keep 
track
of the status on the d.o issue queue.  We just use the statuses here to indicate
whether the student is making progress on the task or not.

Thanks for your quick review on this one!

Original comment by acli...@gmail.com on 8 Jan 2008 at 1:23

GoogleCodeExporter commented 9 years ago
Updated submission. Details on changes are available at 
http://drupal.org/node/207196.

Original comment by j.boomba...@gmail.com on 8 Jan 2008 at 9:09

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by chx1...@gmail.com on 9 Jan 2008 at 5:35

GoogleCodeExporter commented 9 years ago

Original comment by acli...@gmail.com on 21 Jan 2008 at 4:05