Skip to content

Commit 97efcd4

Browse files
committed
Fixed acceptance tests
1 parent 575e45e commit 97efcd4

2 files changed

Lines changed: 12 additions & 10 deletions

File tree

render_machine/render_context.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -468,8 +468,12 @@ def _handle_current_frid_testing(self):
468468
"""Handle incremental testing of the current FRID being implemented."""
469469
ctx = self.conformance_tests_running_context
470470

471-
# Initialize acceptance test phase on first run (before checking if tests exist)
472-
# This prevents duplicate test runs by ensuring the phase is set immediately
471+
# Wait for tests to be rendered
472+
if not ctx.current_conformance_tests_exist():
473+
return
474+
475+
# Initialize acceptance test phase AFTER tests exist and pass
476+
# This ensures full conformance tests run first before acceptance tests
473477
if ctx.acceptance_test_phase == AcceptanceTestPhase.NOT_STARTED:
474478
acceptance_tests = self.frid_context.specifications.get(plain_spec.ACCEPTANCE_TESTS)
475479
if not acceptance_tests:
@@ -480,10 +484,6 @@ def _handle_current_frid_testing(self):
480484
else:
481485
ctx.acceptance_test_phase = AcceptanceTestPhase.IN_PROGRESS
482486

483-
# Wait for tests to be rendered
484-
if not ctx.current_conformance_tests_exist():
485-
return
486-
487487
# Handle case: No acceptance tests
488488
if ctx.acceptance_test_phase == AcceptanceTestPhase.NOT_APPLICABLE:
489489
if ctx.acceptance_tests_completed == 1:
@@ -507,7 +507,7 @@ def _handle_current_frid_testing(self):
507507
acceptance_tests = self.frid_context.specifications[plain_spec.ACCEPTANCE_TESTS][
508508
: ctx.acceptance_tests_completed
509509
]
510-
ctx.get_conformance_tests_json(ctx.current_testing_module_name)[self.frid_context.frid][
510+
ctx.get_conformance_tests_json(ctx.current_testing_module_name)[ctx.current_testing_frid][
511511
plain_spec.ACCEPTANCE_TESTS
512512
] = acceptance_tests
513513
return

tui/state_handlers.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,17 @@
2020
)
2121

2222

23-
def format_acceptance_test_text(raw_text: str) -> str:
23+
def format_acceptance_test_text(raw_text: str | None) -> str:
2424
"""Format acceptance test text for display by removing list prefix if present.
2525
2626
Args:
27-
raw_text: The raw acceptance test text from specifications
27+
raw_text: The raw acceptance test text from specifications (can be None during state transitions)
2828
2929
Returns:
30-
Formatted text with "- " prefix removed if present
30+
Formatted text with "- " prefix removed if present, or empty string if None
3131
"""
32+
if raw_text is None:
33+
return ""
3234
if raw_text.startswith("- "):
3335
return raw_text[2:]
3436
return raw_text

0 commit comments

Comments
 (0)