Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot run Edge function test in CI #2267

Open
riderx opened this issue May 12, 2024 · 2 comments
Open

Cannot run Edge function test in CI #2267

riderx opened this issue May 12, 2024 · 2 comments

Comments

@riderx
Copy link

riderx commented May 12, 2024

Describe the bug
This blog article describes how to run Deno test :
https://github.com/supabase/supabase/blob/master/apps/docs/content/guides/functions/unit-test.mdx

On my side, when I reproduce it, the serve function never releases the shell and the next step cannot be executed.

To Reproduce
Follow the exact step of the doc, also it seems the doc speak about folder supabase/tests but in the image just after it's supabase/functions/tests

Expected behavior
The example in the doc should work and run the test properly

Screenshots
CleanShot 2024-05-12 at 14 17 28@2x
I had to cancel the job after 6 min as it will just max out the GitHub action timeout
Link of the run:
https://github.com/Cap-go/capgo/actions/runs/9051465646/job/24868015866

@riderx riderx changed the title Cannot run test Deno test in CI Cannot run Edge function test in CI May 12, 2024
@riderx
Copy link
Author

riderx commented May 12, 2024

I did a PR to resolve the doc issue: supabase/supabase#26211

@riderx
Copy link
Author

riderx commented May 12, 2024

i managed to make test work on CI with this step:

      - uses: JarvusInnovations/background-action@v1
        name: Bootstrap Edge server
        with:
          run: supabase functions serve &
          wait-on: |
            http-get://127.0.0.1:54321/functions/v1/ok
          # IMPORTANT: to use environment variables in wait-on, you must use this form: ${{ env.VAR }}
          # See wait-on section below for all resource types and prefixes

          tail: true # true = stderr,stdout
          # This will allow you to monitor the progress live

          log-output-resume: stderr
          # Eliminates previously output stderr log entries from post-run output

          wait-for: 1m

          log-output: stderr,stdout # same as true

          log-output-if: failure
          # failure = exit-early or timeout

          working-directory: .

With a custom function, ok who direct respond.
Action who did pass here: https://github.com/Cap-go/capgo/actions/runs/9051894658/job/24868953981

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant