-
Notifications
You must be signed in to change notification settings - Fork 3
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
Figure out how to setup database/posts for test suite #445
Comments
This is a big problem and needs to get done asap for testing. There are two parts to this.
If a separate API is setup in the cloud, there's no guarantee that two people don't interrupt each other's testing. Also it will probably be slower to run tests. If done locally, we could use a docker image to startup the DB and API together. Front end will need a way to the add data they want to on startup. The easiest way without learning LINQ or telling me or Evan to add something to the database is probably a raw SQL file. The database container could be initialized by running the SQL file on startup. @evan-scales What do you think? |
I think this is probably the best way to do it. I don't necessarily think we need to add the API into the container (I'm not super experienced with Docker, not sure how difficult this would be) as long as we have the same reproducible database. I'm not sure how feasible it would be at this point to try and add a workflow for this, @evan-scales would have a better idea if it is or not. |
I could setup the docker containers. All that would need to be done on y'all end is edit an SQL file as needed and run one command to test everything. |
Ok, I'll look into making a SQL file. Is there any way to run the file as soon as the container is initialized? Probably don't want it running on every startup unless we reset the container on each test. |
An sql file is just a list of sql commands for PostgreSQL. Now that I think about it, most of the set up could probably be done in selenium as tests that run before everything else. |
It's doable, but probably not worth it for us. At my work to run the full behavioral tests we have a pipeline that creates a private environment on the cloud, then its able to do all of its tests. We can create a new api/db on azure dedicated to running behavioral tests. But they need to be updated/redeployed on each workflow run. But then we can't have 2 workflows running at the same time. So just a lot of hassle I think the best way to do this is go with @jbytes1027 approach. Plus would be nice to containerize the api. My experience with applying sample data is by creating a powershell script to run in the docker file. The script connects to the db and runs any sql files it needs to. Or the easiest option, make fake 'set up' tests that run before everything else. These ensure games/tags and whatever else are actually created |
When reviewing #441, I realized we need a good way to make sure that all the components we are testing are properly setup. For example, testing the filters currently requires the
Casual
tag to be created. We should either go ahead and test Create.jsx so that posts are created and we can assume the tags are created as well, or look into setting up a mock data script to apply to the database. We also need to setup users, x number of posts so that pagination can be tested, and more.Reproducible items needed:
The text was updated successfully, but these errors were encountered: