Skip to content

Commit

Permalink
Fix miscellaneous bugs with the xgboost_synthetic test (kubeflow#676)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
jlewi authored and k8s-ci-robot committed Nov 8, 2019
1 parent 67041ec commit 7a2977e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions prow_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,4 @@ workflows:
- postsubmit
include_dirs:
- xgboost_synthetic/*
- py/kubeflow/examples/create_e2e_workflow.py
2 changes: 1 addition & 1 deletion py/kubeflow/examples/create_e2e_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def _build_tests_dag(self):
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",
Expand Down
6 changes: 4 additions & 2 deletions xgboost_synthetic/testing/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 4 additions & 4 deletions xgboost_synthetic/testing/xgboost_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 7a2977e

Please sign in to comment.