@@ -123,7 +123,7 @@ def fms_hits_profiling():
123
123
124
124
@pytest .fixture (scope = "module" )
125
125
def fms_hits_log_file ():
126
- """Fixture returning a dict holding the parsed FMS timing content wiht hits."""
126
+ """Fixture returning the FMS timing content with hits."""
127
127
return """ MPP_DOMAINS_STACK high water mark= 380512
128
128
129
129
Tabulating mpp_clock statistics across 1 PEs...
@@ -144,6 +144,19 @@ def fms_hits_log_file():
144
144
"""
145
145
146
146
147
+ @pytest .fixture (scope = "module" )
148
+ def fms_incorrect_log_file ():
149
+ """Fixture returning an incorrect FMS timing content."""
150
+ return """ MPP_DOMAINS_STACK high water mark= 380512
151
+
152
+ Tabulating mpp_clock statistics across 1 PEs...
153
+
154
+ hits tmax tavg tstd tfrac grain pemin pemax
155
+ Total runtime 1 100.641190 100.641190 100.641190 0.000000 1.000 0 0 0
156
+ high water mark= 0
157
+ """
158
+
159
+
147
160
def test_fms_nohits_profiling (fms_nohits_parser , fms_nohits_log_file , fms_nohits_profiling ):
148
161
"""Test the correct parsing of FMS timing information without hits column."""
149
162
parsed_log = fms_nohits_parser .read (fms_nohits_log_file )
@@ -155,7 +168,7 @@ def test_fms_nohits_profiling(fms_nohits_parser, fms_nohits_log_file, fms_nohits
155
168
), f"Incorrect { metric } for region { region } (idx: { idx } )."
156
169
157
170
158
- def test_mom6_profiling (fms_hits_parser , fms_hits_log_file , fms_hits_profiling ):
171
+ def test_fms_hits_profiling (fms_hits_parser , fms_hits_log_file , fms_hits_profiling ):
159
172
"""Test the correct parsing of FMS timing information with hits column."""
160
173
parsed_log = fms_hits_parser .read (fms_hits_log_file )
161
174
for idx , region in enumerate (fms_hits_profiling .keys ()):
@@ -164,3 +177,9 @@ def test_mom6_profiling(fms_hits_parser, fms_hits_log_file, fms_hits_profiling):
164
177
assert (
165
178
fms_hits_profiling [metric ][idx ] == parsed_log [metric ][idx ]
166
179
), f"Incorrect { metric } for region { region } (idx: { idx } )."
180
+
181
+
182
+ def test_fms_incorrect_profiling (fms_hits_parser , fms_incorrect_log_file ):
183
+ """Test the parsing of incorrect FMS timing information."""
184
+ with pytest .raises (ValueError ):
185
+ fms_hits_parser .read (fms_incorrect_log_file )
0 commit comments