Mailing List Archive

trac-admin tests
I eventually would like to see the functionality of trac-admin moved to
Environment.py leaving trac-admin as just a text interface. This would
allow a GUI or web interface to access this functionality without
duplicating code.

To ensure that I don't break anything as important as trac-admin, I'm in
the process of creating a series of patches that add unit tests for
trac-admin.

I've attached the first two patches that test the about and help
commands. I also have patches for component, milestone, version,
priority, severity, and permission. I'll post these later today and
tomorrow.

I only have access to Fedora Core 2 Linux and Python 2.3.3. Hopefully,
I these patches don't rely on anything more that the requirements listed
in INSTALL. I encourage people on other operating systems and other
versions of Python to test these patches.

Please let me know what you think. =)

--
Tim Moloney <t.moloney@verizon.net>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1-tracadmin-tests-about.patch
Type: text/x-patch
Size: 3047 bytes
Desc: not available
Url : /archive/trac/attachments/20040820/eea549be/1-tracadmin-tests-about.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2-tracadmin-tests-help.patch
Type: text/x-patch
Size: 7602 bytes
Desc: not available
Url : /archive/trac/attachments/20040820/eea549be/2-tracadmin-tests-help.bin
trac-admin tests [ In reply to ]
Tim Moloney wrote:

> I eventually would like to see the functionality of trac-admin moved to
> Environment.py leaving trac-admin as just a text interface. This would
> allow a GUI or web interface to access this functionality without
> duplicating code.
>
> To ensure that I don't break anything as important as trac-admin, I'm in
> the process of creating a series of patches that add unit tests for
> trac-admin.
>
> I've attached the first two patches that test the about and help
> commands. I also have patches for component, milestone, version,
> priority, severity, and permission. I'll post these later today and
> tomorrow.
>
> I only have access to Fedora Core 2 Linux and Python 2.3.3. Hopefully,
> I these patches don't rely on anything more that the requirements listed
> in INSTALL. I encourage people on other operating systems and other
> versions of Python to test these patches.
>
> Please let me know what you think. =)
>
Hi Tim,

The patches look very nice and I've committed them to trunk.

Thanks again!

/ Jonas
--
Jonas Borgstr?m | Edgewall Software
jonas@edgewall.com | Professional GNU/Linux & Open Source Consulting.
| http://www.edgewall.com/
trac-admin tests [ In reply to ]
On Fri, 2004-08-20 at 10:17, Tim Moloney wrote:

> I eventually would like to see the functionality of trac-admin moved to
> Environment.py leaving trac-admin as just a text interface. This would
> allow a GUI or web interface to access this functionality without
> duplicating code.
>
> To ensure that I don't break anything as important as trac-admin, I'm in
> the process of creating a series of patches that add unit tests for
> trac-admin.

Here's the next patch that adds tests for the component command.

Please note that this patch also adds some error checking to
trac-admin. It verifies that the named component actually exists in the
'component rename', 'component remove', and 'component chown' commands.

--
Tim Moloney <t.moloney@verizon.net>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 3-tracadmin-tests-component.patch
Type: text/x-patch
Size: 12423 bytes
Desc: not available
Url : /archive/trac/attachments/20040821/859cda2b/3-tracadmin-tests-component.bin
trac-admin tests [ In reply to ]
Here's the patch for the milestone tests.

This patch does not include exhaustive testing of the various time
formats that are accepted by trac-admin. Perhaps later...

This patch adds some error checking in trac-admin, specifically ensuring
that the milestone exists in the 'milestone time' command.

This patch also includes a few corrections to the doc strings in my last
patch (component tests).

--
Tim Moloney <t.moloney@verizon.net>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 4-tracadmin-tests-milestone.patch
Type: text/x-patch
Size: 13763 bytes
Desc: not available
Url : /archive/trac/attachments/20040821/23195f21/4-tracadmin-tests-milestone.bin
trac-admin tests [ In reply to ]
Here's the patch for the version tests. Like the milestone test patch,
this patch does not include exhaustive testing of the various time
formats that trac-admin accepts.

--
Tim Moloney <t.moloney@verizon.net>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 5-tracadmin-tests-version.patch
Type: text/x-patch
Size: 10406 bytes
Desc: not available
Url : /archive/trac/attachments/20040821/c17ca9ab/5-tracadmin-tests-version.bin
trac-admin tests [ In reply to ]
Here's the patch for the priority tests.

--
Tim Moloney <t.moloney@verizon.net>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 6-tracadmin-tests-priority.patch
Type: text/x-patch
Size: 8685 bytes
Desc: not available
Url : /archive/trac/attachments/20040822/1448a6c6/6-tracadmin-tests-priority.bin
trac-admin tests [ In reply to ]
Here's the patch for the severity tests.

Note that trac-admin was changed to generate a more generic error
message. Severity errors had the word 'Priority' in the error message.
This also required changing the expected results for the priority tests.

--
Tim Moloney <t.moloney@verizon.net>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 7-tracadmin-tests-severity.patch
Type: text/x-patch
Size: 10089 bytes
Desc: not available
Url : /archive/trac/attachments/20040822/e2742d7b/7-tracadmin-tests-severity.bin
trac-admin tests [ In reply to ]
I just noticed a bug in my patches that, unfortunately, was copied into
all of the tests. Sorry about that.

--
Tim Moloney <t.moloney@verizon.net>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 8-tracadmin-tests-exception-goof.patch
Type: text/x-patch
Size: 32667 bytes
Desc: not available
Url : /archive/trac/attachments/20040822/8dea6d75/8-tracadmin-tests-exception-goof.bin
trac-admin tests [ In reply to ]
It's been about a week since I posted the patches to add trac-admin unit
tests for the component, milestone, version, priority, and severity
commands. Are there any problems with them that are keeping them from
being committed? I'd be happy to rework them to resolve any issues
there might be. I have more patches that I'd like to submit but I don't
want to start working too far from the baseline. Thanks.

--
Tim Moloney <t.moloney@verizon.net>
trac-admin tests [ In reply to ]
Tim Moloney wrote:

> It's been about a week since I posted the patches to add trac-admin unit
> tests for the component, milestone, version, priority, and severity
> commands. Are there any problems with them that are keeping them from
> being committed? I'd be happy to rework them to resolve any issues
> there might be. I have more patches that I'd like to submit but I don't
> want to start working too far from the baseline. Thanks.
>
It's my fault, I forgot to commit them, sorry.

I've committed them now, but some (13) of them currently fail for
unknown reasons on my computer.

FAIL: test_component_chown_error_bad_component
FAIL: test_component_remove_error_bad_component
FAIL: test_component_rename_error_bad_component
FAIL: test_milestone_time_error_bad_milestone
FAIL: test_priority_add_error_already_exists
FAIL: test_priority_change_error_bad_new_name
FAIL: test_priority_change_error_bad_priority
FAIL: test_priority_remove_error_bad_priority
FAIL: test_severity_add_error_already_exists
FAIL: test_severity_change_error_bad_new_name
FAIL: test_severity_change_error_bad_severity
FAIL: test_severity_remove_error_bad_severity
FAIL: test_version_time_error_bad_version

/ Jonas
--
Jonas Borgstr?m | Edgewall Software
jonas@edgewall.com | Professional GNU/Linux & Open Source Consulting.
| http://www.edgewall.com/
trac-admin tests [ In reply to ]
On Sun, 2004-08-29 at 10:17, Jonas Borgstr?m wrote:

> It's my fault, I forgot to commit them, sorry.
>
> I've committed them now, but some (13) of them currently fail for
> unknown reasons on my computer.
>
> FAIL: test_component_chown_error_bad_component
> FAIL: test_component_remove_error_bad_component
> FAIL: test_component_rename_error_bad_component
> FAIL: test_milestone_time_error_bad_milestone
> FAIL: test_priority_add_error_already_exists
> FAIL: test_priority_change_error_bad_new_name
> FAIL: test_priority_change_error_bad_priority
> FAIL: test_priority_remove_error_bad_priority
> FAIL: test_severity_add_error_already_exists
> FAIL: test_severity_change_error_bad_new_name
> FAIL: test_severity_change_error_bad_severity
> FAIL: test_severity_remove_error_bad_severity
> FAIL: test_version_time_error_bad_version

It looks like the error checking that I added to trac-admin didn't make
it into the commit. No worries. The attached patch will fix that. =)

All this patch does to ensure that the specified item (component,
milestone, priority, severity, or version) actually exists before
attempting to modify it (chown, rename, change, remove, or time).

BTW, Thanks for committing the previous patches. =)

--
Tim Moloney <t.moloney@verizon.net>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tracadmin-error-checking.patch
Type: text/x-patch
Size: 2379 bytes
Desc: not available
Url : /archive/trac/attachments/20040829/79cf85dc/tracadmin-error-checking.bin
trac-admin tests [ In reply to ]
Am 29.08.2004 um 19:14 schrieb Tim Moloney:
> On Sun, 2004-08-29 at 10:17, Jonas Borgstr?m wrote:
>> It's my fault, I forgot to commit them, sorry.
>>
>> I've committed them now, but some (13) of them currently fail for
>> unknown reasons on my computer.
>>
>> FAIL: test_component_chown_error_bad_component
>> FAIL: test_component_remove_error_bad_component
>> FAIL: test_component_rename_error_bad_component
>> FAIL: test_milestone_time_error_bad_milestone
>> FAIL: test_priority_add_error_already_exists
>> FAIL: test_priority_change_error_bad_new_name
>> FAIL: test_priority_change_error_bad_priority
>> FAIL: test_priority_remove_error_bad_priority
>> FAIL: test_severity_add_error_already_exists
>> FAIL: test_severity_change_error_bad_new_name
>> FAIL: test_severity_change_error_bad_severity
>> FAIL: test_severity_remove_error_bad_severity
>> FAIL: test_version_time_error_bad_version
>
> It looks like the error checking that I added to trac-admin didn't make
> it into the commit. No worries. The attached patch will fix that. =)
>
> All this patch does to ensure that the specified item (component,
> milestone, priority, severity, or version) actually exists before
> attempting to modify it (chown, rename, change, remove, or time).

Checked in, all tests pass here now. Thanks!

Cheers, Chris
--
Christopher Lenz
/=/ cmlenz at gmx.de