~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to doc/developers/testing.txt

  • Committer: Martin Pool
  • Date: 2010-07-17 16:46:44 UTC
  • mto: (5050.3.10 2.2)
  • mto: This revision was merged to the branch mainline in revision 5365.
  • Revision ID: mbp@canonical.com-20100717164644-uu4uhamdunf3mxzc
One more UI test needs updates for spinner being at the front

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
The Importance of Testing
7
7
=========================
8
8
 
9
 
Reliability is a critical success factor for any Version Control System.
 
9
Reliability is a critical success factor for any version control system.
10
10
We want Bazaar to be highly reliable across multiple platforms while
11
11
evolving over time to meet the needs of its community.
12
12
 
183
183
 
184
184
.. _testrepository: https://launchpad.net/testrepository
185
185
 
 
186
 
 
187
Babune continuous integration
 
188
-----------------------------
 
189
 
 
190
We have a Hudson continuous-integration system that automatically runs 
 
191
tests across various platforms.  In the future we plan to add more 
 
192
combinations including testing plugins.  See 
 
193
<http://babune.ladeuil.net:24842/>.  (Babune = Bazaar Buildbot Network.)
 
194
 
 
195
 
186
196
Writing Tests
187
197
=============
188
198
 
385
395
The actual use of ScriptRunner within a TestCase looks something like
386
396
this::
387
397
 
388
 
        def test_unshelve_keep(self):
389
 
                # some setup here
390
 
                sr = ScriptRunner()
391
 
                sr.run_script(self, '''
392
 
        $ bzr add file
393
 
        $ bzr shelve --all -m Foo
394
 
        $ bzr shelve --list
395
 
        1: Foo
396
 
        $ bzr unshelve --keep
397
 
        $ bzr shelve --list
398
 
        1: Foo
399
 
        $ cat file
400
 
        contents of file
401
 
        ''')
 
398
    from bzrlib.tests import script
 
399
 
 
400
    def test_unshelve_keep(self):
 
401
        # some setup here
 
402
        script.run_script(self, '''
 
403
            $ bzr add file
 
404
            $ bzr shelve --all -m Foo
 
405
            $ bzr shelve --list
 
406
            1: Foo
 
407
            $ bzr unshelve --keep
 
408
            $ bzr shelve --list
 
409
            1: Foo
 
410
            $ cat file
 
411
            contents of file
 
412
            ''')
402
413
 
403
414
 
404
415
Import tariff tests
420
431
  dependencies and only needed for particular cases.  If they're loaded in
421
432
  other cases then bzr may break for people who don't have those modules.
422
433
  
423
 
`test_import_tarrif` allows us to check that removal of imports doesn't
 
434
`test_import_tariff` allows us to check that removal of imports doesn't
424
435
regress.
425
436
 
426
437
This is done by running the command in a subprocess with
862
873
.. |--| unicode:: U+2014
863
874
 
864
875
..
865
 
   vim: ft=rst tw=74 ai
 
876
   vim: ft=rst tw=74 ai et sw=4