I use teamcity-nose with the following configuration in settings.py:
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
NOSE_ARGS = ['-v', '-s', '--rednose', '--with-selenium',]
if os.getenv('TEAMCITY_PROJECT_NAME') is not None:
My build step, which performs the testing, is as follows:
. /opt/teamcity/virtualenvs/myproj/bin/activate
dropdb test_myproj-teamcity &> /dev/null
manage.py test
My manage.py project is on the path (I install in the virtual bin bin through setup.py) so you will have to add the path if you do otherwise.
I never managed to add coverage to the test itself, because there are problems with version control of the packages, so with the last coverage package I just added it to an additional build step:
. /opt/teamcity/virtualenvs/myproj/bin/activate
coverage html --include=myproj/*.*
cloc . --out=./htmlcov/cloc.txt
Then you can add a tab that includes html coverage if you add this to your artifact:
./htmlcov/
I also add a tab with a line counter, you will need to install cloc or linecounter of your choice.
fab ( , ), , , "pip install -r requirements.pip" build:
+:**.pip
, , :
+:.
-:**.pip
-:*fabfile.py
-:*myproj/conf/*
+:*myproj/conf/teamcity/*