Skip to content

Commit

Permalink
Remove db host check + prints
Browse files Browse the repository at this point in the history
Figuring out why tests are passing locally and failing on github actions with prints.
  • Loading branch information
nataliejschultz committed Jun 14, 2024
1 parent 41a9785 commit aee54d1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 2 additions & 0 deletions emission/individual_tests/TestOverpass.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)

Expand Down
6 changes: 0 additions & 6 deletions emission/individual_tests/setup_overpass_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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..."
Expand Down
1 change: 1 addition & 0 deletions emission/net/ext_service/transit_matching/match_stops.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit aee54d1

Please sign in to comment.