Ejemplo n.º 1
0
 def test_cl_description_moves_noexport_tag(self):
     host = MockHost()
     host.executive = MockExecutive(output='Summary\n\nNo-Export: true\n\n')
     importer = TestImporter(host)
     description = importer._cl_description(directory_owners={})
     self.assertIn(
         'No-Export: true',
         description)
Ejemplo n.º 2
0
 def test_cl_description_moves_noexport_tag(self):
     host = MockHost()
     host.executive = MockExecutive(output='Summary\n\nNOEXPORT=true\n\n')
     importer = TestImporter(host)
     description = importer._cl_description(directory_owners={})
     self.assertEqual(description, ('Summary\n\n'
                                    '[email protected]\n'
                                    'NOEXPORT=true'))
Ejemplo n.º 3
0
 def test_cl_description_with_empty_environ(self):
     host = MockHost()
     host.executive = MockExecutive(output='Last commit message\n\n')
     importer = TestImporter(host)
     description = importer._cl_description(directory_owners={})
     self.assertEqual(description, ('Last commit message\n\n'
                                    '[email protected]\n'
                                    'NOEXPORT=true'))
     self.assertEqual(host.executive.calls,
                      [['git', 'log', '-1', '--format=%B']])
Ejemplo n.º 4
0
 def test_cl_description_with_environ_variables(self):
     host = MockHost()
     host.executive = MockExecutive(output='Last commit message\n')
     importer = TestImporter(host)
     importer.host.environ['BUILDBOT_MASTERNAME'] = 'my.master'
     importer.host.environ['BUILDBOT_BUILDERNAME'] = 'b'
     importer.host.environ['BUILDBOT_BUILDNUMBER'] = '123'
     description = importer._cl_description(directory_owners={})
     self.assertIn(
         'Build: https://build.chromium.org/p/my.master/builders/b/builds/123\n\n',
         description)
     self.assertEqual(host.executive.calls, [['git', 'log', '-1', '--format=%B']])
Ejemplo n.º 5
0
 def test_cl_description_with_directory_owners(self):
     host = MockHost()
     host.executive = MockExecutive(output='Last commit message\n\n')
     importer = TestImporter(host)
     description = importer._cl_description(directory_owners={
         ('*****@*****.**',): ['external/wpt/foo', 'external/wpt/bar'],
         ('*****@*****.**', '*****@*****.**'): ['external/wpt/baz'],
     })
     self.assertIn(
         'Directory owners for changes in this CL:\n'
         '[email protected]:\n'
         '  external/wpt/foo\n'
         '  external/wpt/bar\n'
         '[email protected], [email protected]:\n'
         '  external/wpt/baz\n\n',
         description)
Ejemplo n.º 6
0
 def test_cl_description_with_empty_environ(self):
     host = MockHost()
     host.executive = MockExecutive(output='Last commit message\n\n')
     importer = TestImporter(host)
     description = importer._cl_description(directory_owners={})
     self.assertEqual(
         description,
         'Last commit message\n\n'
         'Note to sheriffs: This CL imports external tests and adds\n'
         'expectations for those tests; if this CL is large and causes\n'
         'a few new failures, please fix the failures by adding new\n'
         'lines to TestExpectations rather than reverting. See:\n'
         'https://chromium.googlesource.com'
         '/chromium/src/+/master/docs/testing/web_platform_tests.md\n\n'
         'No-Export: true')
     self.assertEqual(host.executive.calls, [['git', 'log', '-1', '--format=%B']])
 def test_cl_description_with_empty_environ(self):
     host = MockHost()
     host.executive = MockExecutive(output='Last commit message\n\n')
     importer = TestImporter(host)
     description = importer._cl_description(directory_owners={})
     self.assertEqual(
         description,
         'Last commit message\n\n'
         'Background: https://chromium.googlesource.com/'
         'chromium/src/+/master/docs/testing/web_platform_tests.md\n\n'
         'Note to sheriffs: If this CL causes a small number of new layout\n'
         'test failures, it may be easier to add lines to TestExpectations\n'
         'rather than reverting.\n'
         '[email protected]\n'
         'NOEXPORT=true')
     self.assertEqual(host.executive.calls, [['git', 'log', '-1', '--format=%B']])