Warning: Can't synchronize with repository "(default)" (/home/git/ome.git does not appear to be a Git repository.). Look in the Trac log for more information.
Notice: In order to edit this ticket you need to be either: a Product Owner, The owner or the reporter of the ticket, or, in case of a Task not yet assigned, a team_member"

Task #11424 (closed)

Opened 11 years ago

Closed 8 years ago

Document pytest usage for omeroweb

Reported by: cneves Owned by: cneves
Priority: major Milestone: Testing2
Component: Web Version: 4.4.8
Keywords: n.a. Cc: wmoore
Resources: n.a. Referenced By: n.a.
References: n.a. Remaining Time: n.a.
Sprint: n.a.

Description


Change History (4)

comment:1 Changed 11 years ago by cneves

Running tests

New test system depends on pytest:

pip install pytest

Some optional plugins that really help out:

  • pytest-cov - Coverage reporting (required for --cov* options)
  • pytest-capturelog - Capture log messages

We don't use pytest-django as all that plugin does is allow for easier setting of DJANGO_SETTINGS_MODULE, which we handle on plugins/web.py thus preventing an extra dependency.

Running the tests:

bin/omero web test

The test runner assumes there's an ice.config file in ./etc/ice.config and that omeroweb apps are found in ./lib/python/omeroweb.

Optional arguments to test:

--config <path> : location of ice.config, default: ./etc/ice.config
--basepath <path> : location of base directory holding the django apps> (default: ./lib/python/omeroweb)
--testpath <path> : path for test collection relative to basepath
--string <string> : only run tests with name including string
--failfast : exit tests on first error
--verbose
--quiet
--pdb : drop to pdb on error
--cov <path>: measure coverage for path (relative to basepath), multiple allowed
--cov-report [term | term-missing | annotate | html | xml] : coverage report type, multiple allowed

Examples:

  • Run tests for webgateway
    bin/omero web test --testpath webgateway
    
  • Run tests in TestFileCache? class only
    bin/omero web test --string TestFileCache
    
Last edited 11 years ago by cneves (previous) (diff)

comment:2 Changed 11 years ago by cneves

  • Cc wmoore added

comment:3 Changed 11 years ago by jamoore

  • Milestone changed from Testing and Docs to Testing2

comment:4 Changed 8 years ago by sbesson

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets. You may also have a look at Agilo extensions to the ticket.

1.3.13-PRO © 2008-2011 Agilo Software all rights reserved (this page was served in: 0.67508 sec.)

We're Hiring!