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

test: add tests for netlify functions #2493

Merged
merged 16 commits into from
Sep 13, 2024

Conversation

Shurtu-gal
Copy link
Contributor

Description

  • Added tests for netlify edge functions.
  • Workflow added to verify the tests. Sample run can be found here

Related issue(s)
Fixes #842

Copy link

netlify bot commented Dec 21, 2023

Deploy Preview for asyncapi-website ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 2dadccf
🔍 Latest deploy log https://app.netlify.com/sites/asyncapi-website/deploys/66e40dfd81ea6d0008fdec03
😎 Deploy Preview https://deploy-preview-2493--asyncapi-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@asyncapi-bot
Copy link
Contributor

asyncapi-bot commented Dec 21, 2023

⚡️ Lighthouse report for the changes in this PR:

Category Score
🔴 Performance 34
🟢 Accessibility 98
🟢 Best practices 92
🟢 SEO 100
🔴 PWA 33

Lighthouse ran on https://deploy-preview-2493--asyncapi-website.netlify.app/

Copy link
Member

@smoya smoya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is so great we are gonna have tests for this finally! 🙌 🙌 🙌 🙌

I left some comments containing suggestions and change requests.

* assert returned content type
@Shurtu-gal Shurtu-gal requested a review from smoya December 22, 2023 09:34
@smoya
Copy link
Member

smoya commented Jan 8, 2024

@Shurtu-gal In order to clarify the desired coverage of the test, I created the following flowchart explaining the flow the edge function should accomplish.

EDIT: please find it here.

Based on that, I believe we should have a test for each result of every decision (diamonds).

WDYT?

Copy link

This pull request has been automatically marked as stale because it has not had recent activity 😴

It will be closed in 120 days if no further activity occurs. To unstale this pull request, add a comment with detailed explanation.

There can be many reasons why some specific pull request has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this pull request forward. Connect with us through one of many communication channels we established here.

Thank you for your patience ❤️

@github-actions github-actions bot added the stale label May 12, 2024
@smoya
Copy link
Member

smoya commented May 20, 2024

@Shurtu-gal are you still up on this?

@Shurtu-gal
Copy link
Contributor Author

@Shurtu-gal are you still up on this?

Yeah, sorry this totally went out of my mind. Let me look at it again. Might need some time to get what I was doing though 🤣

@github-actions github-actions bot removed the stale label May 21, 2024
@Shurtu-gal
Copy link
Contributor Author

/ptal

@asyncapi-bot
Copy link
Contributor

@derberg @magicmatatjahu @akshatnema @sambhavgupta0705 @anshgoyalevil @Mayaleeeee Please take a look at this PR. Thanks! 👋

Copy link
Collaborator

@TRohit20 TRohit20 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but looping @smoya @akshatnema for concrete approval & merge

@smoya
Copy link
Member

smoya commented May 30, 2024

@Shurtu-gal Are all test cases from https://github.com/asyncapi/website?tab=readme-ov-file#json-schema-definitions (decisions are diamonds) tested 🤔 ?

@Shurtu-gal
Copy link
Contributor Author

@Shurtu-gal Are all test cases from https://github.com/asyncapi/website?tab=readme-ov-file#json-schema-definitions (decisions are diamonds) tested 🤔 ?

I think so. Please let me know if sth is missing.

Copy link
Member

@smoya smoya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🚀🌔

@smoya
Copy link
Member

smoya commented Jun 3, 2024

/ptal

@asyncapi-bot
Copy link
Contributor

@derberg @magicmatatjahu @akshatnema @sambhavgupta0705 @anshgoyalevil @Mayaleeeee Please take a look at this PR. Thanks! 👋

@Shurtu-gal
Copy link
Contributor Author

/u

@Shurtu-gal Shurtu-gal requested a review from TRohit20 June 3, 2024 13:17
@Shurtu-gal
Copy link
Contributor Author

Does anybody know how to make paths work in both windows and linux for jest tests?

Context: https://github.com/asyncapi/website/actions/runs/10040697813/job/27747254031?pr=2493#step:10:9

@Shurtu-gal
Copy link
Contributor Author

/ptal

@asyncapi-bot
Copy link
Contributor

@derberg @magicmatatjahu @akshatnema @sambhavgupta0705 @anshgoyalevil @Mayaleeeee Please take a look at this PR. Thanks! 👋

Copy link
Member

@anshgoyalevil anshgoyalevil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Shurtu-gal 🚢

@anshgoyalevil
Copy link
Member

/rtm

@asyncapi-bot asyncapi-bot merged commit 9f6308c into asyncapi:master Sep 13, 2024
15 checks passed
@Shurtu-gal Shurtu-gal deleted the test/netlify branch September 13, 2024 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Investigate how to test Netlify Edge Functions
5 participants