pittcsc / PittAPI

An API to easily get data from the University of Pittsburgh
https://pittapi.pittcsc.org
GNU General Public License v2.0
108 stars 33 forks source link

Disable non-mocked tests in GitHub workflows #167

Closed tianyizheng02 closed 4 months ago

tianyizheng02 commented 4 months ago

Contributes to #166

Temporarily disables tests/lab_test.py, tests/library_test.py, and tests/people_test.py for automated testing with pytest for GitHub workflows. This is because the tests in those files make real HTTP requests and do not mock their inputs, and this is causing those tests to fail on all incoming PRs (see issue #166). These tests should be reenaabled once they are rewritten to properly mock their inputs.

tianyizheng02 commented 4 months ago

=========================== short test summary info ============================
FAILED tests/dining_test.py::DiningTest::test_get_dining_locations - requests.exceptions.ConnectionError: Connection refused by Responses - the call doesn't match any registered mock.

Request: 
- GET https://api.dineoncampus.com/v1/locations/status?site_id=5e6fcc641ca48e0cacd93b04&platform=

Available matches:
- GET https://m.pitt.edu/dining/index.json?feed=dining_locations&_kgoui_object=kgoui_Rcontent_I2&start=0 URL does not match
- GET https://m.pitt.edu/dining/index.json?feed=dining_locations&_kgoui_object=kgoui_Rcontent_I2&start=10 URL does not match
- GET https://m.pitt.edu/dining/index.json?feed=dining_locations&_kgoui_object=kgoui_Rcontent_I2&start=20 URL does not match
FAILED tests/dining_test.py::DiningTest::test_get_dining_locations_by_status_closed - AttributeError: module 'pittapi.dining' has no attribute 'get_locations_by_status'
FAILED tests/dining_test.py::DiningTest::test_get_dining_locations_by_status_open - AttributeError: module 'pittapi.dining' has no attribute 'get_locations_by_status'
========================= 3 failed, 41 passed in 1.94s =========================

The only failing tests are those for dining_test.py, which will be fixed by #165, so we can safely ignore them.

tianyizheng02 commented 4 months ago

@nij-patel Could you first approve and merge this PR so that we can unblock the other PRs?