@@ -594,31 +594,40 @@ cmd_download_ci_artifacts() {
594594 if [ " $1 " = " --force" ]; then
595595 rm -rf $LOCAL_ARTIFACTS_DIR
596596 fi
597+ download_ci_artifacts
598+ }
597599
598- ensure_ci_artifacts
600+ ensure_current_artifacts_are_set_up () {
601+ if [ -f $LOCAL_ARTIFACTS_CURRENT_DIR_FILE ]; then
602+ say " Current artifacts already setup at " $( cat $LOCAL_ARTIFACTS_CURRENT_DIR_FILE )
603+ else
604+ download_ci_artifacts
605+ echo $LOCAL_ARTIFACTS_PATH > $LOCAL_ARTIFACTS_CURRENT_DIR_FILE
606+ say " Current artifacts downloaded and setup at " $LOCAL_ARTIFACTS_PATH
607+ fi
599608}
600609
601- ensure_ci_artifacts () {
610+ download_ci_artifacts () {
602611 if ! command -v aws > /dev/null; then
603612 die " AWS CLI not installed, which is required for downloading artifacts for integration tests."
604613 fi
605614
606615 # Fetch all the artifacts so they are local
607616 local artifacts_s3_url=$( get_newest_s3_artifacts)
608617 local artifacts_s3_url_arch=$artifacts_s3_url /$( uname -m)
609- local artifacts_local_path =$( get_local_artifacts_path $artifacts_s3_url ) /$( uname -m)
618+ local local_artifacts_path =$( get_local_artifacts_path $artifacts_s3_url ) /$( uname -m)
610619
611- if [ ! -d " $artifacts_local_path " ]; then
612- say " Fetching artifacts from S3: " $artifacts_s3_url_arch " into: " $artifacts_local_path
613- mkdir -pv $artifacts_local_path
614- aws s3 sync --no-sign-request " $artifacts_s3_url_arch " " $artifacts_local_path "
620+ if [ ! -d " $local_artifacts_path " ]; then
621+ say " Fetching artifacts from S3: " $artifacts_s3_url_arch " into: " $local_artifacts_path
622+ mkdir -pv $local_artifacts_path
623+ aws s3 sync --no-sign-request " $artifacts_s3_url_arch " " $local_artifacts_path "
615624 ok_or_die " Failed to download artifacts using awscli!"
616- cmd_sh " ./tools/setup-ci-artifacts.sh" $artifacts_local_path
625+ cmd_sh " ./tools/setup-ci-artifacts.sh" $local_artifacts_path
617626 else
618- say " Found existing artifacts " $artifacts_s3_url_arch " at: " $artifacts_local_path
627+ say " Found existing artifacts " $artifacts_s3_url_arch " at: " $local_artifacts_path
619628 fi
620629
621- echo $artifacts_local_path > $LOCAL_ARTIFACTS_CURRENT_DIR_FILE
630+ LOCAL_ARTIFACTS_PATH= $local_artifacts_path
622631}
623632
624633apply_linux_61_tweaks () {
@@ -763,7 +772,8 @@ cmd_test() {
763772 [ $do_kvm_check != 0 ] && ensure_kvm
764773 ensure_devctr
765774 ensure_build_dir
766- ensure_ci_artifacts
775+ ensure_current_artifacts_are_set_up
776+
767777 if [ $do_build != 0 ]; then
768778 cmd_build --release
769779 if [ -n " $BUILDKITE_PULL_REQUEST_BASE_BRANCH " ]; then
@@ -944,7 +954,7 @@ cmd_sh() {
944954
945955cmd_sandbox () {
946956 cmd_build --release
947- ensure_ci_artifacts
957+ ensure_current_artifacts_are_set_up
948958 cmd_sh " tmux new env PYTEST_ADDOPTS=--pdbcls=IPython.terminal.debugger:TerminalPdb PYTHONPATH=tests IPYTHONDIR=\$ PWD/.ipython ipython -i ./tools/sandbox.py $@ "
949959 cmd_fix_perms " .ipython"
950960}
@@ -966,12 +976,12 @@ cmd_sandbox_native() {
966976 pip3.11 install ipython requests requests_unixsocket2 psutil tenacity filelock
967977 pip3.11 install jsonschema aws_embedded_metrics
968978 pip3.11 install packaging pytest
969- ensure_ci_artifacts
979+ ensure_current_artifacts_are_set_up
970980 tmux neww sudo --preserve-env=HOME,PATH,TMUX env PYTHONPATH=tests IPYTHONDIR=\$ PWD/.ipython ipython -i ./tools/sandbox.py $@
971981}
972982
973983cmd_test_debug () {
974- ensure_ci_artifacts
984+ ensure_current_artifacts_are_set_up
975985 cmd_sh " tmux new ./tools/test.sh --pdb $@ "
976986}
977987
0 commit comments