[e2e] Remove unnecessary logic around copying results (#22034)

After #21905, some of the logic around handling result artifacts become unnecessary or incorrect (in generating error logs). They are removed.
This commit is contained in:
mwtian 2022-02-03 12:15:06 -08:00 committed by GitHub
parent 9ac3f6879d
commit 92d7e9bf98
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2207,23 +2207,22 @@ def run_test_config(
out_dir = os.path.expanduser(GLOBAL_CONFIG["RELEASE_RESULTS_DIR"])
logger.info(
f"Moving results dir {temp_dir} to persistent location " f"{out_dir}"
)
logger.info(f"Moving results dir {temp_dir} to persistent location {out_dir}")
try:
shutil.rmtree(out_dir)
# out_dir is cleared in run_e2e.sh, but it may exist when running
# e2e.py directly.
if os.path.exists(out_dir):
shutil.rmtree(out_dir)
logger.info(f"Destination {out_dir} is cleared")
except Exception:
logger.exception(
f"Ran into error when clearing the destination dir: {out_dir}"
logger.info(
f"Ran into error when clearing the destination: {out_dir}",
exc_info=True,
)
try:
# Use distutils.dir_util.copy_tree() instead of shutil.cptree(),
# which allows existing output directory.
from distutils.dir_util import copy_tree
copy_tree(temp_dir, out_dir)
shutil.cptree(temp_dir, out_dir)
except Exception:
logger.exception(
"Ran into error when copying results dir to persistent "