clemsonMakerspace / unified-makerspace

The Makerspace - now unified.
Apache License 2.0
9 stars 11 forks source link

Add lambda test, api test, fixed testing #145

Closed lrboyer closed 9 months ago

lrboyer commented 10 months ago

Added new lambda test for new /quiz api to test_quiz

Added new api_gateway test to test_api

Fixed pytest api testing

Added onto testing_script

Fixed warning in log_visit

Which is better: use raise Exception or assert?

Merge after https://github.com/clemsonMakerspace/unified-makerspace/pull/142

lrboyer commented 10 months ago

I have tested these test cases locally with pytest and the testing_script using my dev account (the new quiz api and lambda functionality) and they all pass.

lrboyer commented 10 months ago

Also would it make sense for api_test and the testing_script to be the mostly the same? The only extra thing testing_script would need would a handler function that will run all of the test and print the response. They basically have the same code except one uses pytest. But I'm guessing in the future we would want aws pipeline to run pytest and not our testing_script

Mjtlittle commented 9 months ago

It looks like the new tests here are failing because its failing to find the environment variable QUIZ_LIST_TABLE_NAME. In other tests (here) it looks like we are checking to see if None is passed and not looking to the environment for this value when that is the case.

lrboyer commented 9 months ago

It looks like the new tests here are failing because its failing to find the environment variable QUIZ_LIST_TABLE_NAME. In other tests (here) it looks like we are checking to see if None is passed and not looking to the environment for this value when that is the case.

It looks like the new tests here are failing because its failing to find the environment variable QUIZ_LIST_TABLE_NAME. In other tests (here) it looks like we are checking to see if None is passed and not looking to the environment for this value when that is the case.

I forgot to add these the new env variables here: https://github.com/clemsonMakerspace/unified-makerspace/blob/5422cedfa5b2b79f242c3e8d91c24101178c4fb5/.github/workflows/pytest.yml#L29