Modify

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#1231 closed defect (fixed)

Doesn't work with 0.9.6

Reported by: anonymous Owned by: edunne
Priority: normal Component: TestCaseManagementPlugin
Severity: blocker Keywords:
Cc: Trac Release: 0.9

Description

says it can't import ITicketManipulator and get_column_names

Attachments (0)

Change History (26)

comment:1 Changed 7 years ago by anonymous

  • Owner changed from edunne to anonymous
  • Status changed from new to assigned

These references may not be necessary. I'll remove them and post the solution as a patch.

I'll test them against the trac versions I have but I don't currently have a 0.9.6 version of TRAC installed as it's fairly old.

Would you be able to provide feedback on the patch?

comment:2 Changed 7 years ago by anonymous

  • Owner changed from anonymous to edunne
  • Status changed from assigned to new

comment:3 Changed 7 years ago by anonymous

Yup, sure could.

Thanks!

comment:4 Changed 7 years ago by anonymous

  • Resolution set to fixed
  • Status changed from new to closed

ok this should now be fixed in the latest version of the trunk at revision 2026. I removed the extra refreneces as they are not actually needed.

comment:5 Changed 7 years ago by anonymous

This looks like it works with 0.9.6 (actually, version 2034), with a couple of caveats. There's still a get_column_names in testManager.py, but commenting that out (and removing all of the M's from the .py files) seems to work for me. I can send you more feedback as I use it further, if you'd like?

comment:6 Changed 7 years ago by anonymous

Spoke too soon. Interface appears to come up, but when clicking "Test Runs", the following error is thrown in the log:

2007-02-26 11:10:30,487 Trac[chrome] WARNING: File css/testcase.css not found in any of []
2007-02-26 11:10:30,488 Trac[main] ERROR: File not found
Traceback (most recent call last):

File "/usr/lib/python2.4/site-packages/trac/web/modpython_frontend.py", line 206, in handler

dispatch_request(mpr.path_info, mpr, env)

File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 139, in dispatch_request

dispatcher.dispatch(req)

File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 107, in dispatch

resp = chosen_handler.process_request(req)

File "/usr/lib/python2.4/site-packages/trac/web/chrome.py", line 176, in process_request

raise TracError, 'File not found'

TracError: File not found

Subsequently trying to "GenerateTestRun" does nothing but throw me to the Custom Query page.

comment:7 Changed 7 years ago by anonymous

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:8 Changed 7 years ago by anonymous

The generate test run button should throw you to a custom query page with a pre-built query showing you all tickets of type 'testcase' if you created that ticket type and the custom query should include other parameters that you set on the test runs page.

So if you decided tests should be run against a particular version in a particular milestone then the custom query should reflect that.

Do you see any test cases listed or the test template in the Templates and test cases list boxes? If you do you've got the path configured properly in the config file.

I've duplicated the warning in the log. Trac can't find associated style sheet. I'll fix that and check it in.

comment:9 Changed 7 years ago by anonymous

  • Resolution set to fixed
  • Status changed from reopened to closed

fixed in branch 0.2.1 at revision 2039 and in trunk at revision 2040

comment:10 Changed 7 years ago by anonymous

oh and I removed the last reference to get_column_names in testManager.py.

good catch.

comment:11 Changed 7 years ago by anonymous

  • Resolution fixed deleted
  • Status changed from closed to reopened

The generate test run button should throw you to a custom query page with a pre-built query showing you all tickets of type 'testcase' if you created that ticket type and the custom query should include other parameters that you set on the test runs page.

This works

So if you decided tests should be run against a particular version in a particular milestone then the custom query should reflect that.

This works

Do you see any test cases listed or the test template in the Templates and test cases list boxes? If you do you've got the path configured properly in the config file.

Yes

I've duplicated the warning in the log. Trac can't find associated style sheet. I'll fix that and check it in.

No more warning

Now that we're through those, the only problem is there are no tickets created when I create a test run after selecting a user and template, then click generate.

Also, when selecting an "Additional Test Case", and clicking "generate", I get this:

Configuration Problem
# There appears to be a configuration problem for the testcaseplugin. The reason could be one of the following: there are no testcases in subversion at the specified path
# the trac.ini file is missing the config variable SubversionPathToTestCases under the section 'testcaseExtension'
# the current user is not allowed to access the subversion repository using the current trac acount

Error message if any specified here : The test F specified in a test template or as the testcaseID in the test file does not exist in the master test list

F is the first letter in the test case that I'm selecting.

comment:12 Changed 7 years ago by anonymous

what tests exist in the testtemplate file. Can you cut and paste your testtemplate file into the bug report so I can see it.

I encountered a similar problem in an older version of the plugin where if the additonal testcases was a single testcase the plugin would break the single testcase name into a list (because it's expecting a list).

So the plugin would pull apart a testcase name like : test1 and look for 5 seperate test cases. it would look for test 't' and 'e' and 's' etc.

However, I added a check to see if the request object was a unicode string. Maybe in 0.9.X the parameter might also be a ascii encoded string, as this works fine in 0.10.1 and 0.10.3.

I can add a further check for this and apply the change to the 0.2.1 version if you wouldn't mind trying it.

thanks.

Again it would be great if you could check on this.

comment:13 Changed 7 years ago by anonymous

ok this is fixed in the branch 0.2.1 version in 2067 and in the trunk at 2066

comment:14 Changed 7 years ago by anonymous

Contents of testtemplates.xml

<templates>

<template name="smoke">
        <testcases>
                <testcase>exampleTestCase</testcase>
                <testcase></testcase>
        </testcases>
</template>

<template name="FDOManagement">
        <testcases>
                <testcase>FrankTestOne</testcase>
                <testcase></testcase>
        </testcases>
</template>

</templates>

I'll grab and check either the 0.2.1 2067 or the trunk @ 2066 today.

comment:15 Changed 7 years ago by anonymous

Okay, really getting there, now. Test cases are now created if I select from the "Select Additional Test Cases" box, but not if I select a template.

Thanks for the quick turnaround on this, by the way.

comment:16 Changed 7 years ago by edunne

hmmm, no error message in the log?

So if you only select the test template and hit generate test cases it takes you to the custom query page but with no testcases created.

ok, I'll see if I can think of a reason why this happens.

I'll use your test template file that you cut and pasted in (thanks) and see if I can duplicate the problem.

comment:17 Changed 7 years ago by anonymous

I think I found the problem. I think it's the same problem that was causing the strange behavior when only one test case was selected.

The script takes the name of your testtemplate "FrankTestOne" and splits it up into template 'F', template 'r' etc.

Of course those templates don't exist so no testcases get added.

I'll add the same check for the test template as I did for the testcases and hopefully that will take care of the issue.

no worries about the quick turn around, it's been interesting working through some of these issues.

comment:18 Changed 7 years ago by anonymous

  • Resolution set to fixed
  • Status changed from reopened to closed

ok rev 2072 in the branch and 2073 should resolve this issue. I added the extra check on the testtemplate arg to see if it's a unicode/str or list.

comment:19 Changed 7 years ago by anonymous

Rebuilt egg using trunk @ 2073 -

Selected username, and "smoke" from the Select Templates category.

Resulted in this:

Configuration Problem
# There appears to be a configuration problem for the testcaseplugin. The reason could be one of the following: there are no testcases in subversion at the specified path
# the trac.ini file is missing the config variable SubversionPathToTestCases under the section 'testcaseExtension'
# the current user is not allowed to access the subversion repository using the current trac acount

Error message if any specified here : The test smoke specified in a test template or as the testcaseID in the test file does not exist in the master test list

Looks like it's trying to access "smoke" as a test case, rather than getting the test cases from within "smoke".

comment:20 Changed 7 years ago by anonymous

Also - should "testcaseExtension" be in the .ini file? Or is that just an old name in the error message?

comment:21 Changed 7 years ago by anonymous

  • Resolution fixed deleted
  • Status changed from closed to reopened

yeah the 'testcaseExtension' is an old name. I'll replace that on Monday. The other error was caused by a silly cut and paste error.

If you look at line 116 in trunk it should be this : testTemplates = [testTemplates]
instead of :

115 if isinstance( testTemplates, str ):
116 testcases = [testTemplates]

This is a super simple fix obviously but I don't have access to a computer with a subversion client right now.

I'm skiing in the Rockies and I'm on a public computer. lol.

Anyay I'll fix it first thing Monday morning.

comment:22 Changed 7 years ago by anonymous

Updated my local and tested. Looks like we're in like Flynt!

I'll update if I come across anything else.

Do you have any plans to wrap permissions around this?

comment:23 Changed 7 years ago by anonymous

Hey - I had a few minutes today, so I added rudimentary permissions:

in testManager.py

line 14, added:

from trac.perm import IPermissionRequestor

line 50, modified to read:

implements(INavigationContributor, IRequestHandler, ITemplateProvider, IPermissionRequestor )

line 59, added:

    # IPermissionRequestor methods
    def get_permission_actions(self):
        yield 'TEST_MANAGEMENT'

line 64, modified

     def get_navigation_items(self, req):
         yield ('mainnav', 'testmanagement', Markup('<a href="%s">TestManagement</a>', self.env.href.testmanagement() + '/' ) )

to

     def get_navigation_items(self, req):
         if  req.perm.has_permission('TEST_MANAGEMENT'):
             yield ('mainnav', 'testmanagement', Markup('<a href="%s">TestManagement</a>', self.env.href.testmanagement() + '/' ) )

Of course TRAC_ADMIN inherits everything, so I haven't tested the specific TEST_MANAGEMENT permission - but this should work.

comment:24 Changed 7 years ago by anonymous

  • Resolution set to fixed
  • Status changed from reopened to closed

fixed in branch at 2080 and in trunk at 2081.

I didn't make the change until this morning..(tuesday), as I was away longer than I had planned, so maybe there was some other config issue on your end...not sure.

Anyway, thanks for adding the permission stuff and with this change that I just committed this issue should be finally closed. Thanks for the feedback.

If you find that the tool is lacking in any specific functionality let me know. I thought about adding the ability to create tests and testtemplates but a simple text editor like scite lets you edit xml pretty cleanly so I'm not sure it's really necessary.

Being able to see the test details from the testrun page might be helpful though.

Anyway, use the tool for a bit and let me know.

comment:25 Changed 7 years ago by anonymous

Ahh, sorry I thought you added the permissions stuff to the trunk code base but you modified your copy locally. That's cool.

I should definately look at permissions in the future. I don't want to make it very restrictive though.


comment:26 Changed 7 years ago by anonymous

re: Permissions - Yeah, sorry - I thought I'd update it yesterday, but I'd done an export instead of a co, and I couldn't remember the URL to check out - and with trac-hacks.org being offline...

The permissions stuff that I did just allows/disallows the tab to get to the Test Management - I suppose it wouldn't be terribly difficult to wrap a couple more things and allow for finer granularity, but this is sufficient for my needs here.

Anyhow, I'm rolling this out to my team on Monday and they should start writing test cases and utilizing this pretty extensively over the next couple of months.

I've never heard of scite - (just use vi, myself) - but I'll mention it to the team.

Two things that would be useful:

  • Being able to "unselect" if you've chosen the wrong item in the pick box.
  • Being able to view the test cases from the testrun page would be super-dope

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from edunne. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.