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

[Feature Request] Transfer weather function test from calling real API to using Mock #504

Open
2 tasks done
yiyiyi0817 opened this issue Apr 12, 2024 · 0 comments
Open
2 tasks done
Assignees
Labels

Comments

@yiyiyi0817
Copy link
Member

Required prerequisites

Motivation

During our CI/CD testing process, I've noticed that test_weather_function.py has intermittently failed on several occasions. The root cause appears to be missing information from the real weather API that our tests depend on. These failures are sporadic, suggesting that the issue might be with the availability or consistency of the data provided by the API.

Solution

To address this issue and improve the reliability and speed of our testing process, I propose that we switch to using mock tests for the portions of test_weather_function.py that rely on the real API. By mocking the API responses, we can ensure that our tests are not only faster but also more stable, as they would no longer be dependent on external factors such as network issues.

Alternatives

Benefits of Using Mock Tests

  1. Increased Test Stability: Mocking the API responses would eliminate the sporadic failures caused by missing information in the real API responses.
  2. Improved Test Speed: Tests that do not rely on real API calls are generally faster, as they avoid network latency and delays.
  3. Consistent Test Environment: Mock tests ensure that the data used in tests is consistent, allowing us to predict and assert outcomes accurately.

Additional context

Looking forward to your thoughts and suggestions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Backlog
Development

No branches or pull requests

2 participants