4

We have nose tests that run on a teamcity build agent. Some tests are slow and are therefore not run on each pull request. The problem is that they are not being reported as skipped. They simply don't show up in the teamcity report.

Slow tests are marked with

@attr('nightly')

The ordinary tests are run like this:

nosetests path/to/tests --nocapture --nologcapture -v -a '!nightly'

I can list the nightly tests without running them like this:

nosetests path/to/tests --nocapture --nologcapture -v -a 'nightly' --collect-only

But that reports them as being run successfully.

How can I make the tests get reported to teamcity as being skipped?

--- Update ---

I have been poking around and found that the section I would like to change is in http://nose.readthedocs.io/en/latest/plugins/collect.html?highlight=addSuccess. I would like to change it to addSkipped but it is deprecated so it looks like I should use addError with the error class from http://nose.readthedocs.io/en/latest/plugins/skip.html.

How would I go about adding these changes? It seems nosetests are not actively maintained anymore...

morotspaj
  • 1,400
  • 11
  • 26

1 Answers1

1

This issue can not be resolved by configuration. You will have to hack the nose attrib plugin as it the code responsible of filtering out tests. TeamCity has no access to filtered out tests, as they are totally ignored by noestest.

Nikita Skvortsov
  • 4,768
  • 24
  • 37
  • I would be happy to run a second pass (as described in the question) which select the tests that were filtered out and reports them as skipped. This would dodge the problem with them being filtered out. – morotspaj Nov 07 '16 at 16:02
  • Again.Unforunately, you can not achieve this with configuration-only. You will have to hack into teamcity-python bridge used for reporting https://pypi.python.org/pypi/teamcity-messages or at least submit the request in github repo – Nikita Skvortsov Nov 13 '16 at 19:26