Skip to content
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

snapshot tests on shared snippets #243

Merged
merged 4 commits into from Nov 6, 2022
Merged

snapshot tests on shared snippets #243

merged 4 commits into from Nov 6, 2022

Conversation

felixroos
Copy link
Collaborator

This test runs a snapshot test on all snippets in the database. After adjusting the test runtime (added more mocks) + fixing some old snippets, all 289 snippets now run without error.

So far, I excluded the test from the normal test suite, as I want to fire requests from the test suite.

Either this test could be ran manually from time to test a potential breaking change on a larger set of snippets. Or we run it by default on a database dump that can be updated from time to time.

At a certain point it will be too much work to maintain user snippets (and keep the test green) as more people start using strudel, but for now it seems like a good way to get more data to test on.

Function specific unit tests are of course still important, but it seems that running tests on real world examples brings out situations that a unit test does not come encounter.

Another related question is how to handle / communicate the privacy aspect of the snippet sharing function, as user data is stored in the supabase, and with this test that data is also processed. It could also be a legal issue to collect user data without having a gdpr compliant text on the website but I don't know much about these laws

@felixroos felixroos marked this pull request as draft November 3, 2022 18:15
@felixroos felixroos marked this pull request as ready for review November 6, 2022 10:04
@felixroos
Copy link
Collaborator Author

I'll merge this now, added a dbdump. it's not part of the main test suite because it takes quite long, but it should be good to have that snapshot data to test from time to time

@felixroos felixroos merged commit c3d6de2 into main Nov 6, 2022
@felixroos felixroos deleted the shared-tests branch November 6, 2022 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant