1616from unittest .case import SkipTest
1717from requests .exceptions import ConnectionError
1818
19- from spinn_utilities .config_holder import get_config_bool
19+ from spinn_utilities .config_holder import (
20+ config_options , config_sections , get_report_path , get_timestamp_path )
2021
21- from spinn_front_end_common .interface .interface_functions \
22- import load_using_advanced_monitors
23- import spinn_front_end_common .utilities .report_functions .reports as \
24- reports_names
25- from spinn_front_end_common .utilities .report_functions .network_specification \
26- import _FILENAME as network_specification_file_name
27- from spinn_front_end_common .utilities .report_functions .drift_report import (
28- CLOCK_DRIFT_REPORT )
29- from spinn_front_end_common .utilities .report_functions .\
30- memory_map_on_host_report import _FOLDER_NAME as \
31- memory_map_on_host_report
32- # from spinn_front_end_common.utilities.report_functions.energy_report \
33- # import EnergyReport
34- from spinn_front_end_common .utilities .report_functions .board_chip_report \
35- import AREA_CODE_REPORT_NAME
36- from spinn_front_end_common .utilities .report_functions .\
37- fixed_route_from_machine_report import REPORT_NAME as fixed_route_report
38- from spinn_front_end_common .utility_models import \
39- DataSpeedUpPacketGatherMachineVertex
4022from spinnaker_testbase import BaseTestCase
41- from spynnaker .pyNN .data import SpynnakerDataView
42- from spynnaker .pyNN .extra_algorithms .\
43- spynnaker_neuron_network_specification_report import (
44- _GRAPH_NAME )
23+ from spynnaker .pyNN .config_setup import cfg_paths_skipped
4524import pyNN .spiNNaker as sim
4625
4726
4827class CheckDebug (BaseTestCase ):
4928 """
5029 that it does not crash in debug mode. All reports on.
5130 """
52- def debug (self ):
53- # pylint: disable=protected-access
54- reports = [
55- # write_energy_report
56- # EnergyReport._DETAILED_FILENAME,
57- # EnergyReport._SUMMARY_FILENAME,
58- # write_text_specs = False
59- "data_spec_text_files" ,
60- # write_router_reports
61- reports_names ._ROUTING_FILENAME ,
62- # write_partitioner_reports
63- reports_names ._PARTITIONING_FILENAME ,
64- # write_application_graph_placer_report
65- reports_names ._PLACEMENT_VTX_GRAPH_FILENAME ,
66- reports_names ._PLACEMENT_CORE_GRAPH_FILENAME ,
67- reports_names ._SDRAM_FILENAME ,
68- # repeats reports_names._SDRAM_FILENAME,
69- # write_router_info_report
70- reports_names ._VIRTKEY_FILENAME ,
71- # write_routing_table_reports
72- reports_names ._ROUTING_TABLE_DIR ,
73- reports_names ._C_ROUTING_TABLE_DIR ,
74- reports_names ._COMPARED_FILENAME ,
75- # write_memory_map_report
76- memory_map_on_host_report ,
77- # write_network_specification_report
78- network_specification_file_name ,
79- "provenance_data" ,
80- # write_tag_allocation_reports
81- reports_names ._TAGS_FILENAME ,
82- # write_drift_report_end or start
83- CLOCK_DRIFT_REPORT ,
84- # write_board_chip_report
85- AREA_CODE_REPORT_NAME ,
86- _GRAPH_NAME ,
87- # graphviz exe may not be installed so there will be no image file
88- # _GRAPH_NAME + "." + _GRAPH_FORMAT,
89- fixed_route_report ,
90- ]
9131
32+ def assert_reports (self ):
33+ skipped = cfg_paths_skipped ()
34+ for section in config_sections ():
35+ for option in config_options (section ):
36+ if option in skipped :
37+ continue
38+ if option .startswith ("path" ):
39+ path = get_report_path (section = section , option = option )
40+ elif option .startswith ("tpath" ):
41+ path = get_timestamp_path (section = section , option = option )
42+ else :
43+ continue
44+ print (f"found { option } at { path } " )
45+ if not os .path .exists (path ):
46+ raise AssertionError (
47+ f"Unable to find report for { option } { path } " )
48+
49+ def debug (self ):
9250 sim .setup (1.0 )
9351 pop = sim .Population (100 , sim .IF_curr_exp , {}, label = "pop" )
9452 pop .record ("v" )
@@ -102,23 +60,9 @@ def debug(self):
10260 raise SkipTest ("DNS Error Monster!" )
10361
10462 pop .get_data ("v" )
105- run0 = SpynnakerDataView .get_run_dir_path ()
106- found = os .listdir (run0 )
107- if (get_config_bool ("Machine" , "enable_advanced_monitor_support" )
108- and not get_config_bool ("Java" , "use_java" )):
109- # write_data_speed_up_report
110- reports .append (
111- DataSpeedUpPacketGatherMachineVertex .OUT_REPORT_NAME )
112- if load_using_advanced_monitors ():
113- reports .append (
114- DataSpeedUpPacketGatherMachineVertex .IN_REPORT_NAME )
115- for report in reports :
116- self .assertIn (report , found )
117- self .assertIn ("data.sqlite3" , found )
118- self .assertIn ("ds.sqlite3" , found )
63+ self .assert_reports ()
11964
12065 sim .run (10 ) # second run
12166 pop .get_data ("v" )
122- self .assertEqual (run0 , SpynnakerDataView .get_run_dir_path ())
12367
12468 sim .end ()
0 commit comments