Skip to content
Snippets Groups Projects
Unverified Commit 829aa23d authored by Calen Pennington's avatar Calen Pennington Committed by GitHub
Browse files

Merge pull request #23091 from cpennington/replace-coverage-contexts-during-upload

Replace old coverage context files when uploading
parents 47393b5f 646cf1ed
No related branches found
Tags release-2020-11-02-12.26
No related merge requests found
......@@ -211,7 +211,7 @@ def create_tarfile_from_db_cache(fingerprint, files, path):
return zipfile_name, zipfile_path
def upload_to_s3(file_name, file_path, bucket_name):
def upload_to_s3(file_name, file_path, bucket_name, replace=False):
"""
Upload the specified files to an s3 bucket.
"""
......@@ -229,7 +229,7 @@ def upload_to_s3(file_name, file_path, bucket_name):
"Continuing without uploading the new cache to S3.")
return
key = boto.s3.key.Key(bucket=bucket, name=file_name)
bytes_written = key.set_contents_from_filename(file_path, replace=False, policy='public-read')
bytes_written = key.set_contents_from_filename(file_path, replace=replace, policy='public-read')
if bytes_written:
msg = u"Wrote {} bytes to {}.".format(bytes_written, key.name)
else:
......
......@@ -179,5 +179,6 @@ def upload_coverage_to_s3():
upload_to_s3(
COVERAGE_CACHE_BASELINE,
'reports/{}.coverage'.format(os.environ.get('TEST_SUITE', '')),
COVERAGE_CACHE_BUCKET
COVERAGE_CACHE_BUCKET,
replace=True,
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment