mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
zip corpus
This commit is contained in:
parent
4ba099cd7d
commit
55d7563c48
@ -23,6 +23,15 @@ NO_CHANGES_MSG = "Nothing to run"
|
||||
s3 = S3Helper()
|
||||
|
||||
|
||||
def zipdir(path, ziph):
|
||||
# ziph is zipfile handle
|
||||
for root, dirs, files in os.walk(path):
|
||||
for file in files:
|
||||
ziph.write(os.path.join(root, file),
|
||||
os.path.relpath(os.path.join(root, file),
|
||||
os.path.join(path, '..')))
|
||||
|
||||
|
||||
def get_additional_envs(check_name, run_by_hash_num, run_by_hash_total):
|
||||
result = []
|
||||
if "DatabaseReplicated" in check_name:
|
||||
@ -111,10 +120,15 @@ def download_corpus(corpus_path: str, fuzzer_name: str):
|
||||
|
||||
|
||||
def upload_corpus(result_path: str):
|
||||
for file in os.listdir(f"{result_path}/corpus/"):
|
||||
s3.upload_build_directory_to_s3(
|
||||
Path(f"{result_path}/corpus/{file}"), f"fuzzer/corpus/{file}", False
|
||||
)
|
||||
with zipfile.ZipFile(f"{result_path}/corpus.zip", "w", zipfile.ZIP_DEFLATED) as zipf:
|
||||
zipdir(f"{result_path}/corpus/", zipf)
|
||||
s3.upload_file(
|
||||
bucket=S3_BUILDS_BUCKET, file_path=f"{result_path}/corpus.zip", s3_path="fuzzer/corpus.zip"
|
||||
)
|
||||
# for file in os.listdir(f"{result_path}/corpus/"):
|
||||
# s3.upload_build_directory_to_s3(
|
||||
# Path(f"{result_path}/corpus/{file}"), f"fuzzer/corpus/{file}", False
|
||||
# )
|
||||
|
||||
|
||||
def main():
|
||||
|
Loading…
Reference in New Issue
Block a user