fix(supabase): local testing
WIP
☕️ Reasoning
- Existing
@auth/supabase-adaptertests are broken and disabled in rootpackage.jsontestscript - Removes downloading
supabase.debDebian pkg in CI and adds installing thesupabaseCLI as an npm dev dependency
Testing Process
- Run
supabase db startwhich spins up a local postgres container and will automatically run the migrations insupabase/migrations/*. - Connect to that postgres instance via the supabase client in the tests (
/packages/adapter-supabase/test/index.test.ts)
This is where this PR is currently stuck. I can't get the Supabase client to connect. We don't have a supabase anon_key in this setup since we're not linked to any supabase cloud project. Running that supabase CLI cmd above seems to only start a postgres container and run migrations. It doesn't init anything else related to local supabase emulation, etc. and doesn't print out any keys / secrets we could use to connect via the supabase js client.
I want these tests to be able to run locally completely without a supabase account. Not sure if that's possible yet. Will investigate a bit further when I have more time
The tests all error out with Fetch Failed without any further details, see below. The Postgres container logs include a line, LOG: invalid length of startup packet for each connection attempt from the client in the tests.
Notes
- https://supabase.com/docs/guides/cli/local-development?queryGroups=access-method&access-method=kong
- https://supabase.com/docs/reference/cli/supabase-db#supabase-db-start
🧢 Checklist
- [ ] Documentation
- [ ] Tests
- [ ] Ready to be merged
🎫 Affected issues
📌 Resources
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| auth-docs | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | May 13, 2024 4:01pm |
2 Ignored Deployments
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| next-auth-docs | ⬜️ Ignored (Inspect) | Visit Preview | May 13, 2024 4:01pm | |
| proxy | ⬜️ Ignored (Inspect) | Visit Preview | May 13, 2024 4:01pm |
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
| Package | New capabilities | Transitives | Size | Publisher |
|---|
👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎
This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 38.47%. Comparing base (
f255fb4) to head (49b5d1f).
Additional details and impacted files
@@ Coverage Diff @@
## main #10873 +/- ##
==========================================
+ Coverage 37.64% 38.47% +0.83%
==========================================
Files 174 175 +1
Lines 27109 27476 +367
Branches 1177 1218 +41
==========================================
+ Hits 10204 10571 +367
Misses 16905 16905
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.