Skip to content

Commit

Permalink
using different template dir for tests #45
Browse files Browse the repository at this point in the history
  • Loading branch information
behrisch committed Jul 27, 2022
1 parent f9db7f8 commit 9238bd1
Show file tree
Hide file tree
Showing 32 changed files with 82 additions and 77 deletions.
4 changes: 2 additions & 2 deletions db_manipulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ def start(options, call, pre_test, par_test, post_test):
process_db_manipulator = multiprocessing.Process(
target=run_instructions, args=(options, par_test))
process_db_manipulator.start()
print("starting main")
print("starting main", call)
sys.stdout.flush()
subprocess.call(call)
subprocess.check_call(call)
sys.stdout.flush()
sys.stderr.flush()
if process_db_manipulator:
Expand Down
1 change: 1 addition & 0 deletions tests/tsc/config.tsc
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ output:Removing sharp turn .*
output:AStarRouter spent .*
output:parsing .*tsccfg{REPLACE parsing <tsccfg>}
output:No module named scripts{REPLACE No module named 'scripts'}
output:starting main.*{REPLACE starting main <cmd>}
errors:Exception AttributeError: AttributeError("'NoneType' object has no attribute 'Error_GetErrorCount'",) in <bound method
errors:Network contains internal links which are ignored.
errors:Ran [0-9]+ tests in [0-9]+\.[0-9]+s{REPLACE Ran <COUNT> tests in <TIME>}
Expand Down

This file was deleted.

12 changes: 7 additions & 5 deletions tests/tsc/template/threeIterationsDeleteNonFinal/catalogue.tsc
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
The following new files/directories were created:
<Test Directory>
----__pycache__
--------tscdefs.cpython-310.pyc
--------tscdefs.cpython-38.pyc
----data
--------tsc.log
--------scenario_templates
------------mitte_net
----------------__pycache__
--------------------__init__.cpython-310.pyc
--------scenario_workdir
------------mitte_net
----------------Berlin_1223.taz.xml
Expand Down Expand Up @@ -38,3 +34,9 @@ The following new files/directories were created:
------------------------rectified_twoPersonsOnly.csv
------------------------t2s_map_twoPersonsOnly.log
------------------------t2s_rectify_twoPersonsOnly.log
--------test_templates
------------__pycache__
----------------__init__.cpython-38.pyc
------------mitte_net
----------------__pycache__
--------------------__init__.cpython-38.pyc
12 changes: 7 additions & 5 deletions tests/tsc/template/threeIterationsDeleteTemp/catalogue.tsc
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
The following new files/directories were created:
<Test Directory>
----__pycache__
--------tscdefs.cpython-310.pyc
--------tscdefs.cpython-38.pyc
----data
--------tsc.log
--------scenario_templates
------------mitte_net
----------------__pycache__
--------------------__init__.cpython-310.pyc
--------scenario_workdir
------------mitte_net
----------------Berlin_1223.taz.xml
Expand All @@ -29,3 +25,9 @@ The following new files/directories were created:
--------------------persons.sumocfg
--------------------persons.xml
--------------------vehroutes_oneshot_meso.rou.xml
--------test_templates
------------__pycache__
----------------__init__.cpython-38.pyc
------------mitte_net
----------------__pycache__
--------------------__init__.cpython-38.pyc
15 changes: 7 additions & 8 deletions tests/tsc/template/tscDaemonDatabaseTripsFromDB/catalogue.tsc
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
The following new files/directories were created:
<Test Directory>
----__pycache__
--------tscdefs.cpython-310.pyc
----core.db
--------tscdefs.cpython-38.pyc
----data
--------tsc.log
--------scenario_templates
------------mitte_net
----------------__pycache__
--------------------__init__.cpython-310.pyc
--------scenario_workdir
------------VEUII-BASE2010
----------------Berlin_1223.taz.xml
Expand Down Expand Up @@ -60,5 +55,9 @@ The following new files/directories were created:
------------------------rectified_2015y_05m_29d_09h_01m_11s_943ms.csv
------------------------t2s_map_2015y_05m_29d_09h_01m_11s_943ms.log
------------------------t2s_rectify_2015y_05m_29d_09h_01m_11s_943ms.log
----public.db
----tmp.db
--------test_templates
------------__pycache__
----------------__init__.cpython-38.pyc
------------mitte_net
----------------__pycache__
--------------------__init__.cpython-38.pyc
15 changes: 7 additions & 8 deletions tests/tsc/template/tscDaemonDatabaseTripsFromFile/catalogue.tsc
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
The following new files/directories were created:
<Test Directory>
----__pycache__
--------tscdefs.cpython-310.pyc
----core.db
--------tscdefs.cpython-38.pyc
----data
--------tsc.log
--------scenario_templates
------------mitte_net
----------------__pycache__
--------------------__init__.cpython-310.pyc
--------scenario_workdir
------------mitte_net
----------------Berlin_1223.taz.xml
Expand Down Expand Up @@ -53,5 +48,9 @@ The following new files/directories were created:
------------------------rectified_twoPersonsOnly.csv
------------------------t2s_map_twoPersonsOnly.log
------------------------t2s_rectify_twoPersonsOnly.log
----public.db
----tmp.db
--------test_templates
------------__pycache__
----------------__init__.cpython-38.pyc
------------mitte_net
----------------__pycache__
--------------------__init__.cpython-38.pyc
15 changes: 7 additions & 8 deletions tests/tsc/template/tscDaemonEmptyTripsFile/catalogue.tsc
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
The following new files/directories were created:
<Test Directory>
----__pycache__
--------tscdefs.cpython-310.pyc
----core.db
--------tscdefs.cpython-38.pyc
----data
--------tsc.log
--------scenario_templates
------------mitte_net
----------------__pycache__
--------------------__init__.cpython-310.pyc
--------scenario_workdir
------------mitte_net
----------------Berlin_1223.taz.xml
Expand Down Expand Up @@ -44,5 +39,9 @@ The following new files/directories were created:
------------------------rectified_empty.csv
------------------------t2s_map_empty.log
------------------------t2s_rectify_empty.log
----public.db
----tmp.db
--------test_templates
------------__pycache__
----------------__init__.cpython-38.pyc
------------mitte_net
----------------__pycache__
--------------------__init__.cpython-38.pyc
12 changes: 7 additions & 5 deletions tests/tsc/template/tscDaemonEmptyWorkdir/catalogue.tsc
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
The following new files/directories were created:
<Test Directory>
----__pycache__
--------tscdefs.cpython-310.pyc
--------tscdefs.cpython-38.pyc
----data
--------tsc.log
--------scenario_templates
------------mitte_net
----------------__pycache__
--------------------__init__.cpython-310.pyc
--------scenario_workdir
------------mitte_net
----------------Berlin_1223.taz.xml
Expand Down Expand Up @@ -74,3 +70,9 @@ The following new files/directories were created:
------------------------rectified_twoPersonsOnly.csv
------------------------t2s_map_twoPersonsOnly.log
------------------------t2s_rectify_twoPersonsOnly.log
--------test_templates
------------__pycache__
----------------__init__.cpython-38.pyc
------------mitte_net
----------------__pycache__
--------------------__init__.cpython-38.pyc
12 changes: 7 additions & 5 deletions tests/tsc/template/tscDaemonRestrictions/catalogue.tsc
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
The following new files/directories were created:
<Test Directory>
----__pycache__
--------tscdefs.cpython-310.pyc
--------tscdefs.cpython-38.pyc
----data
--------tsc.log
--------scenario_templates
------------mitte_net
----------------__pycache__
--------------------__init__.cpython-310.pyc
--------scenario_workdir
------------mitte_net
----------------Berlin_1223.taz.xml
Expand Down Expand Up @@ -36,3 +32,9 @@ The following new files/directories were created:
------------------------rectified_twoPersonsOnly.csv
------------------------t2s_map_twoPersonsOnly.log
------------------------t2s_rectify_twoPersonsOnly.log
--------test_templates
------------__pycache__
----------------__init__.cpython-38.pyc
------------mitte_net
----------------__pycache__
--------------------__init__.cpython-38.pyc
15 changes: 7 additions & 8 deletions tests/tsc/template/tscDaemonVTypeMatrix/catalogue.tsc
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
The following new files/directories were created:
<Test Directory>
----__pycache__
--------tscdefs.cpython-310.pyc
----core.db
--------tscdefs.cpython-38.pyc
----data
--------tsc.log
--------scenario_templates
------------mitte_net
----------------__pycache__
--------------------__init__.cpython-310.pyc
--------scenario_workdir
------------mitte_net
----------------Berlin_1223.taz.xml
Expand Down Expand Up @@ -61,5 +56,9 @@ The following new files/directories were created:
------------------------rectified_twoPersonsOnly.csv
------------------------t2s_map_twoPersonsOnly.log
------------------------t2s_rectify_twoPersonsOnly.log
----public.db
----tmp.db
--------test_templates
------------__pycache__
----------------__init__.cpython-38.pyc
------------mitte_net
----------------__pycache__
--------------------__init__.cpython-38.pyc
10 changes: 5 additions & 5 deletions tests/tsc/tscDaemonWriteStatusToDB/output.tsc
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
running pre test instructions
parsing C:\Users\behr_mi\Projekte\tsc\tests\..\sqlite3.tsccfg
starting main
parsing /home/behr_mi/tsc/test_server.tsccfg
starting main ['python', '/home/behr_mi/tsc/tsc_main.py', '--template-folder', 'test_templates', '-c', '/home/behr_mi/tsc/test_server.tsccfg', '--daemon', '--daemon-run-time', '10']
db_status_started: 2015y_05m_29d_09h_01m_11s_943ms 0 > Begin
[('DB_CAR_FLEET_KEY', 'MID2008_Y2010_BERLIN'), ('DB_HH_SAMPLE_SIZE', '0.5'), ('DB_NAME_MATRIX_TT_MIT_BASE', 'CAR_TT_B_2005'), ('DB_TABLE_ADDITIONAL_TRAFFIC', ''), ('DB_TABLE_CARS', 'berlin_cars'), ('DB_TABLE_MATRIXMAPS', 'berlin_matrixmap'), ('DB_TABLE_REPRESENTATIVES', 'berlin_location_representatives'), ('DB_TABLE_SUMO_OD_ENTRY', 'sumo_od_entry'), ('DB_TABLE_SUMO_OD_OUTPUT', 'sumo_od'), ('DB_TABLE_SUMO_STATUS', 'global_sumo_status'), ('DB_TABLE_SUMO_TRIP_OUTPUT', 'sumo_trip'), ('DB_TABLE_TAZ', 'berlin_taz'), ('DB_TABLE_TRIPS', 'test_trips'), ('DELETE_INTERMEDIATE_RESULTS', 'false'), ('DELETE_TEMP', 'false'), ('ITERATION', '0'), ('MAX_SUMO_ITERATION', '10'), ('SHARING_FLEET_SIZE', '100'), ('SHARING_VEHICLE_CAPACITY', '5'), ('SLICE', [24.0]), ('SUMO_DESTINATION_FOLDER', 'VEUII-BASE2010'), ('SUMO_MODES', '2;4'), ('SUMO_NET_PARAMETER', '{}'), ('SUMO_TEMPLATE_FOLDER', 'mitte_net'), ('SUMO_TRIP_FILTER', '')]
db_status_error: 2015y_05m_29d_09h_01m_11s_943ms 0 no data for 2015y_05m_29d_09h_01m_11s_943ms in scenario_templates\mitte_net
db_status_error: 2015y_05m_29d_09h_01m_11s_943ms 0 no data for 2015y_05m_29d_09h_01m_11s_943ms in test_templates/mitte_net
running post test instructions
parsing C:\Users\behr_mi\Projekte\tsc\tests\..\sqlite3.tsccfg
parsing /home/behr_mi/tsc/test_server.tsccfg
('2015y_05m_29d_09h_01m_11s_943ms', 0, 'pending test', 'pending')
('2015y_05m_29d_09h_01m_11s_943ms', 0, '> Begin', 'started')
('2015y_05m_29d_09h_01m_11s_943ms', 0, 'no data for 2015y_05m_29d_09h_01m_11s_943ms in scenario_templates\\mitte_net', 'error')
('2015y_05m_29d_09h_01m_11s_943ms', 0, 'no data for 2015y_05m_29d_09h_01m_11s_943ms in test_templates/mitte_net', 'error')
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
running pre test instructions
parsing C:\Users\behr_mi\Projekte\tsc\tests\..\sqlite3.tsccfg
starting main
parsing /home/behr_mi/tsc/test_server.tsccfg
starting main ['python', '/home/behr_mi/tsc/tsc_main.py', '--template-folder', 'test_templates', '-c', '/home/behr_mi/tsc/test_server.tsccfg', '--daemon', '--daemon-run-time', '10']
db_status_started: 2015y_05m_29d_09h_01m_11s_943ms 0 > Begin
[('DB_CAR_FLEET_KEY', 'MID2008_Y2010_BERLIN'), ('DB_HH_SAMPLE_SIZE', '0.5'), ('DB_NAME_MATRIX_TT_MIT_BASE', 'CAR_TT_B_2005'), ('DB_TABLE_ADDITIONAL_TRAFFIC', ''), ('DB_TABLE_CARS', 'berlin_cars'), ('DB_TABLE_MATRIXMAPS', 'berlin_matrixmap'), ('DB_TABLE_REPRESENTATIVES', 'berlin_location_representatives'), ('DB_TABLE_SUMO_OD_ENTRY', 'sumo_od_entry'), ('DB_TABLE_SUMO_OD_OUTPUT', 'sumo_od'), ('DB_TABLE_SUMO_STATUS', 'global_sumo_status'), ('DB_TABLE_SUMO_TRIP_OUTPUT', 'sumo_trip'), ('DB_TABLE_TAZ', 'berlin_taz'), ('DB_TABLE_TRIPS', 'test_trips'), ('DELETE_INTERMEDIATE_RESULTS', 'false'), ('DELETE_TEMP', 'false'), ('ITERATION', '0'), ('MAX_SUMO_ITERATION', '10'), ('SHARING_FLEET_SIZE', '100'), ('SHARING_VEHICLE_CAPACITY', '5'), ('SLICE', [24.0]), ('SUMO_DESTINATION_FOLDER', 'VEUII-BASE2010'), ('SUMO_MODES', '2;4'), ('SUMO_NET_PARAMETER', '{}'), ('SUMO_TEMPLATE_FOLDER', 'mitte_net'), ('SUMO_TRIP_FILTER', '')]
db_status_error: 2015y_05m_29d_09h_01m_11s_943ms 0 no data for 2015y_05m_29d_09h_01m_11s_943ms in scenario_templates\mitte_net
db_status_error: 2015y_05m_29d_09h_01m_11s_943ms 0 no data for 2015y_05m_29d_09h_01m_11s_943ms in test_templates/mitte_net
4 changes: 3 additions & 1 deletion tests/tsc/tscdefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
sys.path.append(tscRoot)
testServer = os.path.join(tscRoot, os.environ.get("TSC_SERVER", "test_server.tsccfg"))

def get_python_tool(rel_path, config=testServer):
def get_python_tool(rel_path, config=testServer, templates="test_templates"):
call = [python, os.path.join(tscRoot, rel_path)]
if rel_path == "tsc_main.py":
call += ["--template-folder", templates]
if config:
return call + ['-c', config]
return call
17 changes: 8 additions & 9 deletions tests/tsc/workdir/t2s/marouterGawron/catalogue.tsc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
The following new files/directories were created:
<Test Directory>
----__pycache__
--------tscdefs.cpython-37.pyc
--------tscdefs.cpython-38.pyc
----data
--------scenario_workdir
------------mitte_net
Expand All @@ -10,26 +10,25 @@ The following new files/directories were created:
------------------------7zip.log
------------------------dua.log
------------------------duaIterate.params
------------------------edgedata.add.xml
------------------------stdout.log
------------------------0
----------------------------dua_dump_000.add.xml
----------------------------dump_000_1800.xml
------------------------000
----------------------------dump_1800.xml
----------------------------iteration_000.sumo.log
----------------------------iteration_000.sumocfg
----------------------------iteration_000_ma_flows.duarcfg
----------------------------ma_flows_000.rou.alt.xml
----------------------------ma_flows_000.rou.xml
----------------------------memory_dump_000_1800.xml
----------------------------memory_dump_1800.xml
----------------------------vehroute_000.xml
------------------------1
----------------------------dua_dump_001.add.xml
----------------------------dump_001_1800.xml
------------------------001
----------------------------dump_1800.xml
----------------------------iteration_001.sumo.log
----------------------------iteration_001.sumocfg
----------------------------iteration_001_ma_flows_000.duarcfg
----------------------------ma_flows_001.rou.alt.xml
----------------------------ma_flows_001.rou.xml
----------------------------memory_dump_001_1800.xml
----------------------------memory_dump_1800.xml
----------------------------vehroute_001.xml
--------------------marouter
------------------------ma_flows.rou.xml
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
The following new files/directories were created:
<Test Directory>
----__pycache__
--------tscdefs.cpython-310.pyc
--------tscdefs.cpython-38.pyc
----data
--------tsc.log
--------scenario_templates
------------__pycache__
----------------__init__.cpython-310.pyc
--------scenario_workdir
------------mitte_net
----------------iteration001
Expand Down Expand Up @@ -47,3 +44,6 @@ The following new files/directories were created:
------------------------rectified_2013y_03m_07d_16h_43m_41s_859ms_limit1000.csv
------------------------t2s_map_2013y_03m_07d_16h_43m_41s_859ms_limit1000.log
------------------------t2s_rectify_2013y_03m_07d_16h_43m_41s_859ms_limit1000.log
--------test_templates
------------__pycache__
----------------__init__.cpython-38.pyc

0 comments on commit 9238bd1

Please sign in to comment.