You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to run my E2E tests also on CI, how am I supposed to set that up with supabase? What I have attempted is to recreate my local setup, so that my playwright container connects to supabase cli running locally. I'm having trouble getting that to run due to the envs created after setup. Am i supposed to have another supabase project for this? My pipeline below..
e2e:
name: Playwright E2Eruns-on: ubuntu-lateststeps:
- uses: actions/checkout@v4
- name: Set up Docker Buildxuses: docker/setup-buildx-action@v2
- name: Install Supabase CLIuses: supabase/setup-cli@v1with:
version: latest
- name: Fix host.docker.internal on Linuxrun: echo "127.0.0.1 host.docker.internal" | sudo tee -a /etc/hosts
- name: Start Supabase in backgroundrun: | supabase start --debug & # Poll if the containers are ready. # "supabase_db_react-router-supa-stack container is not ready: starting" # implies we have to wait. Typically, you can wait for port 54321 or check "supabase status". # Example approach: for i in {1..30}; do STATUS_JSON=$(supabase status --output json 2>/dev/null || echo "") if echo "$STATUS_JSON" | grep '"status":"running"' >/dev/null; then echo "Supabase is fully running" break fi echo "Waiting for supabase containers to be ready..." sleep 5 done
- name: Capture Local Supabase Inforun: | # Even after status:"running", give a short delay so the anon key is definitely available sleep 5 SUPABASE_URL="http://127.0.0.1:54321" # We parse the status JSON again (with a fallback if not found). STATUS_JSON=$(supabase status --output json 2>/dev/null || echo "") SUPABASE_ANON_KEY=$(echo "$STATUS_JSON" | jq -r '.api.anon_key // ""') if [ -z "$SUPABASE_ANON_KEY" ]; then echo "WARN: Could not retrieve anon key. Using local dev key as fallback." SUPABASE_ANON_KEY="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0" fi echo "SUPABASE_URL=$SUPABASE_URL" >> $GITHUB_ENV echo "SUPABASE_ANON_KEY=$SUPABASE_ANON_KEY" >> $GITHUB_ENV
- name: Build Playwright imagerun: docker build -f Dockerfile.playwright -t playwright-tests .
- name: Run Playwright e2erun: | docker run --rm \ -e SUPABASE_URL="${SUPABASE_URL}" \ -e SUPABASE_ANON_KEY="${SUPABASE_ANON_KEY}" \ -e BASE_URL="http://localhost:3000" \ playwright-tests
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I want to run my E2E tests also on CI, how am I supposed to set that up with supabase? What I have attempted is to recreate my local setup, so that my playwright container connects to supabase cli running locally. I'm having trouble getting that to run due to the envs created after setup. Am i supposed to have another supabase project for this? My pipeline below..
Beta Was this translation helpful? Give feedback.
All reactions