Skip to content

Commit 8aa0a10

Browse files
committed
Implementing current FRID first test execution order
1 parent b51ca68 commit 8aa0a10

4 files changed

Lines changed: 17 additions & 1 deletion

File tree

render_machine/actions/fix_conformance_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ def execute(self, render_context: RenderContext, previous_action_payload: Any |
126126
style=console.OUTPUT_STYLE,
127127
)
128128
render_context.conformance_tests_running_context.should_prepare_testing_environment = True
129+
render_context.conformance_tests_running_context.implementation_code_was_updated = True
129130
return self.IMPLEMENTATION_CODE_UPDATED, None
130131
else:
131132
return self.IMPLEMENTATION_CODE_NOT_UPDATED, None

render_machine/render_context.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ def get_next_conformance_tests_running_context(self):
278278

279279
def start_unittests_processing_in_conformance_tests(self):
280280
self.start_unittests_processing()
281+
self.conformance_tests_running_context.implementation_code_was_updated = False
281282
self.conformance_tests_running_context = self.get_first_conformance_tests_running_context()
282283

283284
def finish_unittests_processing(self):
@@ -365,7 +366,14 @@ def start_conformance_tests_processing(self):
365366
def finish_conformance_tests_processing(self):
366367
self.conformance_tests_running_context = None
367368

369+
def implementation_code_was_updated_in_conformance_tests(self) -> bool:
370+
return self.conformance_tests_running_context.implementation_code_was_updated
371+
368372
def start_conformance_tests_for_frid(self):
373+
if self.conformance_tests_running_context.implementation_code_was_updated:
374+
self.conformance_tests_running_context.implementation_code_was_updated = False
375+
self.conformance_tests_running_context.current_testing_frid = None
376+
369377
if self.conformance_tests_running_context.regenerating_conformance_tests:
370378
if self.verbose:
371379
console.info(

render_machine/render_types.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ def __init__(
4646
# - current_testing_frid == frid noqa: E800
4747
# - conformance_test_phase_index == 0 (conformance tests phase)
4848
self.regenerating_conformance_tests: bool = False
49+
self.implementation_code_was_updated: bool = False
4950
self.current_testing_frid_high_level_implementation_plan: Optional[str] = None
5051
self.previous_conformance_tests_issue_old: Optional[str] = None
5152
self.previous_conformance_tests_issue_frid: Optional[str] = None

render_machine/state_machine_config.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def get_action_result_triggers_map(self) -> Dict[str, str]:
130130
RunConformanceTests.FAILED_OUTCOME: triggers.MARK_CONFORMANCE_TESTS_FAILED,
131131
RunConformanceTests.UNRECOVERABLE_ERROR_OUTCOME: triggers.HANDLE_ERROR,
132132
FixConformanceTest.IMPLEMENTATION_CODE_NOT_UPDATED: triggers.MARK_CONFORMANCE_TESTS_READY,
133-
FixConformanceTest.IMPLEMENTATION_CODE_UPDATED: triggers.MARK_UNIT_TESTS_READY,
133+
FixConformanceTest.IMPLEMENTATION_CODE_UPDATED: triggers.MARK_CONFORMANCE_TESTS_READY,
134134
CommitConformanceTestsChanges.SUCCESSFUL_OUTCOME_IMPLEMENTATION_UPDATED: triggers.MARK_NEXT_CONFORMANCE_TESTS_POSTPROCESSING_STEP,
135135
CommitConformanceTestsChanges.SUCCESSFUL_OUTCOME_IMPLEMENTATION_NOT_UPDATED: triggers.PROCEED_FRID_PROCESSING,
136136
SummarizeConformanceTests.SUCCESSFUL_OUTCOME: triggers.MARK_NEXT_CONFORMANCE_TESTS_POSTPROCESSING_STEP,
@@ -397,6 +397,12 @@ def get_transitions(self) -> List[Dict[str, Any]]:
397397
"trigger": triggers.MARK_REGENERATION_OF_CONFORMANCE_TESTS,
398398
"dest": f"{States.IMPLEMENTING_FRID.value}_{States.PROCESSING_CONFORMANCE_TESTS.value}_{States.CONFORMANCE_TESTING_INITIALISED.value}",
399399
},
400+
{
401+
"source": f"{States.IMPLEMENTING_FRID.value}_{States.PROCESSING_CONFORMANCE_TESTS.value}_{States.CONFORMANCE_TEST_ENV_PREPARED.value}",
402+
"trigger": triggers.MOVE_TO_NEXT_CONFORMANCE_TEST,
403+
"dest": f"{States.IMPLEMENTING_FRID.value}_{States.PROCESSING_CONFORMANCE_TESTS.value}_{States.PROCESSING_UNIT_TESTS.value}",
404+
"conditions": ["should_run_unit_tests", "implementation_code_was_updated_in_conformance_tests"],
405+
},
400406
{
401407
"source": f"{States.IMPLEMENTING_FRID.value}_{States.PROCESSING_CONFORMANCE_TESTS.value}_{States.CONFORMANCE_TEST_ENV_PREPARED.value}",
402408
"trigger": triggers.MOVE_TO_NEXT_CONFORMANCE_TEST,

0 commit comments

Comments
 (0)