Skip to content

Commit

Permalink
[Fix] Failed uploading to GCS in e2e yatai service tests (#1401)
Browse files Browse the repository at this point in the history
* refactor upload_from_dir and update yatai services tests

* Update bento_repository_api.py
  • Loading branch information
yubozhao authored Jan 13, 2021
1 parent 3456d9e commit a3dcce5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bentoml/yatai/client/bento_repository_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def upload_from_dir(self, saved_bento_path, labels=None):
http_response = requests.put(
response.uri.s3_presigned_url, data=fileobj
)
elif response.uri.uri == BentoUri.GCS:
elif response.uri.type == BentoUri.GCS:
http_response = requests.put(
response.uri.gcs_presigned_url, data=fileobj
)
Expand Down
4 changes: 3 additions & 1 deletion e2e_tests/yatai_server/test_sqlite_gcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ def test_yatai_server_with_sqlite_and_gcs():
retrieve_svc_result = execute_bentoml_retrieve_command(
f'{svc.name}:{svc.version}'
)
assert retrieve_svc_result.startswith(f'Service {svc.name} artifact directory')
assert retrieve_svc_result.startswith(
f'Save {svc.name}:{svc.version} artifact to directory'
)

logger.info('Validate BentoService prediction result')
run_result = execute_bentoml_run_command(bento_tag, '[]')
Expand Down
4 changes: 3 additions & 1 deletion e2e_tests/yatai_server/test_sqlite_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ def test_yatai_server_with_sqlite_and_s3():
retrieve_svc_result = execute_bentoml_retrieve_command(
f'{svc.name}:{svc.version}'
)
assert retrieve_svc_result.startswith(f'Service {svc.name} artifact directory')
assert retrieve_svc_result.startswith(
f'Save {svc.name}:{svc.version} artifact to directory'
)

logger.info('Validate BentoService prediction result')
run_result = execute_bentoml_run_command(bento_tag, '[]')
Expand Down

0 comments on commit a3dcce5

Please sign in to comment.