mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Log failure reason
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
import collections
|
||||
import json
|
||||
import os
|
||||
import shlex
|
||||
import string
|
||||
import subprocess
|
||||
import tempfile
|
||||
@@ -323,7 +324,13 @@ class BaseKubernetesIntegrationTestCase(BaseJobEnvironmentIntegrationTestCase, M
|
||||
self._wait_for_external_state(sa_session=sa_session, job=job, expected=app.model.Job.states.RUNNING)
|
||||
|
||||
external_id = job.job_runner_external_id
|
||||
output = unicodify(subprocess.check_output(["kubectl", "logs", "-l", f"job-name={external_id}"]))
|
||||
log_cmd = ["kubectl", "logs", "-l", f"job-name={external_id}"]
|
||||
p = subprocess.run(log_cmd)
|
||||
if p.returncode:
|
||||
raise Exception(
|
||||
f"Command '{shlex.join(log_cmd)}' failed with exit code: {p.returncode}.\nstdout: {p.stdout}\nstderr: {p.stderr}"
|
||||
)
|
||||
output = p.stdout
|
||||
EXPECTED_STDOUT = "The bool is not true"
|
||||
EXPECTED_STDERR = "The bool is very not true"
|
||||
assert EXPECTED_STDOUT in output
|
||||
|
||||
Reference in New Issue
Block a user