From dc9971f8049b3662cd9c3ab2e26a61ad9111d190 Mon Sep 17 00:00:00 2001 From: David Brownman <109395161+xavdid-stripe@users.noreply.github.com> Date: Tue, 7 May 2024 11:12:40 -0700 Subject: [PATCH] add local pre-req script to bail early if tests will fail (#2083) add local pre-req script to bail early if tests will fail --- Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 51c7bd6187..22a47cedd1 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: codegen-format update-version test ci-test +.PHONY: codegen-format update-version test check-prereqs ci-test update-version: @echo "$(VERSION)" > VERSION @perl -pi -e 's|"version": "[.\-\d\w]+"|"version": "$(VERSION)"|' package.json @@ -10,4 +10,10 @@ codegen-format: ci-test: yarn && yarn test -test: ci-test +check-prereqs: +# tests depend on `deno` being available + @command -v deno >/dev/null 2>&1 || { echo "Error: deno is not installed." >&2; exit 1; } +# stripe mock must be running; check its default port for a listener + @lsof -i :12112 >/dev/null 2>&1 || { echo "Error: stripe-mock is not running (on port 12112)." >&2; exit 1; } + +test: check-prereqs ci-test