From 2d290e94e9eabae79bd94798459b96e1147f5035 Mon Sep 17 00:00:00 2001 From: Ian Stapleton Cordasco <icordasco@heroku.com> Date: Fri, 6 Jul 2018 09:12:29 -0500 Subject: [PATCH] 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 --- .travis.yml | 5 +++++ Makefile | 5 +++++ test/fixtures/nltk/runtime.txt | 2 +- test/run | 20 +++++++++++++++++--- tests.sh | 7 ++++++- 5 files changed, 34 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8188379c..f2e12fee 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 b02fd5b3..6d6ac4c3 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 ba85ab97..1935e977 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 9117677a..a0a1b926 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 c136acba..c5e13f9e 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 -- GitLab