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 sample test result upload failure. #2077

Merged
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
Fix.
  • Loading branch information
numerology committed Sep 10, 2019
commit 00a1ae044e78ffce459bca127632b8ec906a4f7e
9 changes: 6 additions & 3 deletions test/sample-test/sample_test_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,14 @@ def _copy_result(self):
""" Copy generated sample test result to gcs, so that Prow can pick it. """
print('Copy the test results to GCS %s/' % self._results_gcs_dir)

utils.upload_blob(
self._bucket_name,
# TODO(Issue#2076): Currently switch to gsutil. Switch back to upload_blob
# when it is fixed.
subprocess.call([
'gsutil',
'cp',
self._sample_test_result,
os.path.join(self._results_gcs_dir, self._sample_test_result)
)
])

def _compile(self):

Expand Down
1 change: 1 addition & 0 deletions test/sample-test/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ def file_injection(file_in, tmp_file_out, subs):

os.rename(tmp_file_out, file_in)

# TODO(Issue#2076): Currently broken, further investigation needed.
def upload_blob(bucket_name, source_file_name, destination_blob_name):
"""Uploads a file to the bucket."""
storage_client = storage.Client()
Expand Down