Skip to content

Commit

Permalink
fix bug in docker_build.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jantman committed Jan 24, 2024
1 parent 9bdff25 commit 809d7d2
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions biweeklybudget/tests/docker_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,15 +486,14 @@ def _test_scripts(self, container):
]
for cmd_info in test_cmds:
logger.debug('Running: %s', cmd_info['cmd'])
res = container.exec_run(cmd_info['cmd']).decode().strip()
logger.debug('Command output:\n%s', res)
if 'output' in cmd_info:
if cmd_info['output'] not in res:
raise RuntimeError(
'Expected %s output to include "%s" but it did not' % (
cmd_info['cmd'], cmd_info['output']
)
ecode, res = container.exec_run(cmd_info['cmd'])
logger.debug('Command exited %d; output:\n%s', ecode, res)
if 'output' in cmd_info and cmd_info['output'] not in res.decode():
raise RuntimeError(
'Expected %s output to include "%s" but it did not' % (
cmd_info['cmd'], cmd_info['output']
)
)
logger.info('script tests SUCCEEDED')

def _run_mysql(self):
Expand Down

0 comments on commit 809d7d2

Please sign in to comment.