@@ -6,7 +6,7 @@ ROOT_DIR := $(CURDIR)
66BUILDPACK_DIR := $(ROOT_DIR )
77PYTHON_BIN ?= python3
88
9- .PHONY : test-buildpack clean-test-buildpack start-local
9+ .PHONY : test-buildpack clean-test-buildpack smoke-test start-local
1010
1111# Reset the temporary staging directories used for local buildpack testing.
1212clean-test-buildpack :
@@ -17,15 +17,22 @@ clean-test-buildpack:
1717test-buildpack : clean-test-buildpack
1818 mkdir -p $(BUILD_DIR ) $(CACHE_DIR ) $(ENV_DIR )
1919 cp -R $(APP_DIR ) /. $(BUILD_DIR )
20- cd $(APP_DIR ) && ../../bin/detect
20+ # Run detect from the fixture app directory, but use the buildpack script from the repo root.
21+ cd $(APP_DIR ) && $(BUILDPACK_DIR ) /bin/detect
2122 $(BUILDPACK_DIR ) /bin/compile $(BUILD_DIR ) $(CACHE_DIR ) $(ENV_DIR )
23+ # Confirm staged dependencies are importable before checking the release metadata.
2224 cd $(BUILD_DIR ) && /bin/bash -lc ' source .profile.d/python.sh && $(PYTHON_BIN) -c "import fastapi; print(fastapi.__version__)"'
2325 cd $(BUILD_DIR ) && $(BUILDPACK_DIR ) /bin/release
2426
27+ # Run the single-app smoke test target against every app fixture under test/smoke.
28+ smoke-test :
29+ @./scripts/smoke-test.sh
30+
2531# Start the staged sample app locally using the dependencies prepared by `test-buildpack`.
2632start-local :
2733 @cd $(BUILD_DIR ) && /bin/bash -lc ' \
2834 source .profile.d/python.sh && \
35+ # Prefer the app Procfile, otherwise reuse the buildpack release logic. \
2936 if [ -f Procfile ]; then \
3037 WEB_CMD=$$(awk -F": " '\''$$1 == "web" { print $$2; exit }'\'' Procfile ) ; \
3138 else \
@@ -35,5 +42,6 @@ start-local:
3542 echo " Could not determine a web command to run locally." ; \
3643 exit 1; \
3744 fi ; \
45+ # Local machines often expose `python3` instead of `python`, so normalize that here. \
3846 WEB_CMD=$$(printf "%s" "$$WEB_CMD" | sed "s/^python /$(PYTHON_BIN ) /" ) ; \
3947 eval " $$ WEB_CMD" '
0 commit comments