mirror of
https://github.com/kennethreitz/heroku-buildpack-python.git
synced 2026-06-05 15:00:19 +00:00
93a5b4021d
Previously `make test` ran all unit test suites against all stacks, which would take up to an hour locally. This could be sped up by using one of the stack-specific targets (such as `make test-heroku-18`), however there was still no way to only run one of the test suites. Now `make test` can be controlled more precisely using optional `STACK` and `TEST_CMD` arguments, eg: `make test STACK=heroku-16 TEST_CMD=test/versions` Travis has now been made to use this feature, which unblocks future Travis speedups (such as splitting the jobs up further in #1018) and means on Travis the correct Docker image is now used (see #958). The `tests.sh` script has been removed since it's unused after #839 and redundant given the make targets. Fixes #958. Fixes #1020.
56 lines
2.1 KiB
Makefile
56 lines
2.1 KiB
Makefile
# These targets are not files
|
|
.PHONY: check test buildenv-heroku-16 buildenv-heroku-18 tools
|
|
|
|
STACK ?= heroku-18
|
|
TEST_CMD ?= test/run-versions && test/run-features && test/run-deps
|
|
|
|
ifeq ($(STACK),cedar-14)
|
|
# Cedar-14 doesn't have a build image varient.
|
|
IMAGE_TAG := heroku/cedar:14
|
|
else
|
|
# Converts a stack name of `heroku-NN` to its build Docker image tag of `heroku/heroku:NN-build`.
|
|
IMAGE_TAG := heroku/$(subst -,:,$(STACK))-build
|
|
endif
|
|
|
|
check:
|
|
@shellcheck -x bin/compile bin/detect bin/release bin/test-compile bin/utils bin/warnings bin/default_pythons
|
|
@shellcheck -x bin/steps/collectstatic bin/steps/eggpath-fix bin/steps/eggpath-fix2 bin/steps/gdal bin/steps/geo-libs bin/steps/mercurial bin/steps/nltk bin/steps/pip-install bin/steps/pip-uninstall bin/steps/pipenv bin/steps/pipenv-python-version bin/steps/pylibmc bin/steps/python
|
|
@shellcheck -x bin/steps/hooks/*
|
|
|
|
test:
|
|
@echo "Running tests using: STACK=$(STACK) TEST_CMD='$(TEST_CMD)'"
|
|
@echo ""
|
|
@docker run --rm -it -v $(PWD):/buildpack:ro -e "STACK=$(STACK)" "$(IMAGE_TAG)" bash -c 'cp -r /buildpack /buildpack_test && cd /buildpack_test && $(TEST_CMD)'
|
|
@echo ""
|
|
|
|
buildenv-heroku-16:
|
|
@echo "Creating build environment (heroku-16)..."
|
|
@echo
|
|
@docker build --pull -f $(shell pwd)/builds/heroku-16.Dockerfile -t python-buildenv-heroku-16 .
|
|
@echo
|
|
@echo "Usage..."
|
|
@echo
|
|
@echo " $$ export AWS_ACCESS_KEY_ID=foo AWS_SECRET_ACCESS_KEY=bar # Optional unless deploying"
|
|
@echo " $$ bob build runtimes/python-2.7.13"
|
|
@echo " $$ bob deploy runtimes/python-2.7.13"
|
|
@echo
|
|
@docker run -it --rm python-buildenv-heroku-16
|
|
|
|
buildenv-heroku-18:
|
|
@echo "Creating build environment (heroku-18)..."
|
|
@echo
|
|
@docker build --pull -f $(shell pwd)/builds/heroku-18.Dockerfile -t python-buildenv-heroku-18 .
|
|
@echo
|
|
@echo "Usage..."
|
|
@echo
|
|
@echo " $$ export AWS_ACCESS_KEY_ID=foo AWS_SECRET_ACCESS_KEY=bar # Optional unless deploying"
|
|
@echo " $$ bob build runtimes/python-2.7.13"
|
|
@echo " $$ bob deploy runtimes/python-2.7.13"
|
|
@echo
|
|
@docker run -it --rm python-buildenv-heroku-18
|
|
|
|
tools:
|
|
git clone https://github.com/kennethreitz/pip-pop.git
|
|
mv pip-pop/bin/* vendor/pip-pop/
|
|
rm -fr pip-pop
|