Merge "Ensure logging is checked by most tests"

This commit is contained in:
Jenkins 2016-11-16 10:00:05 +00:00 committed by Gerrit Code Review
commit 508409a43f
4 changed files with 16 additions and 0 deletions

View File

@ -134,6 +134,8 @@ class ImportCommand(LogDedentMixin, GitUpstreamCommand):
def execute(self):
self.log.info("Starting execution of import command")
import_upstream = ImportUpstream(
branch=self.args.branch,
upstream=self.args.real_upstream_branch,

View File

@ -64,6 +64,9 @@ class TestImportCommand(TestWithScenarios, BaseTestCase):
self.assertThat(self.logger.output,
Not(Contains("Successfully rebased and updated")))
self.assertThat(self.logger.output,
Contains("Starting execution of import command"))
# perform sanity checks on results
self._check_tree_state()

View File

@ -18,6 +18,7 @@ from pprint import pformat
from testscenarios import TestWithScenarios
from testtools.content import text_content
from testtools import matchers
from git_upstream.lib.searchers import UpstreamMergeBaseSearcher
from git_upstream.tests.base import BaseTestCase
@ -50,6 +51,11 @@ class TestUpstreamMergeBaseSearcher(TestWithScenarios, BaseTestCase):
searcher = UpstreamMergeBaseSearcher(branch=self.branches['head'][0],
patterns=pattern, repo=self.repo)
self.assertEqual(
self.gittree._commits_from_nodes(reversed(self.expected_changes)),
searcher.list(self.branches['upstream'][0]))
self.assertThat(self.logger.output,
matchers.Contains("Searching for most recent merge "
"base with upstream branches"))

View File

@ -20,6 +20,7 @@ from pprint import pformat
from testscenarios import TestWithScenarios
from testtools.content import text_content
from testtools import matchers
from git_upstream.tests.base import BaseTestCase
from git_upstream.tests.base import get_scenarios
@ -56,3 +57,7 @@ class TestStrategies(TestWithScenarios, BaseTestCase):
self.assertEqual(
self.gittree._commits_from_nodes(self.expected_changes),
[c for c in strategy.filtered_iter()])
self.assertThat(self.logger.output,
matchers.Contains("Searching for most recent merge "
"base with upstream branches"))