Skip to content

Commit

Permalink
Uses a regex to match the test output.
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigc committed Feb 25, 2017
1 parent bf23a3d commit 5c9669e
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions master/buildbot/test/integration/test_trigger.py
Expand Up @@ -26,18 +26,18 @@
# This integration test creates a master and worker environment,
# with two builders and a trigger step linking them

expectedOutput = """\
*** BUILD 1 *** ==> finished (success)
*** STEP shell *** ==> 'echo hello' (success)
log:stdio ({loglines})
*** STEP trigger *** ==> triggered trigsched (success)
url:trigsched #2 (http://localhost:8080/#buildrequests/2)
url:success: build #1 (http://localhost:8080/#builders/2/builds/1)
*** STEP shell_1 *** ==> 'echo world' (success)
log:stdio ({loglines})
*** BUILD 2 *** ==> finished (success)
*** STEP shell *** ==> 'echo ola' (success)
log:stdio ({loglines})
expectedOutputRegex = \
r"""\*\*\* BUILD 1 \*\*\* ==> finished \(success\)
\*\*\* STEP shell \*\*\* ==> 'echo hello' \(success\)
log:stdio \({loglines}\)
\*\*\* STEP trigger \*\*\* ==> triggered trigsched \(success\)
url:trigsched #2 \(http://localhost:8080/#buildrequests/2\)
url:success: build #1 \(http://localhost:8080/#builders/2/builds/1\)
\*\*\* STEP shell_1 \*\*\* ==> 'echo world' \(success\)
log:stdio \({loglines}\)
\*\*\* BUILD 2 \*\*\* ==> finished \(success\)
\*\*\* STEP shell \*\*\* ==> 'echo ola' \(success\)
log:stdio \({loglines}\)
"""


Expand Down Expand Up @@ -66,8 +66,8 @@ def test_trigger(self):
# depending on the environment the number of lines is different between
# test hosts
loglines = builds[1]['steps'][0]['logs'][0]['num_lines']
self.assertEqual(dump.getvalue(),
expectedOutput.format(loglines=loglines))
self.assertRegex(dump.getvalue(),
expectedOutputRegex.format(loglines=loglines))


# master configuration
Expand Down

0 comments on commit 5c9669e

Please sign in to comment.