next-auth icon indicating copy to clipboard operation
next-auth copied to clipboard

fix(supabase): local testing

Open ndom91 opened this issue 1 year ago • 4 comments

WIP

☕️ Reasoning

  • Existing @auth/supabase-adapter tests are broken and disabled in root package.json test script
  • Removes downloading supabase.deb Debian pkg in CI and adds installing the supabase CLI as an npm dev dependency

Testing Process

  1. Run supabase db start which spins up a local postgres container and will automatically run the migrations in supabase/migrations/*.
  2. 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.

image

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

ndom91 avatar May 10 '24 12:05 ndom91

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

vercel[bot] avatar May 10 '24 12:05 vercel[bot]

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher

View full report↗︎

socket-security[bot] avatar May 10 '24 12:05 socket-security[bot]

👍 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.

View full report↗︎

socket-security[bot] avatar May 10 '24 12:05 socket-security[bot]

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.

codecov[bot] avatar May 10 '24 12:05 codecov[bot]