Best Python code snippet using tappy_python
instrumentation_test_instance_test.py
Source:instrumentation_test_instance_test.py  
1#!/usr/bin/env python2# Copyright 2014 The Chromium Authors. All rights reserved.3# Use of this source code is governed by a BSD-style license that can be4# found in the LICENSE file.5"""Unit tests for instrumentation_test_instance."""6# pylint: disable=protected-access7import collections8import tempfile9import unittest10from pylib.base import base_test_result11from pylib.constants import host_paths12from pylib.instrumentation import instrumentation_test_instance13with host_paths.SysPath(host_paths.PYMOCK_PATH):14  import mock  # pylint: disable=import-error15_INSTRUMENTATION_TEST_INSTANCE_PATH = (16    'pylib.instrumentation.instrumentation_test_instance.%s')17class InstrumentationTestInstanceTest(unittest.TestCase):18  def setUp(self):19    options = mock.Mock()20    options.tool = ''21  @staticmethod22  def createTestInstance():23    c = _INSTRUMENTATION_TEST_INSTANCE_PATH % 'InstrumentationTestInstance'24    with mock.patch('%s._initializeApkAttributes' % c), (25         mock.patch('%s._initializeDataDependencyAttributes' % c)), (26         mock.patch('%s._initializeTestFilterAttributes' % c)), (27         mock.patch('%s._initializeFlagAttributes' % c)), (28         mock.patch('%s._initializeDriverAttributes' % c)), (29         mock.patch('%s._initializeTestControlAttributes' % c)), (30         mock.patch('%s._initializeTestCoverageAttributes' % c)):31      return instrumentation_test_instance.InstrumentationTestInstance(32          mock.MagicMock(), mock.MagicMock(), lambda s: None)33  _FlagAttributesArgs = collections.namedtuple('_FlagAttributesArgs', [34      'command_line_flags', 'device_flags_file', 'strict_mode',35      'use_apk_under_test_flags_file', 'coverage_dir'36  ])37  def createFlagAttributesArgs(self,38                               command_line_flags=None,39                               device_flags_file=None,40                               strict_mode=None,41                               use_apk_under_test_flags_file=False,42                               coverage_dir=None):43    return self._FlagAttributesArgs(command_line_flags, device_flags_file,44                                    strict_mode, use_apk_under_test_flags_file,45                                    coverage_dir)46  def test_initializeFlagAttributes_commandLineFlags(self):47    o = self.createTestInstance()48    args = self.createFlagAttributesArgs(command_line_flags=['--foo', '--bar'])49    o._initializeFlagAttributes(args)50    self.assertEquals(o._flags, ['--enable-test-intents', '--foo', '--bar'])51  def test_initializeFlagAttributes_deviceFlagsFile(self):52    o = self.createTestInstance()53    with tempfile.NamedTemporaryFile() as flags_file:54      flags_file.write('\n'.join(['--foo', '--bar']))55      flags_file.flush()56      args = self.createFlagAttributesArgs(device_flags_file=flags_file.name)57      o._initializeFlagAttributes(args)58      self.assertEquals(o._flags, ['--enable-test-intents', '--foo', '--bar'])59  def test_initializeFlagAttributes_strictModeOn(self):60    o = self.createTestInstance()61    args = self.createFlagAttributesArgs(strict_mode='on')62    o._initializeFlagAttributes(args)63    self.assertEquals(o._flags, ['--enable-test-intents', '--strict-mode=on'])64  def test_initializeFlagAttributes_strictModeOn_coverageOn(self):65    o = self.createTestInstance()66    args = self.createFlagAttributesArgs(67        strict_mode='on', coverage_dir='/coverage/dir')68    o._initializeFlagAttributes(args)69    self.assertEquals(o._flags, ['--enable-test-intents'])70  def test_initializeFlagAttributes_strictModeOff(self):71    o = self.createTestInstance()72    args = self.createFlagAttributesArgs(strict_mode='off')73    o._initializeFlagAttributes(args)74    self.assertEquals(o._flags, ['--enable-test-intents'])75  def testGetTests_noFilter(self):76    o = self.createTestInstance()77    raw_tests = [78      {79        'annotations': {'Feature': {'value': ['Foo']}},80        'class': 'org.chromium.test.SampleTest',81        'superclass': 'java.lang.Object',82        'methods': [83          {84            'annotations': {'SmallTest': None},85            'method': 'testMethod1',86          },87          {88            'annotations': {'MediumTest': None},89            'method': 'testMethod2',90          },91        ],92      },93      {94        'annotations': {'Feature': {'value': ['Bar']}},95        'class': 'org.chromium.test.SampleTest2',96        'superclass': 'java.lang.Object',97        'methods': [98          {99            'annotations': {'SmallTest': None},100            'method': 'testMethod1',101          },102        ],103      }104    ]105    expected_tests = [106      {107        'annotations': {108          'Feature': {'value': ['Foo']},109          'SmallTest': None,110        },111        'class': 'org.chromium.test.SampleTest',112        'method': 'testMethod1',113        'is_junit4': True,114      },115      {116        'annotations': {117          'Feature': {'value': ['Foo']},118          'MediumTest': None,119        },120        'class': 'org.chromium.test.SampleTest',121        'method': 'testMethod2',122        'is_junit4': True,123      },124      {125        'annotations': {126          'Feature': {'value': ['Bar']},127          'SmallTest': None,128        },129        'class': 'org.chromium.test.SampleTest2',130        'method': 'testMethod1',131        'is_junit4': True,132      },133    ]134    o._test_jar = 'path/to/test.jar'135    o._junit4_runner_class = 'J4Runner'136    actual_tests = o.ProcessRawTests(raw_tests)137    self.assertEquals(actual_tests, expected_tests)138  def testGetTests_simpleGtestFilter(self):139    o = self.createTestInstance()140    raw_tests = [141      {142        'annotations': {'Feature': {'value': ['Foo']}},143        'class': 'org.chromium.test.SampleTest',144        'superclass': 'java.lang.Object',145        'methods': [146          {147            'annotations': {'SmallTest': None},148            'method': 'testMethod1',149          },150          {151            'annotations': {'MediumTest': None},152            'method': 'testMethod2',153          },154        ],155      }156    ]157    expected_tests = [158      {159        'annotations': {160          'Feature': {'value': ['Foo']},161          'SmallTest': None,162        },163        'class': 'org.chromium.test.SampleTest',164        'is_junit4': True,165        'method': 'testMethod1',166      },167    ]168    o._test_filter = 'org.chromium.test.SampleTest.testMethod1'169    o._test_jar = 'path/to/test.jar'170    o._junit4_runner_class = 'J4Runner'171    actual_tests = o.ProcessRawTests(raw_tests)172    self.assertEquals(actual_tests, expected_tests)173  def testGetTests_simpleGtestUnqualifiedNameFilter(self):174    o = self.createTestInstance()175    raw_tests = [176      {177        'annotations': {'Feature': {'value': ['Foo']}},178        'class': 'org.chromium.test.SampleTest',179        'superclass': 'java.lang.Object',180        'methods': [181          {182            'annotations': {'SmallTest': None},183            'method': 'testMethod1',184          },185          {186            'annotations': {'MediumTest': None},187            'method': 'testMethod2',188          },189        ],190      }191    ]192    expected_tests = [193      {194        'annotations': {195          'Feature': {'value': ['Foo']},196          'SmallTest': None,197        },198        'class': 'org.chromium.test.SampleTest',199        'is_junit4': True,200        'method': 'testMethod1',201      },202    ]203    o._test_filter = 'SampleTest.testMethod1'204    o._test_jar = 'path/to/test.jar'205    o._junit4_runner_class = 'J4Runner'206    actual_tests = o.ProcessRawTests(raw_tests)207    self.assertEquals(actual_tests, expected_tests)208  def testGetTests_parameterizedTestGtestFilter(self):209    o = self.createTestInstance()210    raw_tests = [211      {212        'annotations': {'Feature': {'value': ['Foo']}},213        'class': 'org.chromium.test.SampleTest',214        'superclass': 'java.lang.Object',215        'methods': [216          {217            'annotations': {'SmallTest': None},218            'method': 'testMethod1',219          },220          {221            'annotations': {'SmallTest': None},222            'method': 'testMethod1__sandboxed_mode',223          },224        ],225      },226      {227        'annotations': {'Feature': {'value': ['Bar']}},228        'class': 'org.chromium.test.SampleTest2',229        'superclass': 'java.lang.Object',230        'methods': [231          {232            'annotations': {'SmallTest': None},233            'method': 'testMethod1',234          },235        ],236      }237    ]238    expected_tests = [239      {240        'annotations': {241          'Feature': {'value': ['Foo']},242          'SmallTest': None,243        },244        'class': 'org.chromium.test.SampleTest',245        'method': 'testMethod1',246        'is_junit4': True,247      },248      {249        'annotations': {250          'Feature': {'value': ['Foo']},251          'SmallTest': None,252        },253        'class': 'org.chromium.test.SampleTest',254        'method': 'testMethod1__sandboxed_mode',255        'is_junit4': True,256      },257    ]258    o._test_jar = 'path/to/test.jar'259    o._junit4_runner_class = 'J4Runner'260    o._test_filter = 'org.chromium.test.SampleTest.testMethod1'261    actual_tests = o.ProcessRawTests(raw_tests)262    self.assertEquals(actual_tests, expected_tests)263  def testGetTests_wildcardGtestFilter(self):264    o = self.createTestInstance()265    raw_tests = [266      {267        'annotations': {'Feature': {'value': ['Foo']}},268        'class': 'org.chromium.test.SampleTest',269        'superclass': 'java.lang.Object',270        'methods': [271          {272            'annotations': {'SmallTest': None},273            'method': 'testMethod1',274          },275          {276            'annotations': {'MediumTest': None},277            'method': 'testMethod2',278          },279        ],280      },281      {282        'annotations': {'Feature': {'value': ['Bar']}},283        'class': 'org.chromium.test.SampleTest2',284        'superclass': 'java.lang.Object',285        'methods': [286          {287            'annotations': {'SmallTest': None},288            'method': 'testMethod1',289          },290        ],291      }292    ]293    expected_tests = [294      {295        'annotations': {296          'Feature': {'value': ['Bar']},297          'SmallTest': None,298        },299        'class': 'org.chromium.test.SampleTest2',300        'is_junit4': True,301        'method': 'testMethod1',302      },303    ]304    o._test_filter = 'org.chromium.test.SampleTest2.*'305    o._test_jar = 'path/to/test.jar'306    o._junit4_runner_class = 'J4Runner'307    actual_tests = o.ProcessRawTests(raw_tests)308    self.assertEquals(actual_tests, expected_tests)309  def testGetTests_negativeGtestFilter(self):310    o = self.createTestInstance()311    raw_tests = [312      {313        'annotations': {'Feature': {'value': ['Foo']}},314        'class': 'org.chromium.test.SampleTest',315        'superclass': 'java.lang.Object',316        'methods': [317          {318            'annotations': {'SmallTest': None},319            'method': 'testMethod1',320          },321          {322            'annotations': {'MediumTest': None},323            'method': 'testMethod2',324          },325        ],326      },327      {328        'annotations': {'Feature': {'value': ['Bar']}},329        'class': 'org.chromium.test.SampleTest2',330        'superclass': 'java.lang.Object',331        'methods': [332          {333            'annotations': {'SmallTest': None},334            'method': 'testMethod1',335          },336        ],337      }338    ]339    expected_tests = [340      {341        'annotations': {342          'Feature': {'value': ['Foo']},343          'MediumTest': None,344        },345        'class': 'org.chromium.test.SampleTest',346        'is_junit4': True,347        'method': 'testMethod2',348      },349      {350        'annotations': {351          'Feature': {'value': ['Bar']},352          'SmallTest': None,353        },354        'class': 'org.chromium.test.SampleTest2',355        'is_junit4': True,356        'method': 'testMethod1',357      },358    ]359    o._test_filter = '*-org.chromium.test.SampleTest.testMethod1'360    o._test_jar = 'path/to/test.jar'361    o._junit4_runner_class = 'J4Runner'362    actual_tests = o.ProcessRawTests(raw_tests)363    self.assertEquals(actual_tests, expected_tests)364  def testGetTests_annotationFilter(self):365    o = self.createTestInstance()366    raw_tests = [367      {368        'annotations': {'Feature': {'value': ['Foo']}},369        'class': 'org.chromium.test.SampleTest',370        'superclass': 'java.lang.Object',371        'methods': [372          {373            'annotations': {'SmallTest': None},374            'method': 'testMethod1',375          },376          {377            'annotations': {'MediumTest': None},378            'method': 'testMethod2',379          },380        ],381      },382      {383        'annotations': {'Feature': {'value': ['Bar']}},384        'class': 'org.chromium.test.SampleTest2',385        'superclass': 'java.lang.Object',386        'methods': [387          {388            'annotations': {'SmallTest': None},389            'method': 'testMethod1',390          },391        ],392      }393    ]394    expected_tests = [395      {396        'annotations': {397          'Feature': {'value': ['Foo']},398          'SmallTest': None,399        },400        'class': 'org.chromium.test.SampleTest',401        'is_junit4': True,402        'method': 'testMethod1',403      },404      {405        'annotations': {406          'Feature': {'value': ['Bar']},407          'SmallTest': None,408        },409        'class': 'org.chromium.test.SampleTest2',410        'is_junit4': True,411        'method': 'testMethod1',412      },413    ]414    o._annotations = [('SmallTest', None)]415    o._test_jar = 'path/to/test.jar'416    o._junit4_runner_class = 'J4Runner'417    actual_tests = o.ProcessRawTests(raw_tests)418    self.assertEquals(actual_tests, expected_tests)419  def testGetTests_excludedAnnotationFilter(self):420    o = self.createTestInstance()421    raw_tests = [422      {423        'annotations': {'Feature': {'value': ['Foo']}},424        'class': 'org.chromium.test.SampleTest',425        'superclass': 'junit.framework.TestCase',426        'methods': [427          {428            'annotations': {'SmallTest': None},429            'method': 'testMethod1',430          },431          {432            'annotations': {'MediumTest': None},433            'method': 'testMethod2',434          },435        ],436      },437      {438        'annotations': {'Feature': {'value': ['Bar']}},439        'class': 'org.chromium.test.SampleTest2',440        'superclass': 'junit.framework.TestCase',441        'methods': [442          {443            'annotations': {'SmallTest': None},444            'method': 'testMethod1',445          },446        ],447      }448    ]449    expected_tests = [450      {451        'annotations': {452          'Feature': {'value': ['Foo']},453          'MediumTest': None,454        },455        'class': 'org.chromium.test.SampleTest',456        'is_junit4': False,457        'method': 'testMethod2',458      },459    ]460    o._excluded_annotations = [('SmallTest', None)]461    o._test_jar = 'path/to/test.jar'462    o._junit4_runner_class = 'J4Runner'463    actual_tests = o.ProcessRawTests(raw_tests)464    self.assertEquals(actual_tests, expected_tests)465  def testGetTests_annotationSimpleValueFilter(self):466    o = self.createTestInstance()467    raw_tests = [468      {469        'annotations': {'Feature': {'value': ['Foo']}},470        'class': 'org.chromium.test.SampleTest',471        'superclass': 'junit.framework.TestCase',472        'methods': [473          {474            'annotations': {475              'SmallTest': None,476              'TestValue': '1',477            },478            'method': 'testMethod1',479          },480          {481            'annotations': {482              'MediumTest': None,483              'TestValue': '2',484            },485            'method': 'testMethod2',486          },487        ],488      },489      {490        'annotations': {'Feature': {'value': ['Bar']}},491        'class': 'org.chromium.test.SampleTest2',492        'superclass': 'junit.framework.TestCase',493        'methods': [494          {495            'annotations': {496              'SmallTest': None,497              'TestValue': '3',498            },499            'method': 'testMethod1',500          },501        ],502      }503    ]504    expected_tests = [505      {506        'annotations': {507          'Feature': {'value': ['Foo']},508          'SmallTest': None,509          'TestValue': '1',510        },511        'class': 'org.chromium.test.SampleTest',512        'is_junit4': False,513        'method': 'testMethod1',514      },515    ]516    o._annotations = [('TestValue', '1')]517    o._test_jar = 'path/to/test.jar'518    o._junit4_runner_class = 'J4Runner'519    actual_tests = o.ProcessRawTests(raw_tests)520    self.assertEquals(actual_tests, expected_tests)521  def testGetTests_annotationDictValueFilter(self):522    o = self.createTestInstance()523    raw_tests = [524      {525        'annotations': {'Feature': {'value': ['Foo']}},526        'class': 'org.chromium.test.SampleTest',527        'superclass': 'java.lang.Object',528        'methods': [529          {530            'annotations': {'SmallTest': None},531            'method': 'testMethod1',532          },533          {534            'annotations': {'MediumTest': None},535            'method': 'testMethod2',536          },537        ],538      },539      {540        'annotations': {'Feature': {'value': ['Bar']}},541        'class': 'org.chromium.test.SampleTest2',542        'superclass': 'java.lang.Object',543        'methods': [544          {545            'annotations': {'SmallTest': None},546            'method': 'testMethod1',547          },548        ],549      }550    ]551    expected_tests = [552      {553        'annotations': {554          'Feature': {'value': ['Bar']},555          'SmallTest': None,556        },557        'class': 'org.chromium.test.SampleTest2',558        'is_junit4': True,559        'method': 'testMethod1',560      },561    ]562    o._annotations = [('Feature', 'Bar')]563    o._test_jar = 'path/to/test.jar'564    o._junit4_runner_class = 'J4Runner'565    actual_tests = o.ProcessRawTests(raw_tests)566    self.assertEquals(actual_tests, expected_tests)567  def testGetTestName(self):568    test = {569      'annotations': {570        'RunWith': {'value': 'class J4Runner'},571        'SmallTest': {},572        'Test': {'expected': 'class org.junit.Test$None',573                 'timeout': '0'},574                 'UiThreadTest': {}},575      'class': 'org.chromium.TestA',576      'is_junit4': True,577      'method': 'testSimple'}578    unqualified_class_test = {579      'class': test['class'].split('.')[-1],580      'method': test['method']581    }582    self.assertEquals(583        instrumentation_test_instance.GetTestName(test, sep='.'),584        'org.chromium.TestA.testSimple')585    self.assertEquals(586        instrumentation_test_instance.GetTestName(587            unqualified_class_test, sep='.'),588        'TestA.testSimple')589  def testGetUniqueTestName(self):590    test = {591      'annotations': {592        'RunWith': {'value': 'class J4Runner'},593        'SmallTest': {},594        'Test': {'expected': 'class org.junit.Test$None', 'timeout': '0'},595                 'UiThreadTest': {}},596      'class': 'org.chromium.TestA',597      'flags': ['enable_features=abc'],598      'is_junit4': True,599      'method': 'testSimple'}600    self.assertEquals(601        instrumentation_test_instance.GetUniqueTestName(602            test, sep='.'),603        'org.chromium.TestA.testSimple_with_enable_features=abc')604  def testGetTestNameWithoutParameterPostfix(self):605    test = {606      'annotations': {607        'RunWith': {'value': 'class J4Runner'},608        'SmallTest': {},609        'Test': {'expected': 'class org.junit.Test$None', 'timeout': '0'},610                 'UiThreadTest': {}},611      'class': 'org.chromium.TestA__sandbox_mode',612      'flags': 'enable_features=abc',613      'is_junit4': True,614      'method': 'testSimple'}615    unqualified_class_test = {616      'class': test['class'].split('.')[-1],617      'method': test['method']618    }619    self.assertEquals(620        instrumentation_test_instance.GetTestNameWithoutParameterPostfix(621            test, sep='.'),622        'org.chromium.TestA')623    self.assertEquals(624        instrumentation_test_instance.GetTestNameWithoutParameterPostfix(625            unqualified_class_test, sep='.'),626        'TestA')627  def testGetTests_multipleAnnotationValuesRequested(self):628    o = self.createTestInstance()629    raw_tests = [630      {631        'annotations': {'Feature': {'value': ['Foo']}},632        'class': 'org.chromium.test.SampleTest',633        'superclass': 'junit.framework.TestCase',634        'methods': [635          {636            'annotations': {'SmallTest': None},637            'method': 'testMethod1',638          },639          {640            'annotations': {641              'Feature': {'value': ['Baz']},642              'MediumTest': None,643            },644            'method': 'testMethod2',645          },646        ],647      },648      {649        'annotations': {'Feature': {'value': ['Bar']}},650        'class': 'org.chromium.test.SampleTest2',651        'superclass': 'junit.framework.TestCase',652        'methods': [653          {654            'annotations': {'SmallTest': None},655            'method': 'testMethod1',656          },657        ],658      }659    ]660    expected_tests = [661      {662        'annotations': {663          'Feature': {'value': ['Baz']},664          'MediumTest': None,665        },666        'class': 'org.chromium.test.SampleTest',667        'is_junit4': False,668        'method': 'testMethod2',669      },670      {671        'annotations': {672          'Feature': {'value': ['Bar']},673          'SmallTest': None,674        },675        'class': 'org.chromium.test.SampleTest2',676        'is_junit4': False,677        'method': 'testMethod1',678      },679    ]680    o._annotations = [('Feature', 'Bar'), ('Feature', 'Baz')]681    o._test_jar = 'path/to/test.jar'682    o._junit4_runner_class = 'J4Runner'683    actual_tests = o.ProcessRawTests(raw_tests)684    self.assertEquals(actual_tests, expected_tests)685  def testGenerateTestResults_noStatus(self):686    results = instrumentation_test_instance.GenerateTestResults(687        None, None, [], 0, 1000, None, None)688    self.assertEqual([], results)689  def testGenerateTestResults_testPassed(self):690    statuses = [691      (1, {692        'class': 'test.package.TestClass',693        'test': 'testMethod',694      }),695      (0, {696        'class': 'test.package.TestClass',697        'test': 'testMethod',698      }),699    ]700    results = instrumentation_test_instance.GenerateTestResults(701        None, None, statuses, 0, 1000, None, None)702    self.assertEqual(1, len(results))703    self.assertEqual(base_test_result.ResultType.PASS, results[0].GetType())704  def testGenerateTestResults_testSkipped_true(self):705    statuses = [706      (1, {707        'class': 'test.package.TestClass',708        'test': 'testMethod',709      }),710      (0, {711        'test_skipped': 'true',712        'class': 'test.package.TestClass',713        'test': 'testMethod',714      }),715      (0, {716        'class': 'test.package.TestClass',717        'test': 'testMethod',718      }),719    ]720    results = instrumentation_test_instance.GenerateTestResults(721        None, None, statuses, 0, 1000, None, None)722    self.assertEqual(1, len(results))723    self.assertEqual(base_test_result.ResultType.SKIP, results[0].GetType())724  def testGenerateTestResults_testSkipped_false(self):725    statuses = [726      (1, {727        'class': 'test.package.TestClass',728        'test': 'testMethod',729      }),730      (0, {731        'test_skipped': 'false',732      }),733      (0, {734        'class': 'test.package.TestClass',735        'test': 'testMethod',736      }),737    ]738    results = instrumentation_test_instance.GenerateTestResults(739        None, None, statuses, 0, 1000, None, None)740    self.assertEqual(1, len(results))741    self.assertEqual(base_test_result.ResultType.PASS, results[0].GetType())742  def testGenerateTestResults_testFailed(self):743    statuses = [744      (1, {745        'class': 'test.package.TestClass',746        'test': 'testMethod',747      }),748      (-2, {749        'class': 'test.package.TestClass',750        'test': 'testMethod',751      }),752    ]753    results = instrumentation_test_instance.GenerateTestResults(754        None, None, statuses, 0, 1000, None, None)755    self.assertEqual(1, len(results))756    self.assertEqual(base_test_result.ResultType.FAIL, results[0].GetType())757  def testGenerateTestResults_testUnknownException(self):758    stacktrace = 'long\nstacktrace'759    statuses = [760      (1, {761        'class': 'test.package.TestClass',762        'test': 'testMethod',763      }),764      (-1, {765        'class': 'test.package.TestClass',766        'test': 'testMethod',767        'stack': stacktrace,768      }),769    ]770    results = instrumentation_test_instance.GenerateTestResults(771        None, None, statuses, 0, 1000, None, None)772    self.assertEqual(1, len(results))773    self.assertEqual(base_test_result.ResultType.FAIL, results[0].GetType())774    self.assertEqual(stacktrace, results[0].GetLog())775  def testGenerateJUnitTestResults_testSkipped_true(self):776    statuses = [777      (1, {778        'class': 'test.package.TestClass',779        'test': 'testMethod',780      }),781      (-3, {782        'class': 'test.package.TestClass',783        'test': 'testMethod',784      }),785    ]786    results = instrumentation_test_instance.GenerateTestResults(787        None, None, statuses, 0, 1000, None, None)788    self.assertEqual(1, len(results))789    self.assertEqual(base_test_result.ResultType.SKIP, results[0].GetType())790  def testParameterizedCommandLineFlagsSwitches(self):791    o = self.createTestInstance()792    raw_tests = [{793        'annotations': {794            'ParameterizedCommandLineFlags$Switches': {795                'value': ['enable-features=abc', 'enable-features=def']796            }797        },798        'class':799        'org.chromium.test.SampleTest',800        'superclass':801        'java.lang.Object',802        'methods': [803            {804                'annotations': {805                    'SmallTest': None806                },807                'method': 'testMethod1',808            },809            {810                'annotations': {811                    'MediumTest': None,812                    'ParameterizedCommandLineFlags$Switches': {813                        'value': ['enable-features=ghi', 'enable-features=jkl']814                    },815                },816                'method': 'testMethod2',817            },818            {819                'annotations': {820                    'MediumTest': None,821                    'ParameterizedCommandLineFlags$Switches': {822                        'value': []823                    },824                },825                'method': 'testMethod3',826            },827            {828                'annotations': {829                    'MediumTest': None,830                    'SkipCommandLineParameterization': None,831                },832                'method': 'testMethod4',833            },834        ],835    }]836    expected_tests = [837        {838            'annotations': {},839            'class': 'org.chromium.test.SampleTest',840            'flags': ['--enable-features=abc', '--enable-features=def'],841            'is_junit4': True,842            'method': 'testMethod1'843        },844        {845            'annotations': {},846            'class': 'org.chromium.test.SampleTest',847            'flags': ['--enable-features=ghi', '--enable-features=jkl'],848            'is_junit4': True,849            'method': 'testMethod2'850        },851        {852            'annotations': {},853            'class': 'org.chromium.test.SampleTest',854            'is_junit4': True,855            'method': 'testMethod3'856        },857        {858            'annotations': {},859            'class': 'org.chromium.test.SampleTest',860            'is_junit4': True,861            'method': 'testMethod4'862        },863    ]864    for i in range(4):865      expected_tests[i]['annotations'].update(raw_tests[0]['annotations'])866      expected_tests[i]['annotations'].update(867          raw_tests[0]['methods'][i]['annotations'])868    o._test_jar = 'path/to/test.jar'869    o._junit4_runner_class = 'J4Runner'870    actual_tests = o.ProcessRawTests(raw_tests)871    self.assertEquals(actual_tests, expected_tests)872  def testParameterizedCommandLineFlags(self):873    o = self.createTestInstance()874    raw_tests = [{875        'annotations': {876            'ParameterizedCommandLineFlags': {877                'value': [878                    {879                        'ParameterizedCommandLineFlags$Switches': {880                            'value': [881                                'enable-features=abc',882                                'force-fieldtrials=trial/group'883                            ],884                        }885                    },886                    {887                        'ParameterizedCommandLineFlags$Switches': {888                            'value': [889                                'enable-features=abc2',890                                'force-fieldtrials=trial/group2'891                            ],892                        }893                    },894                ],895            },896        },897        'class':898        'org.chromium.test.SampleTest',899        'superclass':900        'java.lang.Object',901        'methods': [902            {903                'annotations': {904                    'SmallTest': None905                },906                'method': 'testMethod1',907            },908            {909                'annotations': {910                    'MediumTest': None,911                    'ParameterizedCommandLineFlags': {912                        'value': [{913                            'ParameterizedCommandLineFlags$Switches': {914                                'value': ['enable-features=def']915                            }916                        }],917                    },918                },919                'method': 'testMethod2',920            },921            {922                'annotations': {923                    'MediumTest': None,924                    'ParameterizedCommandLineFlags': {925                        'value': [],926                    },927                },928                'method': 'testMethod3',929            },930            {931                'annotations': {932                    'MediumTest': None,933                    'SkipCommandLineParameterization': None,934                },935                'method': 'testMethod4',936            },937        ],938    }]939    expected_tests = [940        {941            'annotations': {},942            'class': 'org.chromium.test.SampleTest',943            'flags':944            ['--enable-features=abc', '--force-fieldtrials=trial/group'],945            'is_junit4': True,946            'method': 'testMethod1'947        },948        {949            'annotations': {},950            'class': 'org.chromium.test.SampleTest',951            'flags': ['--enable-features=def'],952            'is_junit4': True,953            'method': 'testMethod2'954        },955        {956            'annotations': {},957            'class': 'org.chromium.test.SampleTest',958            'is_junit4': True,959            'method': 'testMethod3'960        },961        {962            'annotations': {},963            'class': 'org.chromium.test.SampleTest',964            'is_junit4': True,965            'method': 'testMethod4'966        },967        {968            'annotations': {},969            'class':970            'org.chromium.test.SampleTest',971            'flags': [972                '--enable-features=abc2',973                '--force-fieldtrials=trial/group2',974            ],975            'is_junit4':976            True,977            'method':978            'testMethod1'979        },980    ]981    for i in range(4):982      expected_tests[i]['annotations'].update(raw_tests[0]['annotations'])983      expected_tests[i]['annotations'].update(984          raw_tests[0]['methods'][i]['annotations'])985    expected_tests[4]['annotations'].update(raw_tests[0]['annotations'])986    expected_tests[4]['annotations'].update(987        raw_tests[0]['methods'][0]['annotations'])988    o._test_jar = 'path/to/test.jar'989    o._junit4_runner_class = 'J4Runner'990    actual_tests = o.ProcessRawTests(raw_tests)991    self.assertEquals(actual_tests, expected_tests)992  def testDifferentCommandLineParameterizations(self):993    o = self.createTestInstance()994    raw_tests = [{995        'annotations': {},996        'class':997        'org.chromium.test.SampleTest',998        'superclass':999        'java.lang.Object',1000        'methods': [1001            {1002                'annotations': {1003                    'SmallTest': None,1004                    'ParameterizedCommandLineFlags': {1005                        'value': [1006                            {1007                                'ParameterizedCommandLineFlags$Switches': {1008                                    'value': ['a1', 'a2'],1009                                }1010                            },1011                        ],1012                    },1013                },1014                'method': 'testMethod2',1015            },1016            {1017                'annotations': {1018                    'SmallTest': None,1019                    'ParameterizedCommandLineFlags$Switches': {1020                        'value': ['b1', 'b2'],1021                    },1022                },1023                'method': 'testMethod3',1024            },1025        ],1026    }]1027    expected_tests = [1028        {1029            'annotations': {},1030            'class': 'org.chromium.test.SampleTest',1031            'flags': ['--a1', '--a2'],1032            'is_junit4': True,1033            'method': 'testMethod2'1034        },1035        {1036            'annotations': {},1037            'class': 'org.chromium.test.SampleTest',1038            'flags': ['--b1', '--b2'],1039            'is_junit4': True,1040            'method': 'testMethod3'1041        },1042    ]1043    for i in range(2):1044      expected_tests[i]['annotations'].update(1045          raw_tests[0]['methods'][i]['annotations'])1046    o._test_jar = 'path/to/test.jar'1047    o._junit4_runner_class = 'J4Runner'1048    actual_tests = o.ProcessRawTests(raw_tests)1049    self.assertEquals(actual_tests, expected_tests)1050  def testMultipleCommandLineParameterizations_raises(self):1051    o = self.createTestInstance()1052    raw_tests = [1053        {1054            'annotations': {1055                'ParameterizedCommandLineFlags': {1056                    'value': [1057                        {1058                            'ParameterizedCommandLineFlags$Switches': {1059                                'value': [1060                                    'enable-features=abc',1061                                    'force-fieldtrials=trial/group',1062                                ],1063                            }1064                        },1065                    ],1066                },1067            },1068            'class':1069            'org.chromium.test.SampleTest',1070            'superclass':1071            'java.lang.Object',1072            'methods': [1073                {1074                    'annotations': {1075                        'SmallTest': None,1076                        'ParameterizedCommandLineFlags$Switches': {1077                            'value': [1078                                'enable-features=abc',1079                                'force-fieldtrials=trial/group',1080                            ],1081                        },1082                    },1083                    'method': 'testMethod1',1084                },1085            ],1086        },1087    ]1088    o._test_jar = 'path/to/test.jar'1089    o._junit4_runner_class = 'J4Runner'1090    self.assertRaises(1091        instrumentation_test_instance.CommandLineParameterizationException,1092        o.ProcessRawTests, [raw_tests[0]])1093if __name__ == '__main__':...write_to_csv.py
Source:write_to_csv.py  
1import json2APP_NAME="reactorx_cloud"3test_app_version="hello-regression-master"4DASHBOARD_URL = "http://dinobot.xyz.mno.com/summary/{}/{}".format(str(APP_NAME), str(test_app_version))5def create_csv_file_from_test_mapping(mapping_array, test_app_version):6    print((json.dumps(mapping_array)))7    with open("tests_mapping.csv", 'a') as f:8        f.write("SL_NO,TEST_FILE,EXPECTED_TESTS,ACTUAL_TESTS,DURATION\n")9        strng = ",TEST_APP_VERSION,{},,\n".format(test_app_version)10        f.write(strng)11        count = 112        fail_count = 013        total_actual_count = 014        total_expected_count = 015        complete_test_path = ""16        for item in mapping_array:17            full_path = item['full_path']18            total_expected_count = int(item["expected_tests"]) + total_expected_count19            total_actual_count = int(item["actual_tests"]) + total_actual_count20            if total_actual_count != total_expected_count:21                complete_test_path += full_path + ","22                fail_count += 123            f.write(24                str(count) + "," + item["test_file"] + "," + item["expected_tests"] + "," + item["actual_tests"] + "," +25                item["duration"] + "\n")26            count = count + 127        complete_test_path = complete_test_path[:-1]28        print("##################################")29        print("Failed Tests Path for Re Execution")30        print(complete_test_path)31        print("##################################")32        dashboard_link = "<a href=\"" + DASHBOARD_URL + "\">dashboard_link</a>"33        strng=",TEST DASHBOARD URL,,," + dashboard_link + "\n"34        f.write(strng)35        strng=",RE EXECUTE TESTS COUNT,,," + str(fail_count) + "\n"36        f.write(strng)37mapping_array=[{"test_file": "test_can_addressing_run_re_snapper_with_hla_primary_for_address_rx_cloud.py", "full_path": "rx_cloud_tests/CAN/test_can_addressing_run_re_snapper_with_hla_primary_for_address_rx_cloud.py", "expected_tests": "0", "actual_tests": "0", "duration": "0"}, {"test_file": "test_can_addressing_snapper__hla_multiple_repo_rx_cloud.py", "full_path": "rx_cloud_tests/CAN/test_can_addressing_snapper__hla_multiple_repo_rx_cloud.py", "expected_tests": "0", "actual_tests": "0", "duration": "0"}, {"test_file": "test_can_autofix_rx_cloud.py", "full_path": "rx_cloud_tests/CAN/test_can_autofix_rx_cloud.py", "expected_tests": "0", "actual_tests": "0", "duration": "0"}, {"test_file": "test_can_in-place_repo_clean_rx_cloud.py", "full_path": "rx_cloud_tests/CAN/test_can_in-place_repo_clean_rx_cloud.py", "expected_tests": "0", "actual_tests": "0", "duration": "0"}, {"test_file": "test_can_layer_alignment__build_region_rx_cloud.py", "full_path": "rx_cloud_tests/CAN/test_can_layer_alignment__build_region_rx_cloud.py", "expected_tests": "0", "actual_tests": "0", "duration": "0"}, {"test_file": "test_can_step_13_late_breaking_cleanup_rx_cloud.py", "full_path": "rx_cloud_tests/CAN/test_can_step_13_late_breaking_cleanup_rx_cloud.py", "expected_tests": "0", "actual_tests": "0", "duration": "0"}, {"test_file": "test_can_water__smoothening_fix_revert_todos_rx_cloud.py", "full_path": "rx_cloud_tests/CAN/test_can_water__smoothening_fix_revert_todos_rx_cloud.py", "expected_tests": "0", "actual_tests": "0", "duration": "0"}, {"test_file": "test_can_water__source_finishing_step_2_rx_cloud.py", "full_path": "rx_cloud_tests/CAN/test_can_water__source_finishing_step_2_rx_cloud.py", "expected_tests": "0", "actual_tests": "0", "duration": "0"}, {"test_file": "test_can_water_clean_up_add_missing_features_rx_cloud.py", "full_path": "rx_cloud_tests/CAN/test_can_water_clean_up_add_missing_features_rx_cloud.py", "expected_tests": "0", "actual_tests": "0", "duration": "0"}, {"test_file": "test_can_water_suppress_island_names_rx_cloud.py", "full_path": "rx_cloud_tests/CAN/test_can_water_suppress_island_names_rx_cloud.py", "expected_tests": "0", "actual_tests": "0", "duration": "0"}, {"test_file": "test_esp_addressing_schema_id_updater_rx_cloud.py", "full_path": "rx_cloud_tests/ESP/test_esp_addressing_schema_id_updater_rx_cloud.py", "expected_tests": "3", "actual_tests": "3", "duration": "0:34:51"}, {"test_file": "test_esp_territory_wikipedia_conflation_rx_cloud.py", "full_path": "rx_cloud_tests/ESP/test_esp_territory_wikipedia_conflation_rx_cloud.py", "expected_tests": "8", "actual_tests": "8", "duration": "0:22:10"}, {"test_file": "test_gbr_addressing_postal_snapping_address_finalization_rx_cloud.py", "full_path": "rx_cloud_tests/GBR/test_gbr_addressing_postal_snapping_address_finalization_rx_cloud.py", "expected_tests": "3", "actual_tests": "3", "duration": "1:11:43"}, {"test_file": "test_gbr_addressing_re-snapper__hla_single_repo_rx_cloud.py", "full_path": "rx_cloud_tests/GBR/test_gbr_addressing_re-snapper__hla_single_repo_rx_cloud.py", "expected_tests": "0", "actual_tests": "0", "duration": "0"}, {"test_file": "test_gbr_clean_dr_waterbody_merge_and_rep_point_recalculation_rx_cloud.py", "full_path": "rx_cloud_tests/GBR/test_gbr_clean_dr_waterbody_merge_and_rep_point_recalculation_rx_cloud.py", "expected_tests": "0", "actual_tests": "0", "duration": "0"}, {"test_file": "test_gbr_clq_barrier_anomaly_todos_rx_cloud.py", "full_path": "rx_cloud_tests/GBR/test_gbr_clq_barrier_anomaly_todos_rx_cloud.py", "expected_tests": "0", "actual_tests": "0", "duration": "0"}, {"test_file": "test_gbr_clq_prioritize_ndm_route_vehicular_todos_rx_cloud.py", "full_path": "rx_cloud_tests/GBR/test_gbr_clq_prioritize_ndm_route_vehicular_todos_rx_cloud.py", "expected_tests": "0", "actual_tests": "0", "duration": "0"}, {"test_file": "test_gbr_country__subdivision_code_autofix_rx_cloud.py", "full_path": "rx_cloud_tests/GBR/test_gbr_country__subdivision_code_autofix_rx_cloud.py", "expected_tests": "0", "actual_tests": "0", "duration": "0"}, {"test_file": "test_gbr_display_class_driven_sampling_todos_on_roadsegments_rx_cloud.py", "full_path": "rx_cloud_tests/GBR/test_gbr_display_class_driven_sampling_todos_on_roadsegments_rx_cloud.py", "expected_tests": "0", "actual_tests": "0", "duration": "0"}, {"test_file": "test_gbr_display_class_driven_todos_on_roadsegments_rx_cloud.py", "full_path": "rx_cloud_tests/GBR/test_gbr_display_class_driven_todos_on_roadsegments_rx_cloud.py", "expected_tests": "0", "actual_tests": "0", "duration": "0"}, {"test_file": "test_gbr_prioritize_interval_change_driving_todosrx_cloud.py", "full_path": "rx_cloud_tests/GBR/test_gbr_prioritize_interval_change_driving_todosrx_cloud.py", "expected_tests": "0", "actual_tests": "0", "duration": "0"}, {"test_file": "test_gbr_prioritize_ndm_route_vehicular_todos_rx_cloud.py", "full_path": "rx_cloud_tests/GBR/test_gbr_prioritize_ndm_route_vehicular_todos_rx_cloud.py", "expected_tests": "0", "actual_tests": "0", "duration": "0"}, {"test_file": "test_gbr_territory_edits_generic_v2_rx_cloud.py", "full_path": "rx_cloud_tests/GBR/test_gbr_territory_edits_generic_v2_rx_cloud.py", "expected_tests": "0", "actual_tests": "0", "duration": "0"}, {"test_file": "test_gbr_water_clean_up_add_missing_features_rx_cloud.py", "full_path": "rx_cloud_tests/GBR/test_gbr_water_clean_up_add_missing_features_rx_cloud.py", "expected_tests": "0", "actual_tests": "0", "duration": "0"}, {"test_file": "test_ita_addressing_tiger_name_conflation_real_data_rx_cloud.py", "full_path": "rx_cloud_tests/ITA/test_ita_addressing_tiger_name_conflation_real_data_rx_cloud.py", "expected_tests": "12", "actual_tests": "12", "duration": "2:04:11"}, {"test_file": "test_ita_dc_reorg_row_geofixrx_cloud.py", "full_path": "rx_cloud_tests/ITA/test_ita_dc_reorg_row_geofixrx_cloud.py", "expected_tests": "0", "actual_tests": "0", "duration": "0"}, {"test_file": "test_can_addressing_access_point_v2_snapping_and_assimilator_rx_cloud.py", "full_path": "rx_cloud_tests/CAN/test_can_addressing_access_point_v2_snapping_and_assimilator_rx_cloud.py", "expected_tests": "3", "actual_tests": "0", "duration": "0"}, {"test_file": "test_can_addressing_address_range_conflation_rx_cloud.py", "full_path": "rx_cloud_tests/CAN/test_can_addressing_address_range_conflation_rx_cloud.py", "expected_tests": "3", "actual_tests": "0", "duration": "0"}, {"test_file": "test_can_addressing_address_range_interpolator_for_uk_rx_cloud.py", "full_path": "rx_cloud_tests/CAN/test_can_addressing_address_range_interpolator_for_uk_rx_cloud.py", "expected_tests": "3", "actual_tests": "0", "duration": "0"}, {"test_file": "test_can_addressing_clusterer_rx_cloud.py", "full_path": "rx_cloud_tests/CAN/test_can_addressing_clusterer_rx_cloud.py", "expected_tests": "3", "actual_tests": "0", "duration": "0"}, {"test_file": "test_can_addressing_copy_roads_to_dc_repo_rx_cloud.py", "full_path": "rx_cloud_tests/CAN/test_can_addressing_copy_roads_to_dc_repo_rx_cloud.py", "expected_tests": "3", "actual_tests": "0", "duration": "0"}, {"test_file": "test_can_addressing_validate_address_point_house_number_and_update_address_primary_road_rx_cloud.py", "full_path": "rx_cloud_tests/CAN/test_can_addressing_validate_address_point_house_number_and_update_address_primary_road_rx_cloud.py", "expected_tests": "3", "actual_tests": "0", "duration": "0"}, {"test_file": "test_can_adhoc_create_tickets_from_hdfs_todos_rx_cloud.py", "full_path": "rx_cloud_tests/CAN/test_can_adhoc_create_tickets_from_hdfs_todos_rx_cloud.py", "expected_tests": "3", "actual_tests": "0", "duration": "0"}, {"test_file": "test_can_clean_dr_waterbody_merge_and_rep_point_recalculation_rx_cloud.py", "full_path": "rx_cloud_tests/CAN/test_can_clean_dr_waterbody_merge_and_rep_point_recalculation_rx_cloud.py", "expected_tests": "3", "actual_tests": "0", "duration": "0"}, {"test_file": "test_can_meta_acceptance_random_todo_sampler_rx_cloud.py", "full_path": "rx_cloud_tests/CAN/test_can_meta_acceptance_random_todo_sampler_rx_cloud.py", "expected_tests": "3", "actual_tests": "0", "duration": "0"}, {"test_file": "test_can_pedxing_restrict_crossing_on_high_speed_segments_rx_cloud.py", "full_path": "rx_cloud_tests/CAN/test_can_pedxing_restrict_crossing_on_high_speed_segments_rx_cloud.py", "expected_tests": "3", "actual_tests": "0", "duration": "0"}, {"test_file": "test_can_terminal_use_for_regular_roads_rx_cloud.py", "full_path": "rx_cloud_tests/CAN/test_can_terminal_use_for_regular_roads_rx_cloud.py", "expected_tests": "3", "actual_tests": "0", "duration": "0"}, {"test_file": "test_can_terminal_use_on_terminal_fow_rungs_rx_cloud.py", "full_path": "rx_cloud_tests/CAN/test_can_terminal_use_on_terminal_fow_rungs_rx_cloud.py", "expected_tests": "3", "actual_tests": "0", "duration": "0"}, {"test_file": "test_can_traffic_control_ingest_rx_cloud.py", "full_path": "rx_cloud_tests/CAN/test_can_traffic_control_ingest_rx_cloud.py", "expected_tests": "3", "actual_tests": "0", "duration": "0"}, {"test_file": "test_can_water_batch1_rx_cloud.py", "full_path": "rx_cloud_tests/CAN/test_can_water_batch1_rx_cloud.py", "expected_tests": "3", "actual_tests": "0", "duration": "0"}, {"test_file": "test_can_water_name_and_language_cleanup_rx_cloud.py", "full_path": "rx_cloud_tests/CAN/test_can_water_name_and_language_cleanup_rx_cloud.py", "expected_tests": "3", "actual_tests": "0", "duration": "0"}, {"test_file": "test_can_water_source_finishing_merge_batch_3_rx_cloud.py", "full_path": "rx_cloud_tests/CAN/test_can_water_source_finishing_merge_batch_3_rx_cloud.py", "expected_tests": "3", "actual_tests": "0", "duration": "0"}, {"test_file": "test_can_water_source_finishing_step_3_rx_cloud.py", "full_path": "rx_cloud_tests/CAN/test_can_water_source_finishing_step_3_rx_cloud.py", "expected_tests": "3", "actual_tests": "0", "duration": "0"}, {"test_file": "test_can_water_source_prep_post_process_rx_cloud.py", "full_path": "rx_cloud_tests/CAN/test_can_water_source_prep_post_process_rx_cloud.py", "expected_tests": "3", "actual_tests": "0", "duration": "0"}, {"test_file": "test_rx_cloud_deu_addressing_source_prep_real_data.py", "full_path": "rx_cloud_tests/DEU/test_rx_cloud_deu_addressing_source_prep_real_data.py", "expected_tests": "8", "actual_tests": "0", "duration": "0"}, {"test_file": "test_esp_create_todos_from_athena_query_rx_cloud.py", "full_path": "rx_cloud_tests/ESP/test_esp_create_todos_from_athena_query_rx_cloud.py", "expected_tests": "3", "actual_tests": "0", "duration": "0"}, {"test_file": "test_esp_deployment_region_repo_clean_up_rx_cloud.py", "full_path": "rx_cloud_tests/ESP/test_esp_deployment_region_repo_clean_up_rx_cloud.py", "expected_tests": "3", "actual_tests": "0", "duration": "0"}, {"test_file": "test_esp_naming_identify_road_name_self_intersection_rx_cloud.py", "full_path": "rx_cloud_tests/ESP/test_esp_naming_identify_road_name_self_intersection_rx_cloud.py", "expected_tests": "3", "actual_tests": "0", "duration": "0"}, {"test_file": "test_esp_territory_edits_generic_rx_cloud.py", "full_path": "rx_cloud_tests/ESP/test_esp_territory_edits_generic_rx_cloud.py", "expected_tests": "8", "actual_tests": "0", "duration": "0"}, {"test_file": "test_esp_territory_edits_rx_cloud.py", "full_path": "rx_cloud_tests/ESP/test_esp_territory_edits_rx_cloud.py", "expected_tests": "8", "actual_tests": "0", "duration": "0"}, {"test_file": "test_gbr_addressing_address_area_reextracting_rx_cloud.py", "full_path": "rx_cloud_tests/GBR/test_gbr_addressing_address_area_reextracting_rx_cloud.py", "expected_tests": "3", "actual_tests": "0", "duration": "0"}, {"test_file": "test_gbr_addressing_schema_id_updater_rx_cloud.py", "full_path": "rx_cloud_tests/GBR/test_gbr_addressing_schema_id_updater_rx_cloud.py", "expected_tests": "3", "actual_tests": "0", "duration": "0"}, {"test_file": "test_gbr_addressing_snapper__hla_multiple_repo_rx_cloud.py", "full_path": "rx_cloud_tests/GBR/test_gbr_addressing_snapper__hla_multiple_repo_rx_cloud.py", "expected_tests": "3", "actual_tests": "0", "duration": "0"}, {"test_file": "test_gbr_addressing_tiger_name_conflation_real_data_rx_cloud.py", "full_path": "rx_cloud_tests/GBR/test_gbr_addressing_tiger_name_conflation_real_data_rx_cloud.py", "expected_tests": "12", "actual_tests": "0", "duration": "0"}, {"test_file": "test_gbr_addressing_validate_address_point_house_number_and_update_address_primary_road_rx_cloud.py", "full_path": "rx_cloud_tests/GBR/test_gbr_addressing_validate_address_point_house_number_and_update_address_primary_road_rx_cloud.py", "expected_tests": "3", "actual_tests": "0", "duration": "0"}, {"test_file": "test_gbr_autofix_rx_cloud.py", "full_path": "rx_cloud_tests/GBR/test_gbr_autofix_rx_cloud.py", "expected_tests": "3", "actual_tests": "0", "duration": "0"}, {"test_file": "test_gbr_clq_create_todos_for_aoi_category_rx_cloud.py", "full_path": "rx_cloud_tests/GBR/test_gbr_clq_create_todos_for_aoi_category_rx_cloud.py", "expected_tests": "3", "actual_tests": "0", "duration": "0"}, {"test_file": "test_gbr_clq_prioritize_interval_change_driving_todosrx_cloud.py", "full_path": "rx_cloud_tests/GBR/test_gbr_clq_prioritize_interval_change_driving_todosrx_cloud.py", "expected_tests": "3", "actual_tests": "0", "duration": "0"}, {"test_file": "test_gbr_clq_walkability_nulls_in_urban_polygons_rx_cloud.py", "full_path": "rx_cloud_tests/GBR/test_gbr_clq_walkability_nulls_in_urban_polygons_rx_cloud.py", "expected_tests": "3", "actual_tests": "0", "duration": "0"}, {"test_file": "test_gbr_meta_acceptance_random_todo_sampler_rx_cloud.py", "full_path": "rx_cloud_tests/GBR/test_gbr_meta_acceptance_random_todo_sampler_rx_cloud.py", "expected_tests": "3", "actual_tests": "0", "duration": "0"}, {"test_file": "test_gbr_naming_identify_road_name_self_intersection_real_data_rx_cloud.py", "full_path": "rx_cloud_tests/GBR/test_gbr_naming_identify_road_name_self_intersection_real_data_rx_cloud.py", "expected_tests": "8", "actual_tests": "0", "duration": "0"}, {"test_file": "test_gbr_nightly_pro-active_alignment_rx_cloud.py", "full_path": "rx_cloud_tests/GBR/test_gbr_nightly_pro-active_alignment_rx_cloud.py", "expected_tests": "3", "actual_tests": "0", "duration": "0"}, {"test_file": "test_gbr_spinner_autofix_rx_cloud.py", "full_path": "rx_cloud_tests/GBR/test_gbr_spinner_autofix_rx_cloud.py", "expected_tests": "3", "actual_tests": "0", "duration": "0"}, {"test_file": "test_gbr_territory_assets_conflation_rx_cloud.py", "full_path": "rx_cloud_tests/GBR/test_gbr_territory_assets_conflation_rx_cloud.py", "expected_tests": "8", "actual_tests": "0", "duration": "0"}, {"test_file": "test_gbr_territory_edits_generic_rx_cloud.py", "full_path": "rx_cloud_tests/GBR/test_gbr_territory_edits_generic_rx_cloud.py", "expected_tests": "8", "actual_tests": "0", "duration": "0"}, {"test_file": "test_irl_addressing_clusterer_rx_cloud.py", "full_path": "rx_cloud_tests/IRL/test_irl_addressing_clusterer_rx_cloud.py", "expected_tests": "3", "actual_tests": "0", "duration": "0"}, {"test_file": "test_irl_addressing_interpolator_and_verifier_with_poi_for_uk_rx_cloud.py", "full_path": "rx_cloud_tests/IRL/test_irl_addressing_interpolator_and_verifier_with_poi_for_uk_rx_cloud.py", "expected_tests": "3", "actual_tests": "0", "duration": "0"}, {"test_file": "test_irl_addressing_snapper__hla_multiple_repo_rx_cloud.py", "full_path": "rx_cloud_tests/IRL/test_irl_addressing_snapper__hla_multiple_repo_rx_cloud.py", "expected_tests": "3", "actual_tests": "0", "duration": "0"}, {"test_file": "test_prt_set_default_speedlimit_rx_cloud.py", "full_path": "rx_cloud_tests/PRT/test_prt_set_default_speedlimit_rx_cloud.py", "expected_tests": "3", "actual_tests": "0", "duration": "0"}]38#print(mapping_array)...Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!
