Commit 44d6824e authored by Rakib M. Hasan's avatar Rakib M. Hasan Committed by Commit Bot

gpu_tests: Remove GenerateTags function

GenerateTags is no longer called on the telemetry side. The telemetry
CL that removes the use of this function is crrev.com/c/1769732.

Bug: 992260
Change-Id: Ie511df5d4fd1c604d68f2732eb7b6a3718221e43
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2261146
Commit-Queue: Rakib Hasan <rmhasan@google.com>
Reviewed-by: default avatarBrian Sheedy <bsheedy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#782640}
parent 4a62726f
...@@ -398,18 +398,6 @@ class GpuIntegrationTest( ...@@ -398,18 +398,6 @@ class GpuIntegrationTest(
return config return config
@classmethod
def GenerateTags(cls, finder_options, possible_browser):
# If no expectations file paths are returned from cls.ExpectationsFiles()
# then an empty list will be returned from this function. If tags are
# returned and there are no expectations files, then Typ will raise
# an exception.
if not cls.ExpectationsFiles():
return []
with possible_browser.BrowserSession(
finder_options.browser_options) as browser:
return cls.GetPlatformTags(browser)
@classmethod @classmethod
def GetPlatformTags(cls, browser): def GetPlatformTags(cls, browser):
"""This function will take a Browser instance as an argument. """This function will take a Browser instance as an argument.
......
...@@ -63,15 +63,12 @@ def _GetSystemInfo(gpu='', ...@@ -63,15 +63,12 @@ def _GetSystemInfo(gpu='',
return system_info.SystemInfo.FromDict(sys_info) return system_info.SystemInfo.FromDict(sys_info)
def _GetTagsToTest(browser, test_class=None, args=None): def _GetTagsToTest(browser, test_class=None):
test_class = test_class or gpu_integration_test.GpuIntegrationTest test_class = test_class or gpu_integration_test.GpuIntegrationTest
tags = None tags = None
with mock.patch.object( with mock.patch.object(
test_class, 'ExpectationsFiles', return_value=['exp.txt']): test_class, 'ExpectationsFiles', return_value=['exp.txt']):
possible_browser = fakes.FakePossibleBrowser() tags = set(test_class.GetPlatformTags(browser))
possible_browser._returned_browser = browser
args = args or gpu_helper.GetMockArgs()
tags = set(test_class.GenerateTags(args, possible_browser))
return tags return tags
...@@ -132,16 +129,6 @@ class GpuIntegrationTestUnittest(unittest.TestCase): ...@@ -132,16 +129,6 @@ class GpuIntegrationTestUnittest(unittest.TestCase):
self._RunGpuIntegrationTests('simple_integration_unittest') self._RunGpuIntegrationTests('simple_integration_unittest')
self.assertIn('expected_failure', self._test_result['tests']) self.assertIn('expected_failure', self._test_result['tests'])
def testWithoutExpectationsFilesGenerateTagsReturnsEmptyList(self):
# we need to make sure that GenerateTags() returns an empty list if
# there are no expectations files returned from ExpectationsFiles() or
# else Typ will raise an exception
args = gpu_helper.GetMockArgs()
possible_browser = mock.MagicMock()
self.assertFalse(
gpu_integration_test.GpuIntegrationTest.GenerateTags(
args, possible_browser))
def _TestTagGenerationForMockPlatform(self, test_class, args): def _TestTagGenerationForMockPlatform(self, test_class, args):
tag_set = _GenerateNvidiaExampleTagsForTestClassAndArgs(test_class, args) tag_set = _GenerateNvidiaExampleTagsForTestClassAndArgs(test_class, args)
self.assertTrue( self.assertTrue(
......
...@@ -37,13 +37,6 @@ class _BaseSampleIntegrationTest(gpu_integration_test.GpuIntegrationTest): ...@@ -37,13 +37,6 @@ class _BaseSampleIntegrationTest(gpu_integration_test.GpuIntegrationTest):
cls.SetBrowserOptions(cls._finder_options) cls.SetBrowserOptions(cls._finder_options)
cls.StartBrowser() cls.StartBrowser()
@classmethod
def GenerateTags(cls, possible_browser, finder_options):
# TODO(crbug.com/992260) Delete this after crrev.com/c/1769732 is merged.
# We should keep this for now so that a browser instance is not spawned
del possible_browser, finder_options
return []
@classmethod @classmethod
def AddCommandlineArgs(cls, parser): def AddCommandlineArgs(cls, parser):
super(_BaseSampleIntegrationTest, cls).AddCommandlineArgs(parser) super(_BaseSampleIntegrationTest, cls).AddCommandlineArgs(parser)
...@@ -200,14 +193,6 @@ class BrowserCrashAfterStartTest(_BaseSampleIntegrationTest): ...@@ -200,14 +193,6 @@ class BrowserCrashAfterStartTest(_BaseSampleIntegrationTest):
class RunTestsWithExpectationsFiles(_BaseSampleIntegrationTest): class RunTestsWithExpectationsFiles(_BaseSampleIntegrationTest):
_flaky_test_run = 0 _flaky_test_run = 0
@classmethod
def GenerateTags(cls, possible_browser, finder_options):
# TODO(crbug.com/992260) Delete this after crrev.com/c/1769732 is merged.
# We should keep this for now so that a browser instance is not spawned
del possible_browser, finder_options
return cls.GetPlatformTags(
fakes.FakeBrowser(fakes.FakeLinuxPlatform, 'debug'))
@classmethod @classmethod
def GetPlatformTags(cls, browser): def GetPlatformTags(cls, browser):
assert isinstance(browser, fakes.FakeBrowser) assert isinstance(browser, fakes.FakeBrowser)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment