Skip to content

Commit

Permalink
write to gcs
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielwen committed Feb 13, 2020
1 parent 8fcbbc6 commit abc339f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions xgboost_synthetic/testing/execute_notebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import os
import subprocess

from kubeflow.testing import util as kf_util

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit abc339f

Please sign in to comment.