Skip to content

Commit 2d290e9

Browse files
committed
Add heroku-18 to our Travis CI config
- Add stage to Travis CI config and update tests.sh script to recognize it - Update tests to assert there is no Python 2 on Heroku-18 - Update nltk fixture to use Python 3.6 so we can test it on all stacks Closes gh-730
1 parent 18945ff commit 2d290e9

File tree

5 files changed

+34
-5
lines changed

5 files changed

+34
-5
lines changed

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ jobs:
99
- PATH="/tmp/shellcheck-latest:$PATH"
1010
script: make check
1111

12+
- stage: "Stack Tests"
13+
services: docker
14+
env: STACK=heroku-18
15+
script: ./tests.sh
16+
1217
- stage: "Stack Tests"
1318
services: docker
1419
env: STACK=heroku-16

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ test-heroku-16:
1818
@docker run -v $(shell pwd):/buildpack:ro --rm -it -e "STACK=heroku-16" heroku/heroku:16-build bash -c 'cp -r /buildpack /buildpack_test; cd /buildpack_test/; test/run;'
1919
@echo ""
2020

21+
test-heroku-18:
22+
@echo "Running tests in docker (heroku-18)..."
23+
@docker run -v $(shell pwd):/buildpack:ro --rm -it -e "STACK=heroku-18" heroku/heroku:18-build bash -c 'cp -r /buildpack /buildpack_test; cd /buildpack_test/; test/run;'
24+
@echo ""
25+
2126
buildenv-heroku-16:
2227
@echo "Creating build environment (heroku-16)..."
2328
@echo

test/fixtures/nltk/runtime.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
python-2.7.13
1+
python-3.6.6

test/run

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ testGEOS() {
3939
}
4040

4141
testNLTK() {
42+
# NOTE: This is a RuntimeWarning emitted by Python 3's runpy.py script
43+
# which is what is used when you call `python -m <module>`. This is due to
44+
# how nltk imports things. It's not actually an error, but it would probably
45+
# be bad to silence in Production.
46+
export PYTHONWARNINGS="ignore::RuntimeWarning"
4247
compile "nltk"
4348
assertCaptured "Downloading NLTK packages: city_database stopwords"
4449
assertCapturedSuccess
@@ -76,9 +81,18 @@ testPylibmc() {
7681
}
7782

7883
testPython2() {
79-
compile "python2"
80-
assertCaptured "python-2.7.15"
81-
assertCapturedSuccess
84+
if [[ "$STACK" == "heroku-16" ]] || [[ "$STACK" == "cedar-14" ]]; then
85+
compile "python2"
86+
assertCaptured "python-2.7.15"
87+
assertCapturedSuccess
88+
fi
89+
}
90+
91+
testNoPython2() {
92+
if [[ "$STACK" == "heroku-18" ]]; then
93+
compile "python2"
94+
assertCapturedError
95+
fi
8296
}
8397

8498
testPython3() {

tests.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,9 @@ fi
1313
if [[ "$STACK" == "heroku-16" ]]; then
1414
make test-heroku-16
1515
exit $?
16-
fi
16+
fi
17+
18+
if [[ "$STACK" == "heroku-18" ]]; then
19+
make test-heroku-18
20+
exit $?
21+
fi

0 commit comments

Comments
 (0)