"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "buildbot/test/util/steps.py" between
buildbot-3.0.2.tar.gz and buildbot-3.1.0.tar.gz

About: Buildbot is a continuous integration testing framework (Python-based). It supports also automation of complex build systems, application deployment, and management of sophisticated software-release processes.

steps.py  (buildbot-3.0.2):steps.py  (buildbot-3.1.0)
skipping to change at line 258 skipping to change at line 258
step.addTestResultSet = add_test_result_set step.addTestResultSet = add_test_result_set
self._got_test_results = [] self._got_test_results = []
def add_test_result(setid, value, test_name=None, test_code_path=None, l ine=None, def add_test_result(setid, value, test_name=None, test_code_path=None, l ine=None,
duration_ns=None): duration_ns=None):
self._got_test_results.append((setid, value, test_name, test_code_pa th, line, self._got_test_results.append((setid, value, test_name, test_code_pa th, line,
duration_ns)) duration_ns))
step.addTestResult = add_test_result step.addTestResult = add_test_result
self._got_build_data = {}
def set_build_data(name, value, source):
self._got_build_data[name] = (value, source)
return defer.succeed(None)
step.setBuildData = set_build_data
# expectations # expectations
self.exp_result = None self.exp_result = None
self.exp_state_string = None self.exp_state_string = None
self.exp_properties = {} self.exp_properties = {}
self.exp_missing_properties = [] self.exp_missing_properties = []
self.exp_logfiles = {} self.exp_logfiles = {}
self._exp_logfiles_stderr = {}
self.exp_hidden = False self.exp_hidden = False
self.exp_exception = None self.exp_exception = None
self._exp_test_result_sets = [] self._exp_test_result_sets = []
self._exp_test_results = [] self._exp_test_results = []
self._exp_build_data = {}
# check that the step's name is not None # check that the step's name is not None
self.assertNotEqual(step.name, None) self.assertNotEqual(step.name, None)
return step return step
def expectCommands(self, *exp): def expectCommands(self, *exp):
""" """
Add to the expected remote commands, along with their results. Each Add to the expected remote commands, along with their results. Each
argument should be an instance of L{Expect}. argument should be an instance of L{Expect}.
skipping to change at line 309 skipping to change at line 319
Expect the given property is *not* set when the step is complete Expect the given property is *not* set when the step is complete
""" """
self.exp_missing_properties.append(property) self.exp_missing_properties.append(property)
def expectLogfile(self, logfile, contents): def expectLogfile(self, logfile, contents):
""" """
Expect a logfile with the given contents Expect a logfile with the given contents
""" """
self.exp_logfiles[logfile] = contents self.exp_logfiles[logfile] = contents
def expect_log_file_stderr(self, logfile, contents):
self._exp_logfiles_stderr[logfile] = contents
def expect_build_data(self, name, value, source):
self._exp_build_data[name] = (value, source)
def expectHidden(self, hidden): def expectHidden(self, hidden):
""" """
Set whether the step is expected to be hidden. Set whether the step is expected to be hidden.
""" """
self.exp_hidden = hidden self.exp_hidden = hidden
def expectException(self, exception_class): def expectException(self, exception_class):
""" """
Set whether the step is expected to raise an exception. Set whether the step is expected to raise an exception.
""" """
skipping to change at line 380 skipping to change at line 396
self.exp_state_string, self.exp_state_string,
stepStateString[stepids[0]])) stepStateString[stepids[0]]))
for pn, (pv, ps) in self.exp_properties.items(): for pn, (pv, ps) in self.exp_properties.items():
self.assertTrue(self.properties.hasProperty(pn), "missing property ' {}'".format(pn)) self.assertTrue(self.properties.hasProperty(pn), "missing property ' {}'".format(pn))
self.assertEqual(self.properties.getProperty(pn), pv, "property '{}' ".format(pn)) self.assertEqual(self.properties.getProperty(pn), pv, "property '{}' ".format(pn))
if ps is not None: if ps is not None:
self.assertEqual( self.assertEqual(
self.properties.getPropertySource(pn), ps, self.properties.getPropertySource(pn), ps,
"property {0!r} source has source {1!r}".format( "property {0!r} source has source {1!r}".format(
pn, self.properties.getPropertySource(pn))) pn, self.properties.getPropertySource(pn)))
for pn in self.exp_missing_properties: for pn in self.exp_missing_properties:
self.assertFalse(self.properties.hasProperty(pn), "unexpected proper ty '{}'".format(pn)) self.assertFalse(self.properties.hasProperty(pn), "unexpected proper ty '{}'".format(pn))
for l, exp in self.exp_logfiles.items(): for l, exp in self.exp_logfiles.items():
got = self.step.logs[l].stdout got = self.step.logs[l].stdout
if got != exp: if got != exp:
log.msg("Unexpected log output:\n" + got) log.msg("Unexpected stdout log output:\n" + got)
log.msg("Expected log output:\n" + exp) log.msg("Expected stdout log output:\n" + exp)
raise AssertionError("Unexpected log output; see logs") raise AssertionError("Unexpected stdout log output; see logs")
for l, exp in self._exp_logfiles_stderr.items():
got = self.step.logs[l].stderr
if got != exp:
log.msg("Unexpected stderr log output:\n" + got)
log.msg("Expected stderr log output:\n" + exp)
raise AssertionError("Unexpected stderr log output; see logs")
if self.exp_exception: if self.exp_exception:
self.assertEqual( self.assertEqual(
len(self.flushLoggedErrors(self.exp_exception)), 1) len(self.flushLoggedErrors(self.exp_exception)), 1)
self.assertEqual(self._exp_test_result_sets, self._got_test_result_sets) self.assertEqual(self._exp_test_result_sets, self._got_test_result_sets)
self.assertEqual(self._exp_test_results, self._got_test_results) self.assertEqual(self._exp_test_results, self._got_test_results)
self.assertEqual(self._exp_build_data, self._got_build_data)
# XXX TODO: hidden # XXX TODO: hidden
# self.step_status.setHidden.assert_called_once_with(self.exp_hidden) # self.step_status.setHidden.assert_called_once_with(self.exp_hidden)
# callbacks from the running step # callbacks from the running step
@defer.inlineCallbacks @defer.inlineCallbacks
def _validate_expectation(self, exp, command): def _validate_expectation(self, exp, command):
got = (command.remote_command, command.args) got = (command.remote_command, command.args)
 End of changes. 8 change blocks. 
3 lines changed or deleted 30 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)