From 0ffbf608825bbfed3d0cf8d43ef779934c28b1e1 Mon Sep 17 00:00:00 2001 From: Casey Faist Date: Tue, 10 Sep 2019 11:53:33 -0700 Subject: [PATCH 01/17] split out tests to avoid timeouts --- test/run | 318 ---------------------------------------------- test/run-deps | 59 +++++++++ test/run-features | 82 ++++++++++++ test/run-versions | 145 +++++++++++++++++++++ test/utils | 52 ++++++++ 5 files changed, 338 insertions(+), 318 deletions(-) delete mode 100755 test/run create mode 100755 test/run-deps create mode 100755 test/run-features create mode 100755 test/run-versions diff --git a/test/run b/test/run deleted file mode 100755 index 34f5fa5..0000000 --- a/test/run +++ /dev/null @@ -1,318 +0,0 @@ -#!/usr/bin/env bash - -# Default Python Versions -# shellcheck source=bin/default_pythons -source "bin/default_pythons" - -testAirflow() { - export SLUGIFY_USES_TEXT_UNIDECODE="yes" - compile "airflow" - assertCaptured "apache-airflow==1.10.2" - assertCapturedSuccess -} - -testPipenv() { - compile "pipenv" - assertCapturedSuccess -} - -testPipenvLock() { - compile "pipenv-lock" - assertCapturedSuccess -} - -testPipenvVersion() { - compile "pipenv-version" - assertCaptured $DEFAULT_PYTHON_VERSION - assertCapturedSuccess -} - -testPipenvVersion2() { - compile "pipenv-version2" - assertCaptured $LATEST_27 - assertCapturedSuccess -} -testPipenvFullVersion() { - compile "pipenv-full-version" - assertCaptured "3.6.3" - assertCapturedSuccess -} - -testNoRequirements() { - compile "no-requirements" - assertCapturedError -} - -testCollectstatic() { - compile "collectstatic" - assertCaptured "collectstatic" -} - -testGEOS() { - export BUILD_WITH_GEO_LIBRARIES=1 - compile "geos" - assertCaptured "geos" - assertCapturedSuccess -} - -testNLTK() { - # NOTE: This is a RuntimeWarning emitted by Python 3's runpy.py script - # which is what is used when you call `python -m `. 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 "[nltk_data] Downloading package city_database" "STD_ERR" - assertCapturedSuccess -} - -testSetupPy() { - compile "setup-py" - assertCaptured "maya" - assertCapturedSuccess -} - - -testStandardRequirements() { - compile "requirements-standard" - assertCaptured "requests" - assertCapturedSuccess -} - -testPsycopg2() { - compile "psycopg2" - assertCaptured "psycopg2" - assertCapturedSuccess -} - -testCffi() { - compile "cffi" - assertCaptured "cffi" - assertCapturedSuccess -} - -testPylibmc() { - compile "pylibmc" - assertCaptured "pylibmc" - assertCapturedSuccess -} - -testPythonDefault() { - updateVersion "pythonDefault" $DEFAULT_PYTHON_VERSION - compile "pythonDefault" - assertCaptured $DEFAULT_PYTHON_VERSION - assertNotCaptured "security update" - assertCapturedSuccess -} - -testPython2() { - updateVersion "python2" $LATEST_27 - echo $LATEST_27 > "runtime.txt" - compile "python2" - assertCaptured $LATEST_27 - assertNotCaptured "security update" - assertCapturedSuccess -} - -testPython2_warn() { - compile "python2_warn" - assertCaptured "python-2.7.15" - assertCaptured "security update!" - assertCapturedSuccess -} - -testPython2_fail() { - compile "python2_fail" - assertCaptured "Aborting" - assertCapturedError -} - -testPython3_4() { - if [[ $STACK != "cedar-14" ]]; then - updateVersion "python3_4" $LATEST_34 - compile "python3_4" - assertCaptured $LATEST_34 - assertNotCaptured "security update" - assertCapturedSuccess - fi -} - -testPython3_4_warn() { - compile "python3_4_warn" - if [[ $STACK = "cedar-14" ]]; then - assertCaptured "python-3.4.0" - assertCaptured "security update!" - assertCapturedSuccess - else - assertCapturedError - fi -} - -testPython3_4_fail() { - compile "python3_4_fail" - assertCaptured "Aborting" - assertCapturedError -} - -testPython3_5() { - if [[ $STACK != "cedar-14" ]]; then - updateVersion "python3_5" $LATEST_35 - compile "python3_5" - assertCaptured $LATEST_35 - assertNotCaptured "security update" - assertCapturedSuccess - fi -} - -testPython3_5_warn() { - compile "python3_5_warn" - if [[ $STACK = "cedar-14" ]]; then - assertCaptured "python-3.5.3" - assertCaptured "security update!" - assertCapturedError - else - assertCapturedError - fi -} - -testPython3_5_fail() { - compile "python3_5_fail" - assertCaptured "Aborting" - assertCapturedError -} - -testPython3_6() { - updateVersion "python3_6" $LATEST_36 - compile "python3_6" - assertCaptured $LATEST_36 - assertNotCaptured "security update" - assertCapturedSuccess -} - -testPython3_6_warn() { - compile "python3_6_warn" - assertCaptured "python-3.6.7" - assertCaptured "security update!" - assertCapturedSuccess -} - -testPython3_6_fail() { - compile "python3_6_fail" - assertCaptured "Aborting" - assertCapturedError -} - -testPython3_7() { - updateVersion "python3_7" $LATEST_37 - compile "python3_7" - if [[ $STACK = "cedar-14" ]]; then - assertCapturedError - else - assertNotCaptured "security update" - assertCaptured $LATEST_37 - assertCapturedSuccess - fi -} - -testPython3_7_warn() { - compile "python3_7_warn" - if [[ $STACK = "cedar-14" ]]; then - assertCapturedError - else - assertCaptured "python-3.7.1" - assertCaptured "security update!" - assertCapturedSuccess - fi -} - -testPython3_7_fail() { - compile "python3_7_fail" - assertCaptured "Aborting" - assertCapturedError -} - -testGitEgg() { - compile "git-egg" - assertCaptured "requests" - assertCapturedSuccess -} - -testSmartRequirements() { - local cache_dir="$(mktmpdir)" - compile "requirements-standard" "$cache_dir" - assertFile "requests" ".heroku/python/requirements-declared.txt" - assertCapturedSuccess - compile "psycopg2" "$cache_dir" - assertCaptured "Uninstalling requests" - assertFile "psycopg2" ".heroku/python/requirements-declared.txt" - assertCapturedSuccess -} - -testStackChange() { - local cache_dir="$(mktmpdir)" - mkdir -p "${cache_dir}/.heroku" - echo "different-stack" > "${cache_dir}/.heroku/python-stack" - compile "requirements-standard" "$cache_dir" - assertCaptured "clearing cache" - assertFile "$STACK" ".heroku/python-stack" - assertCapturedSuccess -} - - -pushd $(dirname 0) >/dev/null -popd >/dev/null - -source $(pwd)/test/utils - -mktmpdir() { - dir=$(mktemp -t testXXXXX) - rm -rf $dir - mkdir $dir - echo $dir -} - -detect() { - capture $(pwd)/bin/detect $(pwd)/test/fixtures/$1 -} - -compile_dir="" - -default_process_types_cleanup() { - file="/tmp/default_process_types" - if [ -f "$file" ]; then - rm "$file" - fi -} - -compile() { - default_process_types_cleanup - bp_dir=$(mktmpdir) - compile_dir=$(mktmpdir) - cp -a $(pwd)/* ${bp_dir} - cp -a ${bp_dir}/test/fixtures/$1/. ${compile_dir} - capture ${bp_dir}/bin/compile ${compile_dir} ${2:-$(mktmpdir)} $3 -} - -compileDir() { - default_process_types_cleanup - - local bp_dir=$(mktmpdir) - local compile_dir=${1:-$(mktmpdir)} - local cache_dir=${2:-$(mktmpdir)} - local env_dir=$3 - - cp -a $(pwd)/* ${bp_dir} - capture ${bp_dir}/bin/compile ${compile_dir} ${cache_dir} ${env_dir} -} - -release() { - bp_dir=$(mktmpdir) - cp -a $(pwd)/* ${bp_dir} - capture ${bp_dir}/bin/release ${bp_dir}/test/fixtures/$1 -} - -assertFile() { - assertEquals "$1" "$(cat ${compile_dir}/$2)" -} - -source $(pwd)/test/shunit2 diff --git a/test/run-deps b/test/run-deps new file mode 100755 index 0000000..a02d9ca --- /dev/null +++ b/test/run-deps @@ -0,0 +1,59 @@ +#!/usr/bin/env bash + +# Default Python Versions +# shellcheck source=bin/default_pythons +source "bin/default_pythons" + +testAirflow() { + export SLUGIFY_USES_TEXT_UNIDECODE="yes" + compile "airflow" + assertCaptured "apache-airflow==1.10.2" + assertCapturedSuccess +} + +testCollectstatic() { + compile "collectstatic" + assertCaptured "collectstatic" +} + +testGEOS() { + export BUILD_WITH_GEO_LIBRARIES=1 + compile "geos" + assertCaptured "geos" + assertCapturedSuccess +} + +testNLTK() { + # NOTE: This is a RuntimeWarning emitted by Python 3's runpy.py script + # which is what is used when you call `python -m `. 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 "[nltk_data] Downloading package city_database" "STD_ERR" + assertCapturedSuccess +} + +testPsycopg2() { + compile "psycopg2" + assertCaptured "psycopg2" + assertCapturedSuccess +} + +testCffi() { + compile "cffi" + assertCaptured "cffi" + assertCapturedSuccess +} + +testPylibmc() { + compile "pylibmc" + assertCaptured "pylibmc" + assertCapturedSuccess +} + +pushd $(dirname 0) >/dev/null +popd >/dev/null + +source $(pwd)/test/utils +source $(pwd)/test/shunit2 diff --git a/test/run-features b/test/run-features new file mode 100755 index 0000000..66fac4e --- /dev/null +++ b/test/run-features @@ -0,0 +1,82 @@ +#!/usr/bin/env bash + +# Default Python Versions +# shellcheck source=bin/default_pythons +source "bin/default_pythons" + +testGitEgg() { + compile "git-egg" + assertCaptured "requests" + assertCapturedSuccess +} + +testSmartRequirements() { + local cache_dir="$(mktmpdir)" + compile "requirements-standard" "$cache_dir" + assertFile "requests" ".heroku/python/requirements-declared.txt" + assertCapturedSuccess + compile "psycopg2" "$cache_dir" + assertCaptured "Uninstalling requests" + assertFile "psycopg2" ".heroku/python/requirements-declared.txt" + assertCapturedSuccess +} + +testStackChange() { + local cache_dir="$(mktmpdir)" + mkdir -p "${cache_dir}/.heroku" + echo "different-stack" > "${cache_dir}/.heroku/python-stack" + compile "requirements-standard" "$cache_dir" + assertCaptured "clearing cache" + assertFile "$STACK" ".heroku/python-stack" + assertCapturedSuccess +} + +testSetupPy() { + compile "setup-py" + assertCaptured "maya" + assertCapturedSuccess +} + +testStandardRequirements() { + compile "requirements-standard" + assertCaptured "requests" + assertCapturedSuccess +} + +testPipenv() { + compile "pipenv" + assertCapturedSuccess +} + +testPipenvLock() { + compile "pipenv-lock" + assertCapturedSuccess +} + +testPipenvVersion() { + compile "pipenv-version" + assertCaptured $DEFAULT_PYTHON_VERSION + assertCapturedSuccess +} + +testPipenvVersion2() { + compile "pipenv-version2" + assertCaptured $LATEST_27 + assertCapturedSuccess +} +testPipenvFullVersion() { + compile "pipenv-full-version" + assertCaptured "3.6.3" + assertCapturedSuccess +} + +testNoRequirements() { + compile "no-requirements" + assertCapturedError +} + +pushd $(dirname 0) >/dev/null +popd >/dev/null + +source $(pwd)/test/utils +source $(pwd)/test/shunit2 diff --git a/test/run-versions b/test/run-versions new file mode 100755 index 0000000..6c6617c --- /dev/null +++ b/test/run-versions @@ -0,0 +1,145 @@ +#!/usr/bin/env bash + +# Default Python Versions +# shellcheck source=bin/default_pythons +source "bin/default_pythons" + +testPythonDefault() { + updateVersion "pythonDefault" $DEFAULT_PYTHON_VERSION + compile "pythonDefault" + assertCaptured $DEFAULT_PYTHON_VERSION + assertNotCaptured "security update" + assertCapturedSuccess +} + +testPython2() { + updateVersion "python2" $LATEST_27 + echo $LATEST_27 > "runtime.txt" + compile "python2" + assertCaptured $LATEST_27 + assertNotCaptured "security update" + assertCapturedSuccess +} + +testPython2_warn() { + compile "python2_warn" + assertCaptured "python-2.7.15" + assertCaptured "security update!" + assertCapturedSuccess +} + +testPython2_fail() { + compile "python2_fail" + assertCaptured "Aborting" + assertCapturedError +} + +testPython3_4() { + if [[ $STACK != "cedar-14" ]]; then + updateVersion "python3_4" $LATEST_34 + compile "python3_4" + assertCaptured $LATEST_34 + assertNotCaptured "security update" + assertCapturedSuccess + fi +} + +testPython3_4_warn() { + compile "python3_4_warn" + if [[ $STACK = "cedar-14" ]]; then + assertCaptured "python-3.4.0" + assertCaptured "security update!" + assertCapturedSuccess + else + assertCapturedError + fi +} + +testPython3_4_fail() { + compile "python3_4_fail" + assertCaptured "Aborting" + assertCapturedError +} + +testPython3_5() { + if [[ $STACK != "cedar-14" ]]; then + updateVersion "python3_5" $LATEST_35 + compile "python3_5" + assertCaptured $LATEST_35 + assertNotCaptured "security update" + assertCapturedSuccess + fi +} + +testPython3_5_warn() { + compile "python3_5_warn" + if [[ $STACK = "cedar-14" ]]; then + assertCaptured "python-3.5.3" + assertCaptured "security update!" + assertCapturedError + else + assertCapturedError + fi +} + +testPython3_5_fail() { + compile "python3_5_fail" + assertCaptured "Aborting" + assertCapturedError +} + +testPython3_6() { + updateVersion "python3_6" $LATEST_36 + compile "python3_6" + assertCaptured $LATEST_36 + assertNotCaptured "security update" + assertCapturedSuccess +} + +testPython3_6_warn() { + compile "python3_6_warn" + assertCaptured "python-3.6.7" + assertCaptured "security update!" + assertCapturedSuccess +} + +testPython3_6_fail() { + compile "python3_6_fail" + assertCaptured "Aborting" + assertCapturedError +} + +testPython3_7() { + updateVersion "python3_7" $LATEST_37 + compile "python3_7" + if [[ $STACK = "cedar-14" ]]; then + assertCapturedError + else + assertNotCaptured "security update" + assertCaptured $LATEST_37 + assertCapturedSuccess + fi +} + +testPython3_7_warn() { + compile "python3_7_warn" + if [[ $STACK = "cedar-14" ]]; then + assertCapturedError + else + assertCaptured "python-3.7.1" + assertCaptured "security update!" + assertCapturedSuccess + fi +} + +testPython3_7_fail() { + compile "python3_7_fail" + assertCaptured "Aborting" + assertCapturedError +} + +pushd $(dirname 0) >/dev/null +popd >/dev/null + +source $(pwd)/test/utils +source $(pwd)/test/shunit2 diff --git a/test/utils b/test/utils index 1ddd24e..ff22b74 100644 --- a/test/utils +++ b/test/utils @@ -212,3 +212,55 @@ assertFileMD5() assertEquals "${expected_md5_cmd_output}" "`${md5_cmd}`" } + +# Test helpers +mktmpdir() { + dir=$(mktemp -t testXXXXX) + rm -rf $dir + mkdir $dir + echo $dir +} + +detect() { + capture $(pwd)/bin/detect $(pwd)/test/fixtures/$1 +} + +compile_dir="" + +default_process_types_cleanup() { + file="/tmp/default_process_types" + if [ -f "$file" ]; then + rm "$file" + fi +} + +compile() { + default_process_types_cleanup + bp_dir=$(mktmpdir) + compile_dir=$(mktmpdir) + cp -a $(pwd)/* ${bp_dir} + cp -a ${bp_dir}/test/fixtures/$1/. ${compile_dir} + capture ${bp_dir}/bin/compile ${compile_dir} ${2:-$(mktmpdir)} $3 +} + +compileDir() { + default_process_types_cleanup + + local bp_dir=$(mktmpdir) + local compile_dir=${1:-$(mktmpdir)} + local cache_dir=${2:-$(mktmpdir)} + local env_dir=$3 + + cp -a $(pwd)/* ${bp_dir} + capture ${bp_dir}/bin/compile ${compile_dir} ${cache_dir} ${env_dir} +} + +release() { + bp_dir=$(mktmpdir) + cp -a $(pwd)/* ${bp_dir} + capture ${bp_dir}/bin/release ${bp_dir}/test/fixtures/$1 +} + +assertFile() { + assertEquals "$1" "$(cat ${compile_dir}/$2)" +} From b156f237a22ed02526b53923d174c9eb50cde60e Mon Sep 17 00:00:00 2001 From: Casey Faist Date: Tue, 10 Sep 2019 12:08:31 -0700 Subject: [PATCH 02/17] breakout jobs --- .travis.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 482a40e..9075037 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,7 @@ language: ruby dist: trusty sudo: required + rvm: - 2.4.4 before_script: @@ -11,16 +12,16 @@ jobs: - stage: Bash linting (shellcheck) sudo: false script: make check - - stage: Stack Unit Tests - services: docker - env: STACK=heroku-18 - script: "./tests.sh" - - stage: Stack Unit Tests - services: docker - env: STACK=heroku-16 - script: "./tests.sh" - - stage: Hatchet Integration - script: "bundle exec rspec" + - stage: Build Docker Containers + script: + - docker build --pull --tag heroku-python-build-heroku-18 --file $(pwd)/builds/heroku-18.Dockerfile . + - stage: test + script: docker run --rm -ti heroku-python-build-heroku-18 bash test/run-deps + script: docker run --rm -ti heroku-python-build-heroku-18 bash test/run-versions + script: docker run --rm -ti heroku-python-build-heroku-18 bash test/run-features + - stages: Hatchet Integration + if: branch = master + script: "bundle exec rspec" env: global: - HATCHET_RETRIES=3 From 8366d66f54879b0eba2785915d1b14b581026506 Mon Sep 17 00:00:00 2001 From: Casey Faist Date: Tue, 10 Sep 2019 12:16:11 -0700 Subject: [PATCH 03/17] add pre-commit-hook for travis file --- .pre-commit-config.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c193863..30d1a71 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,3 +3,7 @@ repos: rev: 1.0.4 hooks: - id: shell-lint +- repo: git://github.com/alphagov/verify-travis-pre-commit-hook + sha: master + hooks: + - id: travis-yml-lint From 1479ab375ec1a07e8d12d615915ea137585f33b1 Mon Sep 17 00:00:00 2001 From: Casey Faist Date: Tue, 10 Sep 2019 13:33:55 -0700 Subject: [PATCH 04/17] ensure tabs are spaces --- .pre-commit-config.yaml | 12 +++++------- .travis.yml | 31 ++++++++++++++++--------------- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 30d1a71..7bc1e2f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,9 +1,7 @@ repos: -- repo: git://github.com/detailyang/pre-commit-shell - rev: 1.0.4 +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v2.3.0 hooks: - - id: shell-lint -- repo: git://github.com/alphagov/verify-travis-pre-commit-hook - sha: master - hooks: - - id: travis-yml-lint + # - id: check-yaml + - id: end-of-file-fixer + - id: trailing-whitespace diff --git a/.travis.yml b/.travis.yml index 9075037..99f0697 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,20 +13,21 @@ jobs: sudo: false script: make check - stage: Build Docker Containers - script: - - docker build --pull --tag heroku-python-build-heroku-18 --file $(pwd)/builds/heroku-18.Dockerfile . - - stage: test - script: docker run --rm -ti heroku-python-build-heroku-18 bash test/run-deps - script: docker run --rm -ti heroku-python-build-heroku-18 bash test/run-versions - script: docker run --rm -ti heroku-python-build-heroku-18 bash test/run-features - - stages: Hatchet Integration - if: branch = master - script: "bundle exec rspec" + name: Build Heroku 18 + script: docker build --pull --tag heroku-python-build-heroku-18 --file $(pwd)/builds/heroku-18.Dockerfile . + - stage: Test Runs + script: docker run --rm heroku-python-build-heroku-18 bash test/run-deps + script: docker run --rm heroku-python-build-heroku-18 bash test/run-versions + script: docker run --rm heroku-python-build-heroku-18 bash test/run-features + - stage: Hatchet Integration + if: branch = master + name: Run Hatchet + script: "bundle exec rspec" env: global: - - HATCHET_RETRIES=3 - - IS_RUNNING_ON_CI=true - - HATCHET_APP_LIMIT=5 - - HATCHET_DEPLOY_STRATEGY=git - - secure: yjtlPE5FbVxTKnjUy/tZUBgSEf4qADD3QOxtgziuid73S0U/1IEXlMGFULsQzIjtlHKmHeywZqpVVEpthIH4RuT7uoX1Pb7SSM/g0T8fT3VoEFbFK1uYl0oZQbUS4Klxv9tPiumj8if3m6ULEGIz1X0wZcMOC0tMLwVCnwmap0E= - - secure: ZeFTHWwnpIKE9nAqs88ocmiQh7bKce84lilGm5J23nf3N6V4wNyLwqlkvsM008WGBCaOg9AUx7ZunasT0ANsR5gLP3eV2UUg7ILdRgV2Gy13eNRFheC4PHdN92RqQ3aKoqlIv2K999xlhVjod0NzhkQQXB6PddfQINbuU7ks6As= + - HATCHET_RETRIES=3 + - IS_RUNNING_ON_CI=true + - HATCHET_APP_LIMIT=5 + - HATCHET_DEPLOY_STRATEGY=git + - secure: yjtlPE5FbVxTKnjUy/tZUBgSEf4qADD3QOxtgziuid73S0U/1IEXlMGFULsQzIjtlHKmHeywZqpVVEpthIH4RuT7uoX1Pb7SSM/g0T8fT3VoEFbFK1uYl0oZQbUS4Klxv9tPiumj8if3m6ULEGIz1X0wZcMOC0tMLwVCnwmap0E= + - secure: ZeFTHWwnpIKE9nAqs88ocmiQh7bKce84lilGm5J23nf3N6V4wNyLwqlkvsM008WGBCaOg9AUx7ZunasT0ANsR5gLP3eV2UUg7ILdRgV2Gy13eNRFheC4PHdN92RqQ3aKoqlIv2K999xlhVjod0NzhkQQXB6PddfQINbuU7ks6As= From 32cf8a86813c44ff190c1312c1be48d372f963a5 Mon Sep 17 00:00:00 2001 From: Casey Faist Date: Tue, 10 Sep 2019 13:44:22 -0700 Subject: [PATCH 05/17] fix dockerfile location typo --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 99f0697..70aa27f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ jobs: script: make check - stage: Build Docker Containers name: Build Heroku 18 - script: docker build --pull --tag heroku-python-build-heroku-18 --file $(pwd)/builds/heroku-18.Dockerfile . + script: docker build --pull --tag heroku-python-build-heroku-18 --file $(shell pwd)/Dockerfile.heroku-18 . - stage: Test Runs script: docker run --rm heroku-python-build-heroku-18 bash test/run-deps script: docker run --rm heroku-python-build-heroku-18 bash test/run-versions From bbdbebbc87645969d9724f59d8f13823251e4fac Mon Sep 17 00:00:00 2001 From: Casey Faist Date: Tue, 10 Sep 2019 13:50:09 -0700 Subject: [PATCH 06/17] shell command only needed when using make, remove --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 70aa27f..0149fad 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ jobs: script: make check - stage: Build Docker Containers name: Build Heroku 18 - script: docker build --pull --tag heroku-python-build-heroku-18 --file $(shell pwd)/Dockerfile.heroku-18 . + script: docker build --pull --tag heroku-python-build-heroku-18 --file $(pwd)/Dockerfile.heroku-18 . - stage: Test Runs script: docker run --rm heroku-python-build-heroku-18 bash test/run-deps script: docker run --rm heroku-python-build-heroku-18 bash test/run-versions From df779aaa9af13a3cca1c12738c792f0bc5f823dc Mon Sep 17 00:00:00 2001 From: Casey Faist Date: Tue, 10 Sep 2019 14:56:08 -0700 Subject: [PATCH 07/17] reorganize tests to stage per stack --- .travis.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0149fad..bc82218 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,12 +12,14 @@ jobs: - stage: Bash linting (shellcheck) sudo: false script: make check - - stage: Build Docker Containers + - stage: Heroku 18 Test name: Build Heroku 18 script: docker build --pull --tag heroku-python-build-heroku-18 --file $(pwd)/Dockerfile.heroku-18 . - - stage: Test Runs + name: Test Deps script: docker run --rm heroku-python-build-heroku-18 bash test/run-deps + name: Test Python Versions script: docker run --rm heroku-python-build-heroku-18 bash test/run-versions + name: Test Feature Steps script: docker run --rm heroku-python-build-heroku-18 bash test/run-features - stage: Hatchet Integration if: branch = master From 7eac72199ea8401c82f50dedf2cc4dd77095d8c5 Mon Sep 17 00:00:00 2001 From: Casey Faist Date: Tue, 10 Sep 2019 15:09:43 -0700 Subject: [PATCH 08/17] parallel test runs per stack --- .travis.yml | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index bc82218..14e0934 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,7 @@ rvm: before_script: - gem install bundler -v 1.16.2 - bundle exec hatchet ci:setup + - docker build --pull --tag heroku-python-build-heroku-18 --file $(pwd)/Dockerfile.heroku-18 . jobs: include: - stage: Bash linting (shellcheck) @@ -14,22 +15,19 @@ jobs: script: make check - stage: Heroku 18 Test name: Build Heroku 18 - script: docker build --pull --tag heroku-python-build-heroku-18 --file $(pwd)/Dockerfile.heroku-18 . - name: Test Deps - script: docker run --rm heroku-python-build-heroku-18 bash test/run-deps - name: Test Python Versions - script: docker run --rm heroku-python-build-heroku-18 bash test/run-versions - name: Test Feature Steps - script: docker run --rm heroku-python-build-heroku-18 bash test/run-features + script: docker run --rm heroku-python-build-heroku-18 bash $TESTFOLDER - stage: Hatchet Integration if: branch = master name: Run Hatchet script: "bundle exec rspec" env: global: - - HATCHET_RETRIES=3 - - IS_RUNNING_ON_CI=true - - HATCHET_APP_LIMIT=5 - - HATCHET_DEPLOY_STRATEGY=git - - secure: yjtlPE5FbVxTKnjUy/tZUBgSEf4qADD3QOxtgziuid73S0U/1IEXlMGFULsQzIjtlHKmHeywZqpVVEpthIH4RuT7uoX1Pb7SSM/g0T8fT3VoEFbFK1uYl0oZQbUS4Klxv9tPiumj8if3m6ULEGIz1X0wZcMOC0tMLwVCnwmap0E= - - secure: ZeFTHWwnpIKE9nAqs88ocmiQh7bKce84lilGm5J23nf3N6V4wNyLwqlkvsM008WGBCaOg9AUx7ZunasT0ANsR5gLP3eV2UUg7ILdRgV2Gy13eNRFheC4PHdN92RqQ3aKoqlIv2K999xlhVjod0NzhkQQXB6PddfQINbuU7ks6As= + secure: yjtlPE5FbVxTKnjUy/tZUBgSEf4qADD3QOxtgziuid73S0U/1IEXlMGFULsQzIjtlHKmHeywZqpVVEpthIH4RuT7uoX1Pb7SSM/g0T8fT3VoEFbFK1uYl0oZQbUS4Klxv9tPiumj8if3m6ULEGIz1X0wZcMOC0tMLwVCnwmap0E= + secure: ZeFTHWwnpIKE9nAqs88ocmiQh7bKce84lilGm5J23nf3N6V4wNyLwqlkvsM008WGBCaOg9AUx7ZunasT0ANsR5gLP3eV2UUg7ILdRgV2Gy13eNRFheC4PHdN92RqQ3aKoqlIv2K999xlhVjod0NzhkQQXB6PddfQINbuU7ks6As= + - TESTFOLDER=test/run-deps + - TESTFOLDER=test/run-versions + - TESTFOLDER=test/run-features + - HATCHET_RETRIES=3 + - IS_RUNNING_ON_CI=true + - HATCHET_APP_LIMIT=5 + - HATCHET_DEPLOY_STRATEGY=git From 0161b80a2b8cf4beff1241ad15cc49eff1ee4ec4 Mon Sep 17 00:00:00 2001 From: Casey Faist Date: Tue, 10 Sep 2019 15:15:29 -0700 Subject: [PATCH 09/17] correct hatchet setup --- .pre-commit-config.yaml | 2 +- .travis.yml | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7bc1e2f..859ac3d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,6 +2,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v2.3.0 hooks: - # - id: check-yaml + - id: check-yaml - id: end-of-file-fixer - id: trailing-whitespace diff --git a/.travis.yml b/.travis.yml index 14e0934..ada5d73 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,12 +22,12 @@ jobs: script: "bundle exec rspec" env: global: - secure: yjtlPE5FbVxTKnjUy/tZUBgSEf4qADD3QOxtgziuid73S0U/1IEXlMGFULsQzIjtlHKmHeywZqpVVEpthIH4RuT7uoX1Pb7SSM/g0T8fT3VoEFbFK1uYl0oZQbUS4Klxv9tPiumj8if3m6ULEGIz1X0wZcMOC0tMLwVCnwmap0E= - secure: ZeFTHWwnpIKE9nAqs88ocmiQh7bKce84lilGm5J23nf3N6V4wNyLwqlkvsM008WGBCaOg9AUx7ZunasT0ANsR5gLP3eV2UUg7ILdRgV2Gy13eNRFheC4PHdN92RqQ3aKoqlIv2K999xlhVjod0NzhkQQXB6PddfQINbuU7ks6As= - - TESTFOLDER=test/run-deps - - TESTFOLDER=test/run-versions - - TESTFOLDER=test/run-features - - HATCHET_RETRIES=3 - - IS_RUNNING_ON_CI=true - - HATCHET_APP_LIMIT=5 - - HATCHET_DEPLOY_STRATEGY=git + - HATCHET_RETRIES=3 + - IS_RUNNING_ON_CI=true + - HATCHET_APP_LIMIT=5 + - HATCHET_DEPLOY_STRATEGY=git + - TESTFOLDER=test/run-deps + - TESTFOLDER=test/run-versions + - TESTFOLDER=test/run-features + - secure: yjtlPE5FbVxTKnjUy/tZUBgSEf4qADD3QOxtgziuid73S0U/1IEXlMGFULsQzIjtlHKmHeywZqpVVEpthIH4RuT7uoX1Pb7SSM/g0T8fT3VoEFbFK1uYl0oZQbUS4Klxv9tPiumj8if3m6ULEGIz1X0wZcMOC0tMLwVCnwmap0E= + - secure: ZeFTHWwnpIKE9nAqs88ocmiQh7bKce84lilGm5J23nf3N6V4wNyLwqlkvsM008WGBCaOg9AUx7ZunasT0ANsR5gLP3eV2UUg7ILdRgV2Gy13eNRFheC4PHdN92RqQ3aKoqlIv2K999xlhVjod0NzhkQQXB6PddfQINbuU7ks6As= From 7d8ea3d266ba44dc0776993d8ff7c9c3de2fa342 Mon Sep 17 00:00:00 2001 From: Casey Faist Date: Tue, 10 Sep 2019 15:32:59 -0700 Subject: [PATCH 10/17] add stack value back in --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ada5d73..ce6c965 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ jobs: script: make check - stage: Heroku 18 Test name: Build Heroku 18 - script: docker run --rm heroku-python-build-heroku-18 bash $TESTFOLDER + script: docker run --rm -e "STACK=heroku-18" heroku-python-build-heroku-18 bash $TESTFOLDER - stage: Hatchet Integration if: branch = master name: Run Hatchet From 6a4ab8646a418df8128cc7375d4ba7a574df2583 Mon Sep 17 00:00:00 2001 From: Casey Faist Date: Tue, 10 Sep 2019 16:04:11 -0700 Subject: [PATCH 11/17] add ci nodes to test run --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index ce6c965..e485069 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,5 +29,9 @@ env: - TESTFOLDER=test/run-deps - TESTFOLDER=test/run-versions - TESTFOLDER=test/run-features + - CI_NODE_TOTAL=2 - secure: yjtlPE5FbVxTKnjUy/tZUBgSEf4qADD3QOxtgziuid73S0U/1IEXlMGFULsQzIjtlHKmHeywZqpVVEpthIH4RuT7uoX1Pb7SSM/g0T8fT3VoEFbFK1uYl0oZQbUS4Klxv9tPiumj8if3m6ULEGIz1X0wZcMOC0tMLwVCnwmap0E= - secure: ZeFTHWwnpIKE9nAqs88ocmiQh7bKce84lilGm5J23nf3N6V4wNyLwqlkvsM008WGBCaOg9AUx7ZunasT0ANsR5gLP3eV2UUg7ILdRgV2Gy13eNRFheC4PHdN92RqQ3aKoqlIv2K999xlhVjod0NzhkQQXB6PddfQINbuU7ks6As= + matrix: + - CI_NODE_INDEX=0 + - CI_NODE_INDEX=1 From 34a631021c46570064be98dbad026c79be9312d5 Mon Sep 17 00:00:00 2001 From: Casey Faist Date: Tue, 10 Sep 2019 16:36:13 -0700 Subject: [PATCH 12/17] update test runs to matrix --- .travis.yml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index e485069..b1bec08 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,15 +7,23 @@ rvm: before_script: - gem install bundler -v 1.16.2 - bundle exec hatchet ci:setup - - docker build --pull --tag heroku-python-build-heroku-18 --file $(pwd)/Dockerfile.heroku-18 . + +matrix: + include: + - name: Test Dependencies + env: TESTFOLDER=test/run-deps + - name: Test Python Versions + env: TESTFOLDER=test/run-versions + - name: Test Steps + env: TESTFOLDER=test/run-features +script: docker build --pull --tag heroku-python-build-heroku-18 --file $(pwd)/Dockerfile.heroku-18 . +after_script: docker run --rm -e "STACK=heroku-18" heroku-python-build-heroku-18 bash $TESTFOLDER + jobs: include: - stage: Bash linting (shellcheck) sudo: false script: make check - - stage: Heroku 18 Test - name: Build Heroku 18 - script: docker run --rm -e "STACK=heroku-18" heroku-python-build-heroku-18 bash $TESTFOLDER - stage: Hatchet Integration if: branch = master name: Run Hatchet @@ -26,12 +34,5 @@ env: - IS_RUNNING_ON_CI=true - HATCHET_APP_LIMIT=5 - HATCHET_DEPLOY_STRATEGY=git - - TESTFOLDER=test/run-deps - - TESTFOLDER=test/run-versions - - TESTFOLDER=test/run-features - - CI_NODE_TOTAL=2 - secure: yjtlPE5FbVxTKnjUy/tZUBgSEf4qADD3QOxtgziuid73S0U/1IEXlMGFULsQzIjtlHKmHeywZqpVVEpthIH4RuT7uoX1Pb7SSM/g0T8fT3VoEFbFK1uYl0oZQbUS4Klxv9tPiumj8if3m6ULEGIz1X0wZcMOC0tMLwVCnwmap0E= - secure: ZeFTHWwnpIKE9nAqs88ocmiQh7bKce84lilGm5J23nf3N6V4wNyLwqlkvsM008WGBCaOg9AUx7ZunasT0ANsR5gLP3eV2UUg7ILdRgV2Gy13eNRFheC4PHdN92RqQ3aKoqlIv2K999xlhVjod0NzhkQQXB6PddfQINbuU7ks6As= - matrix: - - CI_NODE_INDEX=0 - - CI_NODE_INDEX=1 From 59544ee7992483d37044b506b257ed9800dc76f6 Mon Sep 17 00:00:00 2001 From: Casey Faist Date: Tue, 10 Sep 2019 17:05:07 -0700 Subject: [PATCH 13/17] use keyword dockerfile to trigger matrix --- .travis.yml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index b1bec08..11cfd56 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,16 +8,7 @@ before_script: - gem install bundler -v 1.16.2 - bundle exec hatchet ci:setup -matrix: - include: - - name: Test Dependencies - env: TESTFOLDER=test/run-deps - - name: Test Python Versions - env: TESTFOLDER=test/run-versions - - name: Test Steps - env: TESTFOLDER=test/run-features -script: docker build --pull --tag heroku-python-build-heroku-18 --file $(pwd)/Dockerfile.heroku-18 . -after_script: docker run --rm -e "STACK=heroku-18" heroku-python-build-heroku-18 bash $TESTFOLDER +script: docker build --pull --file $(pwd)/${DOCKERFILE} .; docker run --rm -e "STACK=heroku-18" bash $TESTFOLDER jobs: include: @@ -29,6 +20,12 @@ jobs: name: Run Hatchet script: "bundle exec rspec" env: + matrix: + - TESTFOLDER=test/run-deps + - TESTFOLDER=test/run-versions + - TESTFOLDER=test/run-features + - DOCKERFILE=Dockerfile.heroku-18 + - DOCKERFILE=Dockerfile global: - HATCHET_RETRIES=3 - IS_RUNNING_ON_CI=true From 3d65278d61bd5e9f4d15e9f8bbd410530c0b8a54 Mon Sep 17 00:00:00 2001 From: Casey Faist Date: Tue, 10 Sep 2019 17:13:41 -0700 Subject: [PATCH 14/17] add multiple script steps to trigger matrix across docker files --- .travis.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 11cfd56..9ab8016 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,9 @@ before_script: - gem install bundler -v 1.16.2 - bundle exec hatchet ci:setup -script: docker build --pull --file $(pwd)/${DOCKERFILE} .; docker run --rm -e "STACK=heroku-18" bash $TESTFOLDER +script: + - docker build --pull --file $(pwd)/Dockerfile .; docker run --rm -e "STACK=heroku-18" bash $TESTFOLDER + - docker build --pull --file $(pwd)/Dockerfile.heroku-18 .; docker run --rm -e "STACK=heroku-18" bash $TESTFOLDER jobs: include: @@ -26,10 +28,13 @@ env: - TESTFOLDER=test/run-features - DOCKERFILE=Dockerfile.heroku-18 - DOCKERFILE=Dockerfile + - CI_NODE_INDEX=0 + - CI_NODE_INDEX=2 global: - HATCHET_RETRIES=3 - IS_RUNNING_ON_CI=true - HATCHET_APP_LIMIT=5 - HATCHET_DEPLOY_STRATEGY=git + - CI_NODE_TOTAL=2 - secure: yjtlPE5FbVxTKnjUy/tZUBgSEf4qADD3QOxtgziuid73S0U/1IEXlMGFULsQzIjtlHKmHeywZqpVVEpthIH4RuT7uoX1Pb7SSM/g0T8fT3VoEFbFK1uYl0oZQbUS4Klxv9tPiumj8if3m6ULEGIz1X0wZcMOC0tMLwVCnwmap0E= - secure: ZeFTHWwnpIKE9nAqs88ocmiQh7bKce84lilGm5J23nf3N6V4wNyLwqlkvsM008WGBCaOg9AUx7ZunasT0ANsR5gLP3eV2UUg7ILdRgV2Gy13eNRFheC4PHdN92RqQ3aKoqlIv2K999xlhVjod0NzhkQQXB6PddfQINbuU7ks6As= From 77b012dd6f42ff29f84bd376272c65ad6d104679 Mon Sep 17 00:00:00 2001 From: Casey Faist Date: Tue, 10 Sep 2019 17:22:53 -0700 Subject: [PATCH 15/17] add tags to docker scripts to pass images to test run cases --- .travis.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9ab8016..a95c09f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,8 +9,8 @@ before_script: - bundle exec hatchet ci:setup script: - - docker build --pull --file $(pwd)/Dockerfile .; docker run --rm -e "STACK=heroku-18" bash $TESTFOLDER - - docker build --pull --file $(pwd)/Dockerfile.heroku-18 .; docker run --rm -e "STACK=heroku-18" bash $TESTFOLDER + - docker build --pull travis-heroku-16 --file $(pwd)/Dockerfile .; docker run --rm -e "STACK=heroku-16" travis-heroku-16 bash $TESTFOLDER + - docker build --pull travis-heroku-18 --file $(pwd)/Dockerfile.heroku-18 .; docker run --rm -e "STACK=heroku-18" travis-heroku-18 bash $TESTFOLDER jobs: include: @@ -26,15 +26,10 @@ env: - TESTFOLDER=test/run-deps - TESTFOLDER=test/run-versions - TESTFOLDER=test/run-features - - DOCKERFILE=Dockerfile.heroku-18 - - DOCKERFILE=Dockerfile - - CI_NODE_INDEX=0 - - CI_NODE_INDEX=2 global: - HATCHET_RETRIES=3 - IS_RUNNING_ON_CI=true - HATCHET_APP_LIMIT=5 - HATCHET_DEPLOY_STRATEGY=git - - CI_NODE_TOTAL=2 - secure: yjtlPE5FbVxTKnjUy/tZUBgSEf4qADD3QOxtgziuid73S0U/1IEXlMGFULsQzIjtlHKmHeywZqpVVEpthIH4RuT7uoX1Pb7SSM/g0T8fT3VoEFbFK1uYl0oZQbUS4Klxv9tPiumj8if3m6ULEGIz1X0wZcMOC0tMLwVCnwmap0E= - secure: ZeFTHWwnpIKE9nAqs88ocmiQh7bKce84lilGm5J23nf3N6V4wNyLwqlkvsM008WGBCaOg9AUx7ZunasT0ANsR5gLP3eV2UUg7ILdRgV2Gy13eNRFheC4PHdN92RqQ3aKoqlIv2K999xlhVjod0NzhkQQXB6PddfQINbuU7ks6As= From de1696bb0225796d0cd2322b7b13ac35c3bb6291 Mon Sep 17 00:00:00 2001 From: Casey Faist Date: Tue, 10 Sep 2019 17:33:44 -0700 Subject: [PATCH 16/17] split out build and run script steps --- .travis.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index a95c09f..d56e8c8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,8 +9,10 @@ before_script: - bundle exec hatchet ci:setup script: - - docker build --pull travis-heroku-16 --file $(pwd)/Dockerfile .; docker run --rm -e "STACK=heroku-16" travis-heroku-16 bash $TESTFOLDER - - docker build --pull travis-heroku-18 --file $(pwd)/Dockerfile.heroku-18 .; docker run --rm -e "STACK=heroku-18" travis-heroku-18 bash $TESTFOLDER + - docker build --pull travis-heroku-16 --file $(pwd)/Dockerfile . + - docker run --rm -e "STACK=heroku-16" travis-heroku-16 bash $TESTFOLDER + - docker build --pull travis-heroku-18 --file $(pwd)/Dockerfile.heroku-18 . + - docker run --rm -e "STACK=heroku-18" travis-heroku-18 bash $TESTFOLDER jobs: include: From a379779d43e22cde9ae640972a6278c1b471f197 Mon Sep 17 00:00:00 2001 From: Casey Faist Date: Tue, 10 Sep 2019 17:52:54 -0700 Subject: [PATCH 17/17] add missing --tag option --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index d56e8c8..a161820 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,10 +9,10 @@ before_script: - bundle exec hatchet ci:setup script: - - docker build --pull travis-heroku-16 --file $(pwd)/Dockerfile . - - docker run --rm -e "STACK=heroku-16" travis-heroku-16 bash $TESTFOLDER - - docker build --pull travis-heroku-18 --file $(pwd)/Dockerfile.heroku-18 . - - docker run --rm -e "STACK=heroku-18" travis-heroku-18 bash $TESTFOLDER + - docker build --pull --tag heroku-python-build-heroku-16 --file $(pwd)/Dockerfile . + - docker run --rm -e "STACK=heroku-16" heroku-python-build-heroku-16 bash $TESTFOLDER + - docker build --pull --tag heroku-python-build-heroku-18 --file $(pwd)/Dockerfile.heroku-18 . + - docker run --rm -e "STACK=heroku-18" heroku-python-build-heroku-18 bash $TESTFOLDER jobs: include: