Open-Assistant icon indicating copy to clipboard operation
Open-Assistant copied to clipboard

Write a website-to-backend communication test

Open yk opened this issue 2 years ago • 1 comments

Write a test that spins up backend and website, and checks whether the communication works as intended. The purpose of this is to check whether any change in the backend that we do in the future breaks the website's assumptions about the API and about the parameters & return values.

yk avatar Dec 30 '22 19:12 yk

Hey, I'm looking at picking this up. I assume we want to write an e2e test using cypress per https://github.com/LAION-AI/Open-Assistant/blob/main/website/cypress/README.md.

Also after trying to run the existing e2e test for login the current test doesn't run due to the presence of two methods for logging in, that looks fairly simple, but I figure we also want to actually login so that the website can get actual content from the db (I know we can do that with the debug auth but figure it is more important to test the production flow), I have a proof of concept of logging in and using the maildev link to login, looks to be working. But maybe fixing that should be a separate issue.

othrayte avatar Jan 01 '23 10:01 othrayte

Hi @othrayte thank you so much for the elaborations. Yes you're correct, the e2e tests should ideally capture some of the communication all the way to the db, although this issue here is more focused on the direct communication, such that when e.g. the API changes, the test can alert us that something in the website needs changing too. Obviously, any e2e test that would rely on that interface would also be appropriate. I'll assign you and I'll leave it up to you what exactly you want to do. Also, feel free to include fixing the current test at the same time, or make a separate issue for it, up to you!

yk avatar Jan 01 '23 18:01 yk

Related #204 (perhaps duplicate?)

AbdBarho avatar Jan 02 '23 06:01 AbdBarho

Related #204 (perhaps duplicate?)

the original description was a near-duplicate of contract-tests, yes, but this one has now morphed into e2e tests, which is really nice :)

yk avatar Jan 02 '23 11:01 yk