cli: Error running `supabase test db` in fresh project

Describe the bug

I’ve set up a fresh project, a basic table, and a smoke test file (SELECT ok(true, 'true is true');).

However, when I try to run my tests, I get the following error. Supabase is definitely running locally and is connectable. All other commands work as normal.

There are no issues in the docker containers’ logs.

> supabase db test --debug
Supabase CLI 1.64.8
2023/06/03 14:52:36 Sent Header: Host [docker]
2023/06/03 14:52:36 Sent Header: User-Agent [Go-http-client/1.1]
2023/06/03 14:52:36 Sent Header: Content-Length [2048]
2023/06/03 14:52:36 Sent Header: Content-Type [text/plain]
2023/06/03 14:52:36 Send Done
2023/06/03 14:52:36 Recv First Byte
2023/06/03 14:52:36 Sent Header: Host [docker]
2023/06/03 14:52:36 Sent Header: User-Agent [Go-http-client/1.1]
2023/06/03 14:52:36 Sent Header: Content-Length [1164]
2023/06/03 14:52:36 Sent Header: Content-Type [application/json]
2023/06/03 14:52:36 Send Done
2023/06/03 14:52:36 Recv First Byte
E: List directory /var/lib/apt/lists/partial is missing. - Acquire (2: No such file or directory)  # <-- THE ERROR
2023/06/03 14:52:37 Sent Header: Host [docker]
2023/06/03 14:52:37 Sent Header: User-Agent [Go-http-client/1.1]
2023/06/03 14:52:37 Send Done
2023/06/03 14:52:37 Recv First Byte
Error: error executing command

To Reproduce

  1. Generate a fresh project.
  2. Create a basic test.
  3. Run supabase test db.
  4. See error.

Desktop (please complete the following information):

  • OS: OSX 13.3.1
  • Version of CLI: 1.64.8
  • Version of Node.js: 18.16.0

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 17 (7 by maintainers)

Most upvoted comments

@soedirgo supabase db test /tmp/supabase/tests/smoketest.sql .. ok All tests successful. Files=1, Tests=1, 0 wallclock secs ( 0.02 usr 0.03 sys + 0.02 cusr 0.02 csys = 0.09 CPU) Result: PASS

@CareTiger yup, we have changed our release process for brew and scoop to follow a 2 week cadence for stability.

If you want to try our latest pre-release version, you can use the beta channel on npm:

npx supabase@beta help

after following the above instructions i ran db test again and it seems to work. here is the output.

CONTEXT:  PL/pgSQL function _get_latest(text) line 10 at RAISE
PL/pgSQL function _todo() line 9 at assignment
PL/pgSQL function ok(boolean,text) line 9 at assignment
/tmp/supabase/tests/smoketest.sql .. 
Dubious, test returned 3 (wstat 768, 0x300)
No subtests run 

Test Summary Report
-------------------
/tmp/supabase/tests/smoketest.sql (Wstat: 768 Tests: 0 Failed: 0)
  Non-zero exit status: 3
  Parse errors: No plan found in TAP output
Files=1, Tests=0,  0 wallclock secs ( 0.03 usr  0.02 sys +  0.05 cusr  0.05 csys =  0.15 CPU)
Result: FAIL
Error: error executing command
Try rerunning the command with --debug to troubleshoot the error.```