Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#9872 closed enhancement (fixed)

Create a test runner for BridgeDB unittests

Reported by: isis Owned by: isis
Priority: Medium Milestone:
Component: Circumvention/BridgeDB Version:
Severity: Keywords: bridgedb-unittests
Cc: isis Actual Points:
Parent ID: #9865 Points:
Reviewer: Sponsor:

Description

We need a test runner which can pass on commands (i.e. doing "python setup.py test" would actually run "trial coverage [args] [tests/test directory]" and pass the arguments and test cases to coverage if need be. See tahoe-lafs's code for an example) and environment variables (i.e. PYTHONPATH).

Ideally, this thing will handle coverage (but that shouldn't be prioritised, as it isn't necessary), and it should handle whatever different unittest frameworks are used so that all pertinent tests can be run with one command.

Child Tickets

Attachments (1)

001-test-runner.patch (2.0 KB) - added by isis 7 years ago.

Download all attachments as: .zip

Change History (3)

comment:1 Changed 7 years ago by isis

I don't think we'll be able to run python-coverage from setup.py without some serious hacking, but twisted.trial can be run from setup.py.

We can add a 'coverage' and 'test' command to scripts/bridgedb, so that either of these could be run after the bridgedb script is installed though.

comment:2 Changed 7 years ago by isis

Resolution: fixed
Status: newclosed

This was added in my develop branch at commit c9dc17e85b5f19b791b1a509fe65a1bb9e319b47. A patch is also attached.

To run the trial-based tests, install BridgeDB and do:

$ bridgedb test

The reporter for python-coverage still isn't working correctly, to fix it, I believe that hooks into trialcoverage.coverage will need to be made to force twisted.trial to use trialcoverage's added --reporter=bwverbose-coverage flag. I didn't really want to fiddle with it more right now because it's really only important that the unittests run; they can have pretty reporting/graphs/coveralls later.

Last edited 7 years ago by isis (previous) (diff)

Changed 7 years ago by isis

Attachment: 001-test-runner.patch added
Note: See TracTickets for help on using tickets.