Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix xgboost_synthetic test #676

Merged
merged 1 commit into from
Nov 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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