Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Make errors when supabase is unavailable #814

Merged
merged 1 commit into from
Jul 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}
Loading