Modify

Opened 20 months ago

Last modified 20 months ago

#10750 new enhancement

Resurrect functional tests

Reported by: rjollos Owned by: hasienda
Priority: normal Component: AccountManagerPlugin
Severity: normal Keywords:
Cc: Trac Release:

Description

Get the functional tests working again.

Attachments (0)

Change History (1)

comment:1 Changed 20 months ago by rjollos

I took the initiative to create a ticket so that I'd have a place to copy this helpful input from osimons on IRC this evening:

(12:21:03) osimons: hasienda, rjollos: about functional tests, i'm not sure i see what the problem is - but then i don't quite know how you want to do it either

(12:22:50) osimons: the RPC plugin has plenty of functional tests that spawns a server and restarts it whenever tests make code changes - like testing new plugins and interfaces.

(12:25:10) osimons: but yeah, you need the trac source at hand. you don't even have to install it - just point to it using PYTHON_PATH=/path/to/trac:/path/to/genshi:/path/to/babel python setup.py test

(12:25:51) osimons: which is particularly handy when run using a repos like git or hg where you can just change the trac branch and run tests again

(12:29:10) osimons: i've hidden this complexity in make files though, so i don't need to go around remembering all the details between test runs... "make test" is enough to remember, and switching settings in a makefile.cfg file if something needs tweaking

(12:33:00) osimons: ah, knew i added info about it somewhere: http://trac.edgewall.org/ticket/10433#comment:19 + follow-up comments, including an example makefile as attachment


(12:35:30) rjollos: osimons: thanks for the hint, i've been meaning to checkout the makefile in Trac as well


(12:35:45) osimons: oh. i suppose that example was more aimed at extending it to trac development. i have heaps of other makefiles for my plugin projects

(12:37:03) rjollos: osimons: i haven't looked at it in several weeks, but i remember wishing that i could reuse more of the environment setup code from the Trac functional tests when setting up plugin functional tests. it's not fresh in my mind though.


(12:38:19) osimons: my makefiles are just part of my local config, haven't added them to repos.


(12:39:33) osimons: but that is just the launcher, the real work is done inside the plugin. so if you checkout RPC plugin source, and for instance make a clean virtualenv with trac+genshi+friends, then you can just do "python setup.py test" and it runs the full functional suite as well

(12:40:23) rjollos: osimons: been study the xmlrpc plugin functional tests since it's one of the few examples that exists on t-h.o, very helpful

(12:40:28) osimons: i use a subclassed test environment that stores things in the plugin source instead ++ see http://trac-hacks.org/browser/xmlrpcplugin/trunk/tracrpc/tests/__init__.py#L20

(12:41:01) osimons: it creates and tweaks as i want to to be, and so as to not depend or interfere with the trac install

(12:41:24) osimons: but as noted, you need to install trac as "python setup.py develop" for the tests source to be found

Add Comment

Modify Ticket

Action
as new .
Author


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

 
Note: See TracTickets for help on using tickets.