comparison tests/comprehensive/test_obsstore_on.py @ 1516:fbc22592f4fa

push: lock repo before calling createmarkers Previously, when devel.all-warnings is set to True, hg subversion will crash when pushing with the error: ProgrammingError: transaction requires locking Tracking that down, that is because "createmarkers" was called without locking. A comprehensive test was added to run test_push_command with obsstore turned on to cover the code paths.
author Jun Wu <quark@fb.com>
date Mon, 07 Aug 2017 18:12:16 -0700
parents
children
comparison
equal deleted inserted replaced
1515:106716ed2ed0 1516:fbc22592f4fa
1 import os
2 import sys
3
4 # wrapped in a try/except because of weirdness in how
5 # run.py works as compared to nose.
6 try:
7 import test_util
8 except ImportError:
9 sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
10 import test_util
11
12 import test_push_command
13
14
15 class ObsstoreOnMixIn(object):
16 # do not double the test size by being wrapped again
17 obsolete_mode_tests = False
18 stupid_mode_tests = False
19
20 def setUp(self):
21 super(ObsstoreOnMixIn, self).setUp()
22 hgrcpath = os.environ.get('HGRCPATH')
23 assert hgrcpath
24 with open(hgrcpath, 'a') as f:
25 f.write('\n[experimental]\nevolution=createmarkers\n')
26
27 def shortDescription(self):
28 text = super(ObsstoreOnMixIn, self).shortDescription()
29 if text:
30 text += ' (obsstore on)'
31 return text
32
33
34 def buildtestclass(cls):
35 name = 'ObsstoreOn%s' % cls.__name__
36 newcls = type(name, (ObsstoreOnMixIn, cls,), {})
37 globals()[name] = newcls
38
39
40 buildtestclass(test_push_command.PushTests)