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

Unit-testing: Consider using mocked responses when using external APIs #197

Open
gudmdharalds opened this issue Aug 12, 2021 · 0 comments
Open

Comments

@gudmdharalds
Copy link
Contributor

gudmdharalds commented Aug 12, 2021

Currently, the unit-tests use external APIs directly during testing. This has a number of downsides:

  • External APIs have to be 100% reliant while running unit-tests.
  • External data can go inconsistent, leading to unit-test failing.
  • The approach costs more resources and takes longer time.
  • API calls are sometimes rate-limited, which we have sometimes had problems with.

Originally, unit-tests were implemented this way due to simplicity of this approach. However, it has become less sustainable as the complexity of the project increases and unit-tests get more important.

We should consider implementing mocked API responses in the unit-test suite and move into this direction over time. There should be an option to skip the mocked tests intended for manual running of full test suite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant