Fix miscellaneous bugs with the xgboost_synthetic test (#676)

* namespace where test runs should correspond to the namespace of a Kubeflow
  profile

* There was a bug in the logging format string

* There was a bug in the print statement for the job
This commit is contained in:
Jeremy Lewi 2019-11-07 19:46:19 -08:00 committed by Kubernetes Prow Robot
parent 67041ec4d5
commit 7a2977ef11
4 changed files with 10 additions and 7 deletions

View File

@ -74,3 +74,4 @@ workflows:
- postsubmit
include_dirs:
- xgboost_synthetic/*
- py/kubeflow/examples/create_e2e_workflow.py

View File

@ -240,7 +240,7 @@ class Builder:
command = ["pytest", "xgboost_test.py",
# Increase the log level so that info level log statements show up.
"--log-cli-level=info",
"--log-cli-format='%(levelname)s|%(asctime)s|%(pathname)s|%(lineno)d| %(message)'",
"--log-cli-format='%(levelname)s|%(asctime)s|%(pathname)s|%(lineno)d| %(message)s'",
# Test timeout in seconds.
"--timeout=1800",
"--junitxml=" + self.artifacts_dir + "/junit_xgboost-synthetic-test.xml",

View File

@ -5,8 +5,10 @@ def pytest_addoption(parser):
"--name", help="Name for the job. If not specified one was created "
"automatically", type=str, default="")
parser.addoption(
"--namespace", help="The namespace for the application", type=str,
default="kubeflow-test-infra")
"--namespace", help=("The namespace to run in. This should correspond to"
"a namespace associated with a Kubeflow namespace."),
type=str,
default="kubeflow-kubeflow-testing")
parser.addoption(
"--image", help="Notebook image to use", type=str,
default="gcr.io/kubeflow-images-public/tensorflow-1.14.0-notebook-gpu"

View File

@ -63,17 +63,17 @@ def test_xgboost_synthetic(record_xml_attribute, name, namespace, # pylint: disa
actual_job = batch_api.create_namespaced_job(job["metadata"]["namespace"],
job)
logging.info("Created job %s.%s:\n%s", namespace, name,
yaml.safe_dump(actual_job))
yaml.safe_dump(actual_job.to_dict()))
final_job = util.wait_for_job(api_client, namespace, name,
timeout=datetime.timedelta(minutes=30))
logging.info("Final job:\n%s", yaml.safe_dump(final_job))
logging.info("Final job:\n%s", yaml.safe_dump(final_job.to_dict()))
if not job.status.conditions:
if not final_job.status.conditions:
raise RuntimeError("Job {0}.{1}; did not complete".format(namespace, name))
last_condition = job.status.conditions[-1]
last_condition = final_job.status.conditions[-1]
if last_condition.type not in ["Complete"]:
logging.error("Job didn't complete successfully")