Skip to content

Commit 2a247cb

Browse files
mvsusppengk19
authored andcommitted
change: separate unit, local mode, and notebook tests in different buildspecs (aws#898)
1 parent 9d71188 commit 2a247cb

4 files changed

+60
-53
lines changed

buildspec-localmodetests.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
version: 0.2
2+
3+
phases:
4+
pre_build:
5+
commands:
6+
- start-dockerd
7+
8+
build:
9+
commands:
10+
- IGNORE_COVERAGE=-
11+
12+
# local mode tests
13+
- start_time=`date +%s`
14+
- |
15+
if has-matching-changes "tests/" "src/*.py" "setup.py" "setup.cfg" "buildspec.yml"; then
16+
tox -e py36 -- tests/integ -m local_mode --durations 50
17+
fi
18+
- ./ci-scripts/displaytime.sh 'py36 local mode' $start_time
19+
20+
- start_time=`date +%s`
21+
- |
22+
if has-matching-changes "tests/" "src/*.py" "setup.py" "setup.cfg" "buildspec.yml"; then
23+
tox -e py27 -- tests/integ -m local_mode --durations 50
24+
fi
25+
- ./ci-scripts/displaytime.sh 'py27 local mode' $start_time

buildspec-notebooktests.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: 0.2
2+
3+
phases:
4+
build:
5+
commands:
6+
# run notebook test
7+
- echo "running notebook test"
8+
- start_time=`date +%s`
9+
- |
10+
if has-matching-changes "src/*.py" "setup.py" "setup.cfg"; then
11+
./tests/scripts/run-notebook-test.sh
12+
fi
13+
- ./ci-scripts/displaytime.sh 'notebook test' $start_time

buildspec-unittests.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
version: 0.2
2+
3+
phases:
4+
build:
5+
commands:
6+
# run linters
7+
- TOX_PARALLEL_NO_SPINNER=1
8+
- PY_COLORS=0
9+
- start_time=`date +%s`
10+
- tox -e flake8,pylint,twine,black-check --parallel all
11+
- ./ci-scripts/displaytime.sh 'flake8,pylint,twine,black-check' $start_time
12+
13+
- start_time=`date +%s`
14+
- tox -e sphinx
15+
- ./ci-scripts/displaytime.sh 'sphinx' $start_time
16+
17+
# run unit tests
18+
- start_time=`date +%s`
19+
- AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_SESSION_TOKEN=
20+
AWS_CONTAINER_CREDENTIALS_RELATIVE_URI= AWS_DEFAULT_REGION=
21+
tox -e py36,py27 --parallel all -- tests/unit
22+
- ./ci-scripts/displaytime.sh 'py36,py27 unit' $start_time

buildspec.yml

-53
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,10 @@
11
version: 0.2
22

33
phases:
4-
pre_build:
5-
commands:
6-
- start-dockerd
7-
84
build:
95
commands:
10-
# run linters
11-
- TOX_PARALLEL_NO_SPINNER=1
12-
- PY_COLORS=0
13-
- start_time=`date +%s`
14-
- 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`
18-
- tox -e sphinx
19-
- ./ci-scripts/displaytime.sh 'sphinx' $start_time
20-
21-
# run unit tests
22-
- start_time=`date +%s`
23-
- AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_SESSION_TOKEN=
24-
AWS_CONTAINER_CREDENTIALS_RELATIVE_URI= AWS_DEFAULT_REGION=
25-
tox -e py36,py27 --parallel all -- tests/unit
26-
- ./ci-scripts/displaytime.sh 'py36,py27 unit' $start_time
27-
286
- IGNORE_COVERAGE=-
297

30-
# local mode tests
31-
- start_time=`date +%s`
32-
- |
33-
if has-matching-changes "tests/" "src/*.py" "setup.py" "setup.cfg" "buildspec.yml"; then
34-
tox -e py36 -- tests/integ -m local_mode --durations 50
35-
fi
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-
458
# run integration tests
469
- start_time=`date +%s`
4710
- |
@@ -57,22 +20,6 @@ phases:
5720
fi
5821
- ./ci-scripts/displaytime.sh 'py36 tests/integ' $start_time
5922

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
66-
67-
# run notebook test
68-
- echo "running notebook test"
69-
- start_time=`date +%s`
70-
- |
71-
if has-matching-changes "src/*.py" "setup.py" "setup.cfg"; then
72-
./tests/scripts/run-notebook-test.sh
73-
fi
74-
- ./ci-scripts/displaytime.sh 'notebook test' $start_time
75-
7623
post_build:
7724
finally:
7825
- |

0 commit comments

Comments
 (0)