Skip to content
This repository has been archived by the owner on Feb 15, 2025. It is now read-only.

Commit

Permalink
fix: make errors when supabase is unavailable (#814)
Browse files Browse the repository at this point in the history
  • Loading branch information
gphorvath authored Jul 23, 2024
1 parent 549034b commit 976635c
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions tests/make-tests.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
SUPABASE_URL := $(shell cd src/leapfrogai_api; supabase status | awk '/API URL:/ {print $$3}')
SUPABASE_ANON_KEY := $(shell cd src/leapfrogai_api; supabase status | awk '/anon key:/ {print $$3}')

set-supabase:
SUPABASE_URL := $(shell cd src/leapfrogai_api; supabase status | awk '/API URL:/ {print $$3}')
SUPABASE_ANON_KEY := $(shell cd src/leapfrogai_api; supabase status | awk '/anon key:/ {print $$3}')

define get_jwt_token
echo "Getting JWT token from ${SUPABASE_URL}..."; \
Expand All @@ -15,21 +17,21 @@ define get_jwt_token
echo "DONE - variables exported to .env file"
endef

test-user:
test-user: set-supabase
@read -s -p "Enter a new DEV API password: " SUPABASE_PASS; echo; \
echo "Creating new supabase user..."; \
$(call get_jwt_token,"${SUPABASE_URL}/auth/v1/signup")

test-env:
test-env: set-supabase
@read -s -p "Enter your DEV API password: " SUPABASE_PASS; echo; \
$(call get_jwt_token,"${SUPABASE_URL}/auth/v1/token?grant_type=password")

test-int-api:
source .env; PYTHONPATH=$$(pwd) pytest -vv -s tests/integration/api
test-int-api: set-supabase
source .env; PYTHONPATH=$$(pwd) pytest -vv -s tests/integration/api

test-unit:
test-unit: set-supabase
PYTHONPATH=$$(pwd) pytest -vv -s tests/unit

debug:
debug: set-supabase
@echo ${SUPABASE_URL}
@echo ${SUPABASE_ANON_KEY}

0 comments on commit 976635c

Please sign in to comment.