DSGT-DLP / Deep-Learning-Playground

Web Application where people new to Deep Learning can input a dataset and toy around with basic Pytorch modules without writing any code
MIT License
24 stars 8 forks source link

Feature 1124 user table #1142

Closed ssh51117 closed 7 months ago

ssh51117 commented 7 months ago

# Updating User Table Endpoints and adding Unit Tests Added create, get, and delete for UserTable in Dynamodb. Also added unit tests for all commands Github Issue Number Here: <#1124> What user problem are we solving? There are no endpoints to hit the new UserTable in dynamodb What solution does this PR provide? Created the endpoints for all the commands. Also, created unit tests checking that the status codes returned are correct given certain responses from the table Testing Methodology

How did you test your changes and verify that existing functionality is not broken Used Postman to test the create, get, and delete functions. Ran unit tests to check for the correct status codes. Screenshot of unit tests:

image

Screen Recording of the functions working: https://youtu.be/-G3YUtXQBt8 Any other considerations using the create method with an already existing user_id will update the entry in the table. Also updated the handler export to turn it into a function instead of a constant, since the test was unable to import correctly when it was a constant. This did not break existing functionality in postman.

MugPand commented 7 months ago

The changes made in AppStack.test.ts verify the existence of the 3 user endpoints (POST, GET, DELETE), while the .test.ts files in serverless/packages/functions/src/user/tests validate the endpoint logic & responses from the individual endpoints. In the future, the same testing structure can be applied to newly created endpoints.

sonarcloud[bot] commented 7 months ago

Quality Gate Passed Quality Gate passed

Issues
13 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
1.7% Duplication on New Code

See analysis details on SonarCloud