From abc339f789c726f301186275d4cacee80c309f4e Mon Sep 17 00:00:00 2001 From: Gabriel Wen Date: Thu, 13 Feb 2020 15:31:44 -0800 Subject: [PATCH] write to gcs --- xgboost_synthetic/testing/execute_notebook.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/xgboost_synthetic/testing/execute_notebook.py b/xgboost_synthetic/testing/execute_notebook.py index 04ef64284..2228b3c44 100644 --- a/xgboost_synthetic/testing/execute_notebook.py +++ b/xgboost_synthetic/testing/execute_notebook.py @@ -3,6 +3,7 @@ import os import subprocess +from kubeflow.testing import util as kf_util logger = logging.getLogger(__name__) @@ -33,10 +34,11 @@ def run_notebook_test(notebook_path, expected_messages, parameters=None): nb = nbformat.reads(actual_output, as_version=4) html_exporter = nbconvert.HTMLExporter() (html_output, _) = html_exporter.from_notebook_node(nb) - logger.info(html_output[:10] + "...") - html_path = os.path.join(os.path.dirname(__file__), "out.html") - with open(html_path, "w") as f: - f.write(html_output) + gcs_path = "gs://kubeflow-ci-deployment/" + "/".join([ + "xgboost_synthetic_testing", + "temp.html" + ]) + kf_util.upload_to_gcs(html_output, gcs_path) for expected_message in expected_messages: if not expected_message in actual_output: