standard_gtest_merge_test.py 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616
  1. #!/usr/bin/env vpython3
  2. # Copyright 2014 The Chromium Authors. All rights reserved.
  3. # Use of this source code is governed by a BSD-style license that can be
  4. # found in the LICENSE file.
  5. import json
  6. import logging
  7. import os
  8. import shutil
  9. import six
  10. import sys
  11. import tempfile
  12. import unittest
  13. import common_merge_script_tests
  14. import six
  15. THIS_DIR = os.path.dirname(os.path.abspath(__file__))
  16. # For 'standard_gtest_merge.py'.
  17. sys.path.insert(
  18. 0, os.path.abspath(os.path.join(THIS_DIR, '..', 'resources')))
  19. import mock
  20. import standard_gtest_merge
  21. # gtest json output for successfully finished shard #0.
  22. GOOD_GTEST_JSON_0 = {
  23. 'all_tests': [
  24. 'AlignedMemoryTest.DynamicAllocation',
  25. 'AlignedMemoryTest.ScopedDynamicAllocation',
  26. 'AlignedMemoryTest.StackAlignment',
  27. 'AlignedMemoryTest.StaticAlignment',
  28. ],
  29. 'disabled_tests': [
  30. 'ConditionVariableTest.TimeoutAcrossSetTimeOfDay',
  31. 'FileTest.TouchGetInfo',
  32. 'MessageLoopTestTypeDefault.EnsureDeletion',
  33. ],
  34. 'global_tags': ['CPU_64_BITS', 'MODE_DEBUG', 'OS_LINUX', 'OS_POSIX'],
  35. 'per_iteration_data': [{
  36. 'AlignedMemoryTest.DynamicAllocation': [{
  37. 'elapsed_time_ms': 0,
  38. 'losless_snippet': True,
  39. 'output_snippet': 'blah\\n',
  40. 'output_snippet_base64': 'YmxhaAo=',
  41. 'status': 'SUCCESS',
  42. }],
  43. 'AlignedMemoryTest.ScopedDynamicAllocation': [{
  44. 'elapsed_time_ms': 0,
  45. 'losless_snippet': True,
  46. 'output_snippet': 'blah\\n',
  47. 'output_snippet_base64': 'YmxhaAo=',
  48. 'status': 'SUCCESS',
  49. }],
  50. }],
  51. 'test_locations': {
  52. 'AlignedMemoryTest.DynamicAllocation': {
  53. 'file': 'foo/bar/allocation_test.cc',
  54. 'line': 123,
  55. },
  56. 'AlignedMemoryTest.ScopedDynamicAllocation': {
  57. 'file': 'foo/bar/allocation_test.cc',
  58. 'line': 456,
  59. },
  60. # This is a test from a different shard, but this happens in practice and we
  61. # should not fail if information is repeated.
  62. 'AlignedMemoryTest.StaticAlignment': {
  63. 'file': 'foo/bar/allocation_test.cc',
  64. 'line': 12,
  65. },
  66. },
  67. }
  68. # gtest json output for successfully finished shard #1.
  69. GOOD_GTEST_JSON_1 = {
  70. 'all_tests': [
  71. 'AlignedMemoryTest.DynamicAllocation',
  72. 'AlignedMemoryTest.ScopedDynamicAllocation',
  73. 'AlignedMemoryTest.StackAlignment',
  74. 'AlignedMemoryTest.StaticAlignment',
  75. ],
  76. 'disabled_tests': [
  77. 'ConditionVariableTest.TimeoutAcrossSetTimeOfDay',
  78. 'FileTest.TouchGetInfo',
  79. 'MessageLoopTestTypeDefault.EnsureDeletion',
  80. ],
  81. 'global_tags': ['CPU_64_BITS', 'MODE_DEBUG', 'OS_LINUX', 'OS_POSIX'],
  82. 'per_iteration_data': [{
  83. 'AlignedMemoryTest.StackAlignment': [{
  84. 'elapsed_time_ms': 0,
  85. 'losless_snippet': True,
  86. 'output_snippet': 'blah\\n',
  87. 'output_snippet_base64': 'YmxhaAo=',
  88. 'status': 'SUCCESS',
  89. }],
  90. 'AlignedMemoryTest.StaticAlignment': [{
  91. 'elapsed_time_ms': 0,
  92. 'losless_snippet': True,
  93. 'output_snippet': 'blah\\n',
  94. 'output_snippet_base64': 'YmxhaAo=',
  95. 'status': 'SUCCESS',
  96. }],
  97. }],
  98. 'test_locations': {
  99. 'AlignedMemoryTest.StackAlignment': {
  100. 'file': 'foo/bar/allocation_test.cc',
  101. 'line': 789,
  102. },
  103. 'AlignedMemoryTest.StaticAlignment': {
  104. 'file': 'foo/bar/allocation_test.cc',
  105. 'line': 12,
  106. },
  107. },
  108. }
  109. TIMED_OUT_GTEST_JSON_1 = {
  110. 'disabled_tests': [],
  111. 'global_tags': [],
  112. 'all_tests': [
  113. 'AlignedMemoryTest.DynamicAllocation',
  114. 'AlignedMemoryTest.ScopedDynamicAllocation',
  115. 'AlignedMemoryTest.StackAlignment',
  116. 'AlignedMemoryTest.StaticAlignment',
  117. ],
  118. 'per_iteration_data': [{
  119. 'AlignedMemoryTest.StackAlignment': [{
  120. 'elapsed_time_ms': 54000,
  121. 'losless_snippet': True,
  122. 'output_snippet': 'timed out',
  123. 'output_snippet_base64': '',
  124. 'status': 'FAILURE',
  125. }],
  126. 'AlignedMemoryTest.StaticAlignment': [{
  127. 'elapsed_time_ms': 0,
  128. 'losless_snippet': True,
  129. 'output_snippet': '',
  130. 'output_snippet_base64': '',
  131. 'status': 'NOTRUN',
  132. }],
  133. }],
  134. 'test_locations': {
  135. 'AlignedMemoryTest.StackAlignment': {
  136. 'file': 'foo/bar/allocation_test.cc',
  137. 'line': 789,
  138. },
  139. 'AlignedMemoryTest.StaticAlignment': {
  140. 'file': 'foo/bar/allocation_test.cc',
  141. 'line': 12,
  142. },
  143. },
  144. }
  145. # GOOD_GTEST_JSON_0 and GOOD_GTEST_JSON_1 merged.
  146. GOOD_GTEST_JSON_MERGED = {
  147. 'all_tests': [
  148. 'AlignedMemoryTest.DynamicAllocation',
  149. 'AlignedMemoryTest.ScopedDynamicAllocation',
  150. 'AlignedMemoryTest.StackAlignment',
  151. 'AlignedMemoryTest.StaticAlignment',
  152. ],
  153. 'disabled_tests': [
  154. 'ConditionVariableTest.TimeoutAcrossSetTimeOfDay',
  155. 'FileTest.TouchGetInfo',
  156. 'MessageLoopTestTypeDefault.EnsureDeletion',
  157. ],
  158. 'global_tags': ['CPU_64_BITS', 'MODE_DEBUG', 'OS_LINUX', 'OS_POSIX'],
  159. 'missing_shards': [],
  160. 'per_iteration_data': [{
  161. 'AlignedMemoryTest.DynamicAllocation': [{
  162. 'elapsed_time_ms': 0,
  163. 'losless_snippet': True,
  164. 'output_snippet': 'blah\\n',
  165. 'output_snippet_base64': 'YmxhaAo=',
  166. 'status': 'SUCCESS',
  167. }],
  168. 'AlignedMemoryTest.ScopedDynamicAllocation': [{
  169. 'elapsed_time_ms': 0,
  170. 'losless_snippet': True,
  171. 'output_snippet': 'blah\\n',
  172. 'output_snippet_base64': 'YmxhaAo=',
  173. 'status': 'SUCCESS',
  174. }],
  175. 'AlignedMemoryTest.StackAlignment': [{
  176. 'elapsed_time_ms': 0,
  177. 'losless_snippet': True,
  178. 'output_snippet': 'blah\\n',
  179. 'output_snippet_base64': 'YmxhaAo=',
  180. 'status': 'SUCCESS',
  181. }],
  182. 'AlignedMemoryTest.StaticAlignment': [{
  183. 'elapsed_time_ms': 0,
  184. 'losless_snippet': True,
  185. 'output_snippet': 'blah\\n',
  186. 'output_snippet_base64': 'YmxhaAo=',
  187. 'status': 'SUCCESS',
  188. }],
  189. }],
  190. 'swarming_summary': {
  191. u'shards': [
  192. {
  193. u'state': u'COMPLETED',
  194. u'outputs_ref': {
  195. u'view_url': u'blah',
  196. },
  197. }
  198. ],
  199. },
  200. 'test_locations': {
  201. 'AlignedMemoryTest.StackAlignment': {
  202. 'file': 'foo/bar/allocation_test.cc',
  203. 'line': 789,
  204. },
  205. 'AlignedMemoryTest.StaticAlignment': {
  206. 'file': 'foo/bar/allocation_test.cc',
  207. 'line': 12,
  208. },
  209. 'AlignedMemoryTest.DynamicAllocation': {
  210. 'file': 'foo/bar/allocation_test.cc',
  211. 'line': 123,
  212. },
  213. 'AlignedMemoryTest.ScopedDynamicAllocation': {
  214. 'file': 'foo/bar/allocation_test.cc',
  215. 'line': 456,
  216. },
  217. },
  218. }
  219. # Only shard #1 finished. UNRELIABLE_RESULTS is set.
  220. BAD_GTEST_JSON_ONLY_1_SHARD = {
  221. 'all_tests': [
  222. 'AlignedMemoryTest.DynamicAllocation',
  223. 'AlignedMemoryTest.ScopedDynamicAllocation',
  224. 'AlignedMemoryTest.StackAlignment',
  225. 'AlignedMemoryTest.StaticAlignment',
  226. ],
  227. 'disabled_tests': [
  228. 'ConditionVariableTest.TimeoutAcrossSetTimeOfDay',
  229. 'FileTest.TouchGetInfo',
  230. 'MessageLoopTestTypeDefault.EnsureDeletion',
  231. ],
  232. 'global_tags': [
  233. 'CPU_64_BITS',
  234. 'MODE_DEBUG',
  235. 'OS_LINUX',
  236. 'OS_POSIX',
  237. 'UNRELIABLE_RESULTS',
  238. ],
  239. 'missing_shards': [0],
  240. 'per_iteration_data': [{
  241. 'AlignedMemoryTest.StackAlignment': [{
  242. 'elapsed_time_ms': 0,
  243. 'losless_snippet': True,
  244. 'output_snippet': 'blah\\n',
  245. 'output_snippet_base64': 'YmxhaAo=',
  246. 'status': 'SUCCESS',
  247. }],
  248. 'AlignedMemoryTest.StaticAlignment': [{
  249. 'elapsed_time_ms': 0,
  250. 'losless_snippet': True,
  251. 'output_snippet': 'blah\\n',
  252. 'output_snippet_base64': 'YmxhaAo=',
  253. 'status': 'SUCCESS',
  254. }],
  255. }],
  256. 'test_locations': {
  257. 'AlignedMemoryTest.StackAlignment': {
  258. 'file': 'foo/bar/allocation_test.cc',
  259. 'line': 789,
  260. },
  261. 'AlignedMemoryTest.StaticAlignment': {
  262. 'file': 'foo/bar/allocation_test.cc',
  263. 'line': 12,
  264. },
  265. },
  266. }
  267. # GOOD_GTEST_JSON_0 and TIMED_OUT_GTEST_JSON_1 merged.
  268. TIMED_OUT_GTEST_JSON_MERGED = {
  269. 'all_tests': [
  270. 'AlignedMemoryTest.DynamicAllocation',
  271. 'AlignedMemoryTest.ScopedDynamicAllocation',
  272. 'AlignedMemoryTest.StackAlignment',
  273. 'AlignedMemoryTest.StaticAlignment',
  274. ],
  275. 'disabled_tests': [
  276. 'ConditionVariableTest.TimeoutAcrossSetTimeOfDay',
  277. 'FileTest.TouchGetInfo',
  278. 'MessageLoopTestTypeDefault.EnsureDeletion',
  279. ],
  280. 'global_tags': ['CPU_64_BITS', 'MODE_DEBUG', 'OS_LINUX', 'OS_POSIX'],
  281. 'missing_shards': [],
  282. 'per_iteration_data': [{
  283. 'AlignedMemoryTest.DynamicAllocation': [{
  284. 'elapsed_time_ms': 0,
  285. 'losless_snippet': True,
  286. 'output_snippet': 'blah\\n',
  287. 'output_snippet_base64': 'YmxhaAo=',
  288. 'status': 'SUCCESS',
  289. }],
  290. 'AlignedMemoryTest.ScopedDynamicAllocation': [{
  291. 'elapsed_time_ms': 0,
  292. 'losless_snippet': True,
  293. 'output_snippet': 'blah\\n',
  294. 'output_snippet_base64': 'YmxhaAo=',
  295. 'status': 'SUCCESS',
  296. }],
  297. 'AlignedMemoryTest.StackAlignment': [{
  298. 'elapsed_time_ms': 54000,
  299. 'losless_snippet': True,
  300. 'output_snippet': 'timed out',
  301. 'output_snippet_base64': '',
  302. 'status': 'FAILURE',
  303. }],
  304. 'AlignedMemoryTest.StaticAlignment': [{
  305. 'elapsed_time_ms': 0,
  306. 'losless_snippet': True,
  307. 'output_snippet': '',
  308. 'output_snippet_base64': '',
  309. 'status': 'NOTRUN',
  310. }],
  311. }],
  312. 'swarming_summary': {
  313. u'shards': [
  314. {
  315. u'state': u'COMPLETED',
  316. },
  317. {
  318. u'state': u'TIMED_OUT',
  319. },
  320. ],
  321. },
  322. 'test_locations': {
  323. 'AlignedMemoryTest.StackAlignment': {
  324. 'file': 'foo/bar/allocation_test.cc',
  325. 'line': 789,
  326. },
  327. 'AlignedMemoryTest.StaticAlignment': {
  328. 'file': 'foo/bar/allocation_test.cc',
  329. 'line': 12,
  330. },
  331. 'AlignedMemoryTest.DynamicAllocation': {
  332. 'file': 'foo/bar/allocation_test.cc',
  333. 'line': 123,
  334. },
  335. 'AlignedMemoryTest.ScopedDynamicAllocation': {
  336. 'file': 'foo/bar/allocation_test.cc',
  337. 'line': 456,
  338. },
  339. },
  340. }
  341. class _StandardGtestMergeTest(unittest.TestCase):
  342. def setUp(self):
  343. self.temp_dir = tempfile.mkdtemp()
  344. def tearDown(self):
  345. shutil.rmtree(self.temp_dir)
  346. def _write_temp_file(self, path, content):
  347. abs_path = os.path.join(self.temp_dir, path.replace('/', os.sep))
  348. if not os.path.exists(os.path.dirname(abs_path)):
  349. os.makedirs(os.path.dirname(abs_path))
  350. with open(abs_path, 'w') as f:
  351. if isinstance(content, dict):
  352. json.dump(content, f)
  353. else:
  354. assert isinstance(content, str)
  355. f.write(content)
  356. return abs_path
  357. class LoadShardJsonTest(_StandardGtestMergeTest):
  358. def test_double_digit_jsons(self):
  359. jsons_to_merge = []
  360. for i in range(15):
  361. json_dir = os.path.join(self.temp_dir, str(i))
  362. json_path = os.path.join(json_dir, 'output.json')
  363. if not os.path.exists(json_dir):
  364. os.makedirs(json_dir)
  365. with open(json_path, 'w') as f:
  366. json.dump({'all_tests': ['LoadShardJsonTest.test%d' % i]}, f)
  367. jsons_to_merge.append(json_path)
  368. content, err = standard_gtest_merge.load_shard_json(
  369. 0, None, jsons_to_merge)
  370. self.assertEqual({'all_tests': ['LoadShardJsonTest.test0']}, content)
  371. self.assertIsNone(err)
  372. content, err = standard_gtest_merge.load_shard_json(
  373. 12, None, jsons_to_merge)
  374. self.assertEqual({'all_tests': ['LoadShardJsonTest.test12']}, content)
  375. self.assertIsNone(err)
  376. def test_double_task_id_jsons(self):
  377. jsons_to_merge = []
  378. for i in range(15):
  379. json_dir = os.path.join(self.temp_dir, 'deadbeef%d' % i)
  380. json_path = os.path.join(json_dir, 'output.json')
  381. if not os.path.exists(json_dir):
  382. os.makedirs(json_dir)
  383. with open(json_path, 'w') as f:
  384. json.dump({'all_tests': ['LoadShardJsonTest.test%d' % i]}, f)
  385. jsons_to_merge.append(json_path)
  386. content, err = standard_gtest_merge.load_shard_json(
  387. 0, 'deadbeef0', jsons_to_merge)
  388. self.assertEqual({'all_tests': ['LoadShardJsonTest.test0']},
  389. content)
  390. self.assertIsNone(err)
  391. content, err = standard_gtest_merge.load_shard_json(
  392. 12, 'deadbeef12', jsons_to_merge)
  393. self.assertEqual({'all_tests': ['LoadShardJsonTest.test12']},
  394. content)
  395. self.assertIsNone(err)
  396. class MergeShardResultsTest(_StandardGtestMergeTest):
  397. """Tests for merge_shard_results function."""
  398. # pylint: disable=super-with-arguments
  399. def setUp(self):
  400. super(MergeShardResultsTest, self).setUp()
  401. self.summary = None
  402. self.test_files = []
  403. # pylint: enable=super-with-arguments
  404. def stage(self, summary, files):
  405. self.summary = self._write_temp_file('summary.json', summary)
  406. for path, content in files.items():
  407. abs_path = self._write_temp_file(path, content)
  408. self.test_files.append(abs_path)
  409. def call(self):
  410. stdout = six.StringIO()
  411. with mock.patch('sys.stdout', stdout):
  412. merged = standard_gtest_merge.merge_shard_results(
  413. self.summary, self.test_files)
  414. return merged, stdout.getvalue().strip()
  415. def assertUnicodeEquals(self, expectation, result):
  416. def convert_to_unicode(key_or_value):
  417. if isinstance(key_or_value, str):
  418. return six.text_type(key_or_value)
  419. if isinstance(key_or_value, dict):
  420. return {convert_to_unicode(k): convert_to_unicode(v)
  421. for k, v in key_or_value.items()}
  422. if isinstance(key_or_value, list):
  423. return [convert_to_unicode(x) for x in key_or_value]
  424. return key_or_value
  425. unicode_expectations = convert_to_unicode(expectation)
  426. unicode_result = convert_to_unicode(result)
  427. self.assertEquals(unicode_expectations, unicode_result)
  428. def test_ok(self):
  429. # Two shards, both successfully finished.
  430. self.stage({
  431. u'shards': [
  432. {
  433. u'state': u'COMPLETED',
  434. },
  435. {
  436. u'state': u'COMPLETED',
  437. },
  438. ],
  439. },
  440. {
  441. '0/output.json': GOOD_GTEST_JSON_0,
  442. '1/output.json': GOOD_GTEST_JSON_1,
  443. })
  444. merged, stdout = self.call()
  445. merged['swarming_summary'] = {
  446. 'shards': [
  447. {
  448. u'state': u'COMPLETED',
  449. u'outputs_ref': {
  450. u'view_url': u'blah',
  451. },
  452. }
  453. ],
  454. }
  455. self.assertUnicodeEquals(GOOD_GTEST_JSON_MERGED, merged)
  456. self.assertEqual('', stdout)
  457. def test_timed_out(self):
  458. # Two shards, both successfully finished.
  459. self.stage({
  460. 'shards': [
  461. {
  462. 'state': 'COMPLETED',
  463. },
  464. {
  465. 'state': 'TIMED_OUT',
  466. },
  467. ],
  468. },
  469. {
  470. '0/output.json': GOOD_GTEST_JSON_0,
  471. '1/output.json': TIMED_OUT_GTEST_JSON_1,
  472. })
  473. merged, stdout = self.call()
  474. self.assertUnicodeEquals(TIMED_OUT_GTEST_JSON_MERGED, merged)
  475. self.assertIn(
  476. 'Test runtime exceeded allocated time\n', stdout)
  477. def test_missing_summary_json(self):
  478. # summary.json is missing, should return None and emit warning.
  479. self.summary = os.path.join(self.temp_dir, 'summary.json')
  480. merged, output = self.call()
  481. self.assertEqual(None, merged)
  482. self.assertIn('@@@STEP_WARNINGS@@@', output)
  483. self.assertIn('summary.json is missing or can not be read', output)
  484. def test_unfinished_shards(self):
  485. # Only one shard (#1) finished. Shard #0 did not.
  486. self.stage({
  487. u'shards': [
  488. None,
  489. {
  490. u'state': u'COMPLETED',
  491. },
  492. ],
  493. },
  494. {
  495. u'1/output.json': GOOD_GTEST_JSON_1,
  496. })
  497. merged, stdout = self.call()
  498. merged.pop('swarming_summary')
  499. self.assertUnicodeEquals(BAD_GTEST_JSON_ONLY_1_SHARD, merged)
  500. self.assertIn(
  501. '@@@STEP_WARNINGS@@@\nsome shards did not complete: 0\n', stdout)
  502. self.assertIn(
  503. '@@@STEP_LOG_LINE@some shards did not complete: 0@'
  504. 'Missing results from the following shard(s): 0@@@\n', stdout)
  505. def test_missing_output_json(self):
  506. # Shard #0 output json is missing.
  507. self.stage({
  508. u'shards': [
  509. {
  510. u'state': u'COMPLETED',
  511. },
  512. {
  513. u'state': u'COMPLETED',
  514. },
  515. ],
  516. },
  517. {
  518. u'1/output.json': GOOD_GTEST_JSON_1,
  519. })
  520. merged, stdout = self.call()
  521. merged.pop('swarming_summary')
  522. self.assertUnicodeEquals(BAD_GTEST_JSON_ONLY_1_SHARD, merged)
  523. self.assertIn(
  524. 'No result was found: '
  525. 'shard 0 test output was missing', stdout)
  526. def test_large_output_json(self):
  527. # a shard is too large.
  528. self.stage({
  529. u'shards': [
  530. {
  531. u'state': u'COMPLETED',
  532. },
  533. {
  534. u'state': u'COMPLETED',
  535. },
  536. ],
  537. },
  538. {
  539. '0/output.json': GOOD_GTEST_JSON_0,
  540. '1/output.json': GOOD_GTEST_JSON_1,
  541. })
  542. old_json_limit = standard_gtest_merge.OUTPUT_JSON_SIZE_LIMIT
  543. len0 = len(json.dumps(GOOD_GTEST_JSON_0))
  544. len1 = len(json.dumps(GOOD_GTEST_JSON_1))
  545. large_shard = "0" if len0 > len1 else "1"
  546. try:
  547. # Override max output.json size just for this test.
  548. standard_gtest_merge.OUTPUT_JSON_SIZE_LIMIT = min(len0,len1)
  549. merged, stdout = self.call()
  550. merged.pop('swarming_summary')
  551. self.assertUnicodeEquals(BAD_GTEST_JSON_ONLY_1_SHARD, merged)
  552. self.assertIn(
  553. 'No result was found: '
  554. 'shard %s test output exceeded the size limit' % large_shard, stdout)
  555. finally:
  556. standard_gtest_merge.OUTPUT_JSON_SIZE_LIMIT = old_json_limit
  557. class CommandLineTest(common_merge_script_tests.CommandLineTest):
  558. # pylint: disable=super-with-arguments
  559. def __init__(self, methodName='runTest'):
  560. super(CommandLineTest, self).__init__(methodName, standard_gtest_merge)
  561. # pylint: enable=super-with-arguments
  562. if __name__ == '__main__':
  563. logging.basicConfig(
  564. level=logging.DEBUG if '-v' in sys.argv else logging.ERROR)
  565. if '-v' in sys.argv:
  566. unittest.TestCase.maxDiff = None
  567. unittest.main()