@@ -10,44 +10,76 @@ phases:
1010 # run linters
1111 - TOX_PARALLEL_NO_SPINNER=1
1212 - PY_COLORS=0
13+ - start_time=`date +%s`
1314 - tox -e flake8,pylint,twine,black-check --parallel all
15+ - ./ci-scripts/displaytime.sh 'flake8,pylint,twine,black-check' $start_time
16+
17+ - start_time=`date +%s`
1418 - tox -e sphinx
19+ - ./ci-scripts/displaytime.sh 'sphinx' $start_time
1520
1621 # run unit tests
22+ - start_time=`date +%s`
1723 - AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_SESSION_TOKEN=
1824 AWS_CONTAINER_CREDENTIALS_RELATIVE_URI= AWS_DEFAULT_REGION=
1925 tox -e py36,py27 --parallel all -- tests/unit
26+ - ./ci-scripts/displaytime.sh 'py36,py27 unit' $start_time
27+
28+ - IGNORE_COVERAGE=-
2029
2130 # local mode tests
31+ - start_time=`date +%s`
2232 - |
2333 if has-matching-changes "tests/" "src/*.py" "setup.py" "setup.cfg" "buildspec.yml"; then
24- IGNORE_COVERAGE=- tox -e py36 -- tests/integ -m local_mode --durations 50
25- IGNORE_COVERAGE=- tox -e py27 -- tests/integ -m local_mode --durations 50
26- else
27- echo "skipping integration tests"
34+ tox -e py36 -- tests/integ -m local_mode --durations 50
2835 fi
29-
36+ - ./ci-scripts/displaytime.sh 'py36 local mode' $start_time
37+
38+ - start_time=`date +%s`
39+ - |
40+ if has-matching-changes "tests/" "src/*.py" "setup.py" "setup.cfg" "buildspec.yml"; then
41+ tox -e py27 -- tests/integ -m local_mode --durations 50
42+ fi
43+ - ./ci-scripts/displaytime.sh 'py27 local mode' $start_time
44+
3045 # run integration tests
46+ - start_time=`date +%s`
3147 - |
3248 if has-matching-changes "tests/" "src/*.py" "setup.py" "setup.cfg" "buildspec.yml"; then
3349 python3 -u ci-scripts/queue_build.py
34- IGNORE_COVERAGE=- tox -e py36 -- tests/integ -m "not local_mode" -n 48 --reruns 3 --reruns-delay 5 --durations 50
35- IGNORE_COVERAGE=- tox -e py27 -- tests/integ -m "not local_mode" -n 48 --reruns 3 --reruns-delay 5 --durations 50
36- else
37- echo "skipping integration tests"
3850 fi
51+ - ./ci-scripts/displaytime.sh 'build queue' $start_time
52+
53+ - start_time=`date +%s`
54+ - |
55+ if has-matching-changes "tests/" "src/*.py" "setup.py" "setup.cfg" "buildspec.yml"; then
56+ tox -e py36 -- tests/integ -m "not local_mode" -n 48 --reruns 3 --reruns-delay 5 --durations 50
57+ fi
58+ - ./ci-scripts/displaytime.sh 'py36 tests/integ' $start_time
59+
60+ - start_time=`date +%s`
61+ - |
62+ if has-matching-changes "tests/" "src/*.py" "setup.py" "setup.cfg" "buildspec.yml"; then
63+ tox -e py27 -- tests/integ -m "not local_mode" -n 48 --reruns 3 --reruns-delay 5 --durations 50
64+ fi
65+ - ./ci-scripts/displaytime.sh 'py27 tests/integ' $start_time
3966
4067 # run notebook test
68+ - echo "running notebook test"
69+ - start_time=`date +%s`
4170 - |
42- if has-matching-changes "src/*.py" "setup.py" "setup.cfg" "buildspec.yml"; then
43- echo "running notebook test"
71+ if has-matching-changes "src/*.py" "setup.py" "setup.cfg"; then
4472 ./tests/scripts/run-notebook-test.sh
45- else
46- echo "skipping notebook test"
47- fi
73+ fi
74+ - ./ci-scripts/displaytime.sh ' notebook test' $start_time
75+
4876 post_build :
4977 finally :
50- - FILENAME=$(ls ci-lock/)
51- - ACCOUNT=$(aws sts get-caller-identity --output text | awk '{print $1}')
52- - S3_BUCKET_DIR=s3://sagemaker-us-west-2-${ACCOUNT}/ci-lock/
53- - aws s3 rm ${S3_BUCKET_DIR}${FILENAME}
78+ - |
79+ if [ -d "ci-lock" ]; then
80+ FILENAME=$(ls ci-lock/ || true)
81+ ACCOUNT=$(aws sts get-caller-identity --output text | awk '{print $1}')
82+ S3_BUCKET_DIR=s3://sagemaker-us-west-2-${ACCOUNT}/ci-lock/
83+ aws s3 rm ${S3_BUCKET_DIR}${FILENAME}
84+ fi
85+
0 commit comments