Modify

Opened 12 years ago

Closed 20 months ago

Last modified 17 months ago

#10750 closed enhancement (fixed)

Resurrect functional tests

Reported by: Ryan J Ollos Owned by: Jun Omae
Priority: normal Component: AccountManagerPlugin
Severity: normal Keywords:
Cc: Trac Release:

Description

Get the functional tests working again.

Attachments (0)

Change History (8)

comment:1 Changed 12 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 8 years ago by Ryan J Ollos

Owner: Steffen Hoffmann deleted

comment:3 Changed 21 months ago by figaro

See also, and possible duplicate:

#11990
Failures of functional tests

comment:4 Changed 21 months ago by Jun Omae

I think we should avoid to need Trac source for the functional tests. At least, it no longer works with Trac 1.5.

XmlRpcPlugin's functional tests also required Trac source, but I made it work without Trac source in order to test with Trac 1.5 in r18513 (using trac.web.standalone instead of). See also source:/xmlrpcplugin/trunk/tracrpc/tests/__init__.py@18513.

comment:5 Changed 20 months ago by Jun Omae

Owner: set to Jun Omae
Status: newaccepted

I'm trying to work this before #13720. The functional tests work with twill 2.0 on Trac 1.2 and 1.4, as the results Trac source is no longer needed. I'm going to push the changes.

comment:7 Changed 20 months ago by Jun Omae

Resolution: fixed
Status: acceptedclosed

Fixed in [18533] (closing manually due to the following error in post-commit).

Transmitting file data .........done
Committing transaction...
Committed revision 18533.

Warning: Failed to start '/srv/trac-hacks.org/svn/trachacks/hooks/post-commit' hook

comment:8 Changed 20 months ago by Jun Omae

In 18533:

TracAccountManager 0.6dev: Resurrect functional tests using twill 2.0+ and Trac source is no longer needed (closes #10750)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jun Omae.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.