Files
cleveragents-core/features/tdd_expected_fail_infrastructure.feature
T
brent.edwards aa5d5eeaf5 test(session): add TDD failing tests for session create DI error
Implement TDD bug-capture tests for bug #570 where `agents session create`
fails because `_get_session_service()` calls `container.db()` which does
not exist on the DI Container class (AttributeError). Same root cause as
bug #554.

Behave BDD scenarios tagged @tdd_bug @tdd_bug_570 @tdd_expected_fail
exercise the real DI path (no mocks). Includes Robot Framework integration
smoke tests with self-inverting helper and ASV benchmark baseline.

ISSUES CLOSED: #631
2026-03-11 02:42:13 +00:00

39 lines
2.0 KiB
Gherkin

@infrastructure
Feature: TDD expected-fail handler infrastructure
Verify that the ``_handle_tdd_expected_fail`` hook in ``environment.py``
correctly inverts scenario AND step-level status for TDD bug-capture tests.
Scenario: Handler inverts a failed scenario with failed and skipped steps to passed
Given a mock scenario tagged "@tdd_expected_fail @tdd_bug @tdd_bug_999" with status "failed"
And the mock scenario has a step "broken step" with status "failed"
And the mock scenario has a step "skipped step" with status "skipped"
When the TDD expected-fail handler processes the scenario
Then the scenario status should be "passed"
And the step "broken step" should have status "passed"
And the step "skipped step" should have status "passed"
Scenario: Handler fails a passed scenario that still carries @tdd_expected_fail
Given a mock scenario tagged "@tdd_expected_fail @tdd_bug @tdd_bug_999" with status "passed"
When the TDD expected-fail handler processes the scenario
Then the scenario status should be "failed"
Scenario: Handler rejects @tdd_expected_fail without @tdd_bug
Given a mock scenario tagged "@tdd_expected_fail" with status "failed"
When the TDD expected-fail handler processes the scenario
Then the scenario status should be "failed"
Scenario: Handler rejects @tdd_expected_fail without @tdd_bug_N
Given a mock scenario tagged "@tdd_expected_fail @tdd_bug" with status "failed"
When the TDD expected-fail handler processes the scenario
Then the scenario status should be "failed"
Scenario: Handler rejects @tdd_bug_N without @tdd_bug unconditionally
Given a mock scenario tagged "@tdd_bug_999" with status "passed"
When the TDD expected-fail handler processes the scenario
Then the scenario status should be "failed"
Scenario: Handler ignores scenarios without @tdd_expected_fail
Given a mock scenario tagged "@tdd_bug @tdd_bug_999" with status "failed"
When the TDD expected-fail handler processes the scenario
Then the scenario status should be "failed"