Deep-Learning-Playground icon indicating copy to clipboard operation
Deep-Learning-Playground copied to clipboard

[FEATURE]: Write Tests for serverless lambdas

Open dwu359 opened this issue 2 years ago • 3 comments

Feature Name

Write Tests for serverless lambdas

Your Name

Daniel Wu

Description

This issue is best started once #914 is complete.

Write tests to test the serverless lambda endpoints created through SST, one for trainspaces and another for user-uploaded datasets. For each test, use existing endpoints to implement in this order:

  • Add a new item
  • Check if the id of that item exists and has the content of the item u just added
  • Check if the item exists when you list the items out
  • Delete the item
  • Check that the id of that item doesn't exist
  • Check that the item doesn't exist when you list the items out

It is best to use vitest as the testing framework for this, since that is the one that is most supported with SST.

dwu359 avatar Aug 21 '23 02:08 dwu359

Hello @dwu359! Thank you for submitting the Feature Request Form. We appreciate your contribution. :wave:

We will look into it and provide a response as soon as possible.

To work on this feature request, you can follow these branch setup instructions:

  1. Checkout the main branch:
```
 git checkout nextjs
```
  1. Pull the latest changes from the remote main branch:
```
 git pull origin nextjs
```
  1. Create a new branch specific to this feature request using the issue number:
```
 git checkout -b feature-916
```

Feel free to make the necessary changes in this branch and submit a pull request when you're ready.

Best regards, Deep Learning Playground (DLP) Team

github-actions[bot] avatar Aug 21 '23 02:08 github-actions[bot]

@dwu359 does vitest do mocking under the hood or it actually makes the server calls for real?

karkir0003 avatar Aug 21 '23 02:08 karkir0003

example usage of vitest in sst: https://sst.dev/chapters/unit-tests-in-serverless.html

karkir0003 avatar Oct 02 '23 14:10 karkir0003