mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-09-04 20:32:36 +01:00
StateDetection: Moved check for missing phase definition earlier.
Now checks to see if a phase is correctly defined before image matching so that it is only performed if required.
This commit is contained in:
@@ -136,9 +136,6 @@ def verify_state(screenshot_file, state_defs_path, workload_phase):
|
|||||||
with open(statedefs_file) as fh:
|
with open(statedefs_file) as fh:
|
||||||
state_definitions = yaml.load(fh)
|
state_definitions = yaml.load(fh)
|
||||||
|
|
||||||
# run a match on the screenshot
|
|
||||||
matched_state = match_state(screenshot_file, state_defs_path, state_definitions)
|
|
||||||
|
|
||||||
# find what the expected state is for the given workload phase
|
# find what the expected state is for the given workload phase
|
||||||
expected_state = None
|
expected_state = None
|
||||||
for phase in state_definitions["workload_phases"]:
|
for phase in state_definitions["workload_phases"]:
|
||||||
@@ -148,4 +145,7 @@ def verify_state(screenshot_file, state_defs_path, workload_phase):
|
|||||||
if expected_state is None:
|
if expected_state is None:
|
||||||
raise StateDefinitionError("Phase not defined")
|
raise StateDefinitionError("Phase not defined")
|
||||||
|
|
||||||
|
# run a match on the screenshot
|
||||||
|
matched_state = match_state(screenshot_file, state_defs_path, state_definitions)
|
||||||
|
|
||||||
return expected_state == matched_state
|
return expected_state == matched_state
|
||||||
|
Reference in New Issue
Block a user