Skip to content
Snippets Groups Projects
Commit b6aa187a authored by Simon McVittie's avatar Simon McVittie
Browse files

tests: Print stderr before checking exit status


If the command fails, we probably want to see why before we fail the test.

Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent 3f493fc7
Branches
Tags
1 merge request!55populate-depot: Fix and test layered runtime
......@@ -204,7 +204,6 @@ class TestPressureVessel(unittest.TestCase):
with self.catch('List contents of depot'):
completed = self.run_subprocess(
['find', '.', '-ls'],
check=True,
cwd=self.depot,
stdout=tee.stdin,
stderr=subprocess.PIPE,
......@@ -218,6 +217,8 @@ class TestPressureVessel(unittest.TestCase):
else:
logger.info('(no stderr)')
completed.check_returncode()
with self.catch('Read VERSION.txt'):
with open(
os.path.join(
......@@ -254,7 +255,6 @@ class TestPressureVessel(unittest.TestCase):
exe_path,
'--version',
],
check=True,
cwd=self.depot,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
......@@ -273,6 +273,8 @@ class TestPressureVessel(unittest.TestCase):
else:
logger.info('(no stderr)')
completed.check_returncode()
with open(
os.path.join(self.artifacts, 's-r-s-i-outside.json'),
'w',
......@@ -286,7 +288,6 @@ class TestPressureVessel(unittest.TestCase):
),
'--verbose',
],
check=True,
cwd=self.depot,
stdout=writer,
stderr=subprocess.PIPE,
......@@ -300,6 +301,8 @@ class TestPressureVessel(unittest.TestCase):
else:
logger.info('(no stderr)')
completed.check_returncode()
self.get_runtime_build_id()
def get_pressure_vessel_adverb(
......@@ -335,7 +338,6 @@ class TestPressureVessel(unittest.TestCase):
cwd=self.tmpdir.name,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
check=True,
)
logger.info(
......@@ -351,6 +353,8 @@ class TestPressureVessel(unittest.TestCase):
else:
logger.info('(no stderr)')
completed.check_returncode()
with open(
os.path.join(self.artifacts, artifact_prefix + '.json'),
'w',
......@@ -361,7 +365,6 @@ class TestPressureVessel(unittest.TestCase):
cwd=self.tmpdir.name,
stdout=writer,
stderr=subprocess.PIPE,
check=True,
)
if completed.stderr:
......@@ -372,6 +375,8 @@ class TestPressureVessel(unittest.TestCase):
else:
logger.info('(no stderr)')
completed.check_returncode()
with open(
os.path.join(self.artifacts, artifact_prefix + '.json'),
'r',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment