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

Add snapshot tests on a prod data extract #75

Open
AMDmi3 opened this issue Nov 15, 2024 · 2 comments
Open

Add snapshot tests on a prod data extract #75

AMDmi3 opened this issue Nov 15, 2024 · 2 comments
Labels
Component: webapp repology-webapp, repology web application Effort: complex Depends on huge refactoring or a lot of missing code Priority: someday Normal priority Topic: testing Tests & CI

Comments

@AMDmi3
Copy link
Member

AMDmi3 commented Nov 15, 2024

  • Add a script to fetch extract of production data (selected project names + most repos + a few related problems and history events), and turn it into sql test fixture.
  • Add insta backed tests for each endpoint.
@AMDmi3 AMDmi3 added Component: webapp repology-webapp, repology web application Effort: complex Depends on huge refactoring or a lot of missing code Priority: someday Normal priority Topic: testing Tests & CI labels Nov 15, 2024
AMDmi3 added a commit that referenced this issue Nov 28, 2024
This was supposed to work on production data extract, but it turned out
that there's no easy way to extract data conditionally and put it in for
of sql insert statements. So instead, just take fixtures and urls from
our integration tests and run snapshot testing on these.

IMO it's too early to put snapshots into the repository, so use case for
these tests is mostly local development, and for this purpose they are
hidden between snapshot-tests feature, and snapshots directory is added
go .gitignore. To use them, just run `make snapshot-tests` before and
after your changes.

While here, switch integration test fixtures to fixed timestamps to make
them suitable for snapshots.
@AMDmi3
Copy link
Member Author

AMDmi3 commented Nov 28, 2024

While here, we could use insta to simplify some integration tests where output data is not expected to change much:

  • opensearch
  • atom feeds
  • api endpoints

@AMDmi3
Copy link
Member Author

AMDmi3 commented Dec 21, 2024

It happened to be hard to extract prod data in form of sql statements, but it also turned out that regression test fixtures are suitable for this purpose. It makes sense to put snapshots into a separate repo and use it as a submodule, then we can enable snapshot tests unconditionally.

AMDmi3 added a commit that referenced this issue Dec 23, 2024
- Add snaphot test snapshots as a submodule
- Always enable snapshot tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: webapp repology-webapp, repology web application Effort: complex Depends on huge refactoring or a lot of missing code Priority: someday Normal priority Topic: testing Tests & CI
Projects
None yet
Development

No branches or pull requests

1 participant