~launchpad-pqm/launchpad/devel

4583.1.2 by Gavin Panella
Add tests for checkwatches stuff.
1
= External Bug Tracker: checkwatches =
2
3
Strictly speaking, checkwatches is the name of a cronscript and a
4
module in the Launchpad codebase. In the absence of a more complete
5
testing infrastructure for the external bug tracking system, this
6
document will collect functional tests relating to both checkwatches
7
elements.
8
9
XXX Bug #126593 (Testing of external bug trackers is not extensive
10
enough) is tracking the provision of a more extensive testing
11
framework.
12
  -- Gavin Panella, 2007-07-18
13
14
15
== get_external_bugtracker ==
16
17
get_external_bugtracker is used to get an ExternalBugTracker suitable
18
for a particular bugtracker.
19
8523.3.10 by Gavin Panella
Fix up some externalbugtracker imports.
20
    >>> from lp.bugs.externalbugtracker import (
5897.3.3 by Graham Binns
Removed some test lint.
21
    ...     get_external_bugtracker)
4583.1.2 by Gavin Panella
Add tests for checkwatches stuff.
22
    >>> from canonical.launchpad.scripts import log
11692.6.2 by Curtis Hovey
Use deglober to fixing simple glob imports in doctests.
23
    >>> from lp.bugs.interfaces.bugtracker import BugTrackerType
4583.1.2 by Gavin Panella
Add tests for checkwatches stuff.
24
5121.7.9 by Graham Binns
All tests now pass.
25
get_external_bugtracker supports five external bug tracker types:
4583.1.2 by Gavin Panella
Add tests for checkwatches stuff.
26
27
    >>> bugtracker_types = [
28
    ...     BugTrackerType.BUGZILLA,
29
    ...     BugTrackerType.DEBBUGS,
4673.4.12 by Graham Binns
get_external_bugtracker now supports Trac (and so do its tests).
30
    ...     BugTrackerType.MANTIS,
4767.5.31 by Graham Binns
Added Roundup tests to externalbugtracker-checkwatches.txt.
31
    ...     BugTrackerType.ROUNDUP,
5121.7.9 by Graham Binns
All tests now pass.
32
    ...     BugTrackerType.RT,
5335.2.1 by Graham Binns
Added support for SourceForge bug status imports.
33
    ...     BugTrackerType.SOURCEFORGE,
4673.4.12 by Graham Binns
get_external_bugtracker now supports Trac (and so do its tests).
34
    ...     BugTrackerType.TRAC]
4583.1.2 by Gavin Panella
Add tests for checkwatches stuff.
35
8523.3.1 by Gavin Panella
Bugs tree reorg after automated migration.
36
    >>> from lp.bugs.tests.externalbugtracker import (
4945.2.3 by Bjorn Tillenius
make the rest of the externalbugtracker-* tests run using the checkwatches db user.
37
    ...     new_bugtracker)
11666.3.5 by Curtis Hovey
Import layers from canonical.testing.layers.
38
    >>> from canonical.testing.layers import LaunchpadZopelessLayer
5325.1.2 by Tom Berger
post review changes
39
    >>> txn = LaunchpadZopelessLayer.txn
4583.1.2 by Gavin Panella
Add tests for checkwatches stuff.
40
    >>> for bugtracker_type in bugtracker_types:
4945.2.3 by Bjorn Tillenius
make the rest of the externalbugtracker-* tests run using the checkwatches db user.
41
    ...     bugtracker = new_bugtracker(bugtracker_type)
4583.1.2 by Gavin Panella
Add tests for checkwatches stuff.
42
    ...     try:
43
    ...         # Suppress log messages in DebBugs
44
    ...         log.setLevel(log.level + 100)
5816.1.3 by Bjorn Tillenius
remove useless txn argument from get_external_bugtracker().
45
    ...         external_bugtracker = get_external_bugtracker(bugtracker)
4583.1.2 by Gavin Panella
Add tests for checkwatches stuff.
46
    ...     finally:
47
    ...         log.setLevel(log.level - 100)
48
    ...     print "%s --> %s" % (bugtracker_type.title,
49
    ...         external_bugtracker)
8523.3.12 by Gavin Panella
Fix a couple of checkwatches tests.
50
    Bugzilla --> <lp.bugs...bugzilla.Bugzilla ...>
51
    Debbugs --> <lp.bugs...debbugs.DebBugs ...>
52
    Mantis --> <lp.bugs...mantis.Mantis object at ...>
53
    Roundup --> <lp.bugs...roundup.Roundup ...>
54
    Request Tracker (RT) --> <lp.bugs...rt.RequestTracker ...>
6130.4.7 by Graham Binns
Fixed a test.
55
    SourceForge or SourceForge derivative -->
8523.3.12 by Gavin Panella
Fix a couple of checkwatches tests.
56
        <lp.bugs...sourceforge.SourceForge ...>
57
    Trac --> <lp.bugs...trac.Trac ...>