From aee54d1492fc6e60faa54e15355ebc2a37e1f740 Mon Sep 17 00:00:00 2001 From: Natalie Schultz <90212258+nataliejschultz@users.noreply.github.com> Date: Fri, 14 Jun 2024 17:11:19 -0600 Subject: [PATCH] Remove db host check + prints Figuring out why tests are passing locally and failing on github actions with prints. --- emission/individual_tests/TestOverpass.py | 2 ++ emission/individual_tests/setup_overpass_tests.sh | 6 ------ emission/net/ext_service/transit_matching/match_stops.py | 1 + 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/emission/individual_tests/TestOverpass.py b/emission/individual_tests/TestOverpass.py index f028d6817..7cffb197e 100644 --- a/emission/individual_tests/TestOverpass.py +++ b/emission/individual_tests/TestOverpass.py @@ -41,6 +41,7 @@ def test_overpass(self): #Test utilizes the functions get_stops_near, get_public_transit_stops, and make_request_and_catch. def test_get_stops_near(self): actual_result = enetm.get_stops_near(loc1, 150.0)[0]['routes'][0]['tags'] + print("ACTUAL_RESULT:", actual_result, type(actual_result)) expected_result = {'from': 'National Renewable Energy Lab', 'name': 'RTD Route 125: Red Rocks College', 'network': 'RTD', 'network:wikidata': 'Q7309183', 'network:wikipedia': 'en:Regional Transportation District', 'operator': 'Regional Transportation District', 'public_transport:version': '1', 'ref': '125', 'route': 'bus', 'to': 'Red Rocks College', 'type': 'route'} self.assertEqual(expected_result, actual_result) @@ -50,6 +51,7 @@ def test_get_predicted_transit_mode(self): stop1 = enetm.get_stops_near(loc2, 400.0) stop2 = enetm.get_stops_near(loc3, 400.0) actual_result = enetm.get_predicted_transit_mode(stop1, stop2) + print("ACTUAL TRANSIT MODE: ", actual_result) expected_result = ['train', 'train'] self.assertEqual(actual_result, expected_result) diff --git a/emission/individual_tests/setup_overpass_tests.sh b/emission/individual_tests/setup_overpass_tests.sh index 98aeebc9d..0d5b21474 100644 --- a/emission/individual_tests/setup_overpass_tests.sh +++ b/emission/individual_tests/setup_overpass_tests.sh @@ -4,12 +4,6 @@ cd /src/e-mission-server #set database URL using environment variable echo ${DB_HOST} -if [ -z ${DB_HOST} ] ; then - local_host=`hostname -i` - sed "s_localhost_${local_host}_" conf/storage/db.conf.sample > conf/storage/db.conf -else - sed "s_localhost_${DB_HOST}_" conf/storage/db.conf.sample > conf/storage/db.conf -fi cat conf/storage/db.conf echo "Setting up conda..." diff --git a/emission/net/ext_service/transit_matching/match_stops.py b/emission/net/ext_service/transit_matching/match_stops.py index 41d9dc80c..004dfd486 100644 --- a/emission/net/ext_service/transit_matching/match_stops.py +++ b/emission/net/ext_service/transit_matching/match_stops.py @@ -26,6 +26,7 @@ def make_request_and_catch(overpass_query): try: + print("***REQUEST_URL***", url) response = requests.post(url + "api/interpreter", data=overpass_query) except requests.exceptions.ChunkedEncodingError as e: logging.info("ChunkedEncodingError while creating request %s" % (e))