Opened 4 years ago

# Resurrect functional tests

Reported by: Owned by: Ryan J Ollos normal AccountManagerPlugin normal

### Description

Get the functional tests working again.

### comment:1 Changed 4 years ago by Ryan J Ollos

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

### comment:2 Changed 3 months ago by Ryan J Ollos

Owner: Steffen Hoffmann deleted

### Modify Ticket

Action
as new The ticket will remain with no owner.