annotate tests/sitecustomize.py @ 24847:b705e5ab3b07 stable

bundle2: capture transaction rollback message output (issue4614) The output from the transaction rollback was not included into the reply bundle. It was eventually caught by the usual 'unbundle' output capture and sent to the client but the result was out of order on the client side. We now capture the output for the transaction release and transmit it the same way as all other output. We should probably rethink the whole output capture things but this would not be appropriate for stable. The is still multiple cases were output failed to be properly capture, they will be fixed in later changesets.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 23 Apr 2015 14:20:36 +0100
parents 031947baf4d0
children b12bda49c3e3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
24505
031947baf4d0 run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents: 14971
diff changeset
1 import os
031947baf4d0 run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents: 14971
diff changeset
2
031947baf4d0 run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents: 14971
diff changeset
3 if os.environ.get('COVERAGE_PROCESS_START'):
031947baf4d0 run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents: 14971
diff changeset
4 try:
031947baf4d0 run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents: 14971
diff changeset
5 import coverage
031947baf4d0 run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents: 14971
diff changeset
6 import random
031947baf4d0 run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents: 14971
diff changeset
7
031947baf4d0 run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents: 14971
diff changeset
8 # uuid is better, but not available in Python 2.4.
031947baf4d0 run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents: 14971
diff changeset
9 covpath = os.path.join(os.environ['COVERAGE_DIR'],
031947baf4d0 run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents: 14971
diff changeset
10 'cov.%s' % random.randrange(0, 1000000000000))
031947baf4d0 run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents: 14971
diff changeset
11 cov = coverage.coverage(data_file=covpath, auto_data=True)
031947baf4d0 run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents: 14971
diff changeset
12 cov._warn_no_data = False
031947baf4d0 run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents: 14971
diff changeset
13 cov._warn_unimported_source = False
031947baf4d0 run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents: 14971
diff changeset
14 cov.start()
031947baf4d0 run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents: 14971
diff changeset
15 except ImportError:
031947baf4d0 run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents: 14971
diff changeset
16 pass