supabase / edge-runtime

A server based on Deno runtime, capable of running JavaScript, TypeScript, and WASM services.
MIT License
691 stars 62 forks source link

CI function do not behave the same as local #390

Open riderx opened 5 months ago

riderx commented 5 months ago

Describe the bug All functions test pass 100% of the time in local but often fail in CI/CD env.

*To Reproduce Steps to reproduce the behavior: In this repo: https://github.com/Cap-go/capgo In local, if I do :

on: push: branches:

jobs: test_base_sql: runs-on: ubuntu-latest name: "Run test" steps:

Both env run the same way and yet the CI/CD fail, you can see the history of github actions, some endpoint timeout weirdly

Expected behavior Localhost should fail the same way as CI/CD

riderx commented 5 months ago

I think i found my issue it was not exactly the same env

riderx commented 4 months ago

I had sadly to re-open it, it still happening. Example not passing : https://github.com/Cap-go/capgo/actions/runs/9909169516 And passing: https://github.com/Cap-go/capgo/actions/runs/9905586297 No change in the dependency used in edge functions

sweatybridge commented 4 months ago

Let me move this to functions repo who might have better knowledge of deno testing.

@nyannyacha 502 seems like a server side error from edge runtime. Are there any concurrency caveats with running edge runtime locally?

nyannyacha commented 4 months ago

I can see from the CI's logs that the status code was 502. However, this doesn't tell us much.

To determine the exact cause, it's a good idea to have the body returned by the edge runtime endpoint also be printed to the log.

Run deno test --allow-all supabase/functions/tests/* --env=supabase/.env.test --import-map=supabase/functions/import_map.json

I'm guessing from the flags given to the deno test that all test files and tests will be run sequentially.

502 seems like a server side error from edge runtime. Are there any concurrency caveats with running edge runtime locally?

I don't think I can advise anything at this point, as this command evaluates all tests sequentially as far as I know, so there's nothing to comment on for concurrency caveats in the edge runtime. 😓