File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -31,10 +31,34 @@ phases:
31
31
echo "skipping notebook test"
32
32
fi
33
33
34
+ # wait its turn to run integration tests
35
+ - ACCOUNT=$(aws sts get-caller-identity --output text | awk '{print $1}')
36
+ - S3_BUCKET_DIR=s3://sagemaker-us-west-2-${ACCOUNT}/ci-lock
37
+
38
+ - |
39
+ while true; do
40
+ LAST_LOCK=$(aws s3 ls ${S3_BUCKET_DIR} | sort | tail -n 1 | awk '{print $4}')
41
+
42
+ if [[ -z "$LAST_LOCK" ]]
43
+ then
44
+ echo "No locks. Creating lock."
45
+ LOCK_FILE=$(date +%s)
46
+ touch ${LOCK_FILE}
47
+
48
+ aws s3 cp ${LOCK_FILE} ${S3_BUCKET_DIR}/${LOCK_FILE}
49
+
50
+ else
51
+ echo "Waiting on lock."
52
+ sleep 30
53
+ fi
54
+ done
55
+
34
56
# run integration tests
35
57
- |
36
58
if has-matching-changes "tests/" "src/*.py" "setup.py" "setup.cfg" "buildspec.yml"; then
37
59
IGNORE_COVERAGE=- tox -e py36,py27 -- tests/integ -n 24 --boxed --reruns 2
38
60
else
39
61
echo "skipping integration tests"
40
62
fi
63
+ finally :
64
+ - aws s3 rm --recursive ${S3_BUCKET_DIR}
You can’t perform that action at this time.
0 commit comments