flagsmith icon indicating copy to clipboard operation
flagsmith copied to clipboard

chore: restrict external HTTP calls in tests

Open khvn26 opened this issue 1 year ago • 4 comments

Thanks for submitting a PR! Please check the boxes below:

  • [x] I have run pre-commit to check linting
  • [ ] I have added information to docs/ if required so people know about the feature!
  • [x] I have filled in the "Changes" section below?
  • [x] I have filled in the "How did you test this code" section below?
  • [x] I have used a Conventional Commit title for this Pull Request

Changes

This PR adds a global restriction of HTTP requests in unit tests. When an external HTTP call is detected, the test trying to perform it fails with a notice/instruction to developers.

This PR will also add fixes to the current offending tests.

How did you test this code?

Ran the test suite.

khvn26 avatar May 01 '24 11:05 khvn26

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 7, 2024 1:45pm
flagsmith-frontend-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 7, 2024 1:45pm
flagsmith-frontend-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 7, 2024 1:45pm

vercel[bot] avatar May 01 '24 11:05 vercel[bot]

Uffizzi Preview deployment-51096 was deleted.

github-actions[bot] avatar May 01 '24 11:05 github-actions[bot]

Codecov Report

Attention: Patch coverage is 90.90909% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 95.87%. Comparing base (53e728a) to head (9001537).

Files Patch % Lines
api/conftest.py 90.00% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3866      +/-   ##
==========================================
- Coverage   95.87%   95.87%   -0.01%     
==========================================
  Files        1133     1133              
  Lines       35873    35883      +10     
==========================================
+ Hits        34393    34402       +9     
- Misses       1480     1481       +1     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar May 03 '24 22:05 codecov-commenter

@matthewelwell This is now ready for review.

khvn26 avatar May 03 '24 22:05 khvn26