diff --git a/.travis.yml b/.travis.yml index 8188379c94f8b4b6735090b92546729bd11db2e8..f2e12fee7a2d10d112b3ed1534aa24a7e5fb45e7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,11 @@ jobs: - PATH="/tmp/shellcheck-latest:$PATH" script: make check + - stage: "Stack Tests" + services: docker + env: STACK=heroku-18 + script: ./tests.sh + - stage: "Stack Tests" services: docker env: STACK=heroku-16 diff --git a/Makefile b/Makefile index b02fd5b32d1bbe171d2e36d23c78356cc11478e9..6d6ac4c30b08a6d9581fd7e11d2dc6ed5e074341 100644 --- a/Makefile +++ b/Makefile @@ -18,6 +18,11 @@ test-heroku-16: @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;' @echo "" +test-heroku-18: + @echo "Running tests in docker (heroku-18)..." + @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;' + @echo "" + buildenv-heroku-16: @echo "Creating build environment (heroku-16)..." @echo diff --git a/test/fixtures/nltk/runtime.txt b/test/fixtures/nltk/runtime.txt index ba85ab9742df213599b929d6e0ac9b4f408f6c28..1935e9778db66275403e99759f51768cc7599918 100644 --- a/test/fixtures/nltk/runtime.txt +++ b/test/fixtures/nltk/runtime.txt @@ -1 +1 @@ -python-2.7.13 \ No newline at end of file +python-3.6.6 diff --git a/test/run b/test/run index 9117677aa9c7731950f4e5ca1df5a5bff15cf340..a0a1b926b82d0675e0d0bb11a6534e2d835684a8 100755 --- a/test/run +++ b/test/run @@ -39,6 +39,11 @@ testGEOS() { } testNLTK() { + # NOTE: This is a RuntimeWarning emitted by Python 3's runpy.py script + # which is what is used when you call `python -m <module>`. This is due to + # how nltk imports things. It's not actually an error, but it would probably + # be bad to silence in Production. + export PYTHONWARNINGS="ignore::RuntimeWarning" compile "nltk" assertCaptured "Downloading NLTK packages: city_database stopwords" assertCapturedSuccess @@ -76,9 +81,18 @@ testPylibmc() { } testPython2() { - compile "python2" - assertCaptured "python-2.7.15" - assertCapturedSuccess + if [[ "$STACK" == "heroku-16" ]] || [[ "$STACK" == "cedar-14" ]]; then + compile "python2" + assertCaptured "python-2.7.15" + assertCapturedSuccess + fi +} + +testNoPython2() { + if [[ "$STACK" == "heroku-18" ]]; then + compile "python2" + assertCapturedError + fi } testPython3() { diff --git a/tests.sh b/tests.sh index c136acbaef40d33453aa162ef6a8976c9bde3c65..c5e13f9e30f2ecc347ae77be84b3ba802ad21f42 100755 --- a/tests.sh +++ b/tests.sh @@ -13,4 +13,9 @@ fi if [[ "$STACK" == "heroku-16" ]]; then make test-heroku-16 exit $? -fi \ No newline at end of file +fi + +if [[ "$STACK" == "heroku-18" ]]; then + make test-heroku-18 + exit $? +fi