Files
cleveragents-core/features
brent.edwards a45e2e7250 test: add TDD bug-capture test for #990 — automation_profile DI bypass
Add a Behave BDD feature (features/tdd_automation_profile_di_bypass.feature)
with three scenarios and a Robot Framework integration test
(robot/tdd_automation_profile_di_bypass.robot) with two test cases that
capture the DI bypass bug described in issue #990.

Bug #990: The _get_service() function in automation_profile.py manually
constructs create_engine / sessionmaker / AutomationProfileRepository
instead of resolving AutomationProfileService through the DI container.
This is the only CLI command that bypasses DI.

Behave scenarios:
  1. Verifies _get_service() resolves from container.automation_profile_service()
  2. Verifies create_engine is NOT called directly
  3. Verifies sessionmaker is NOT called directly

Robot integration tests:
  1. Verifies _get_service() uses the DI container at subprocess level
  2. Verifies create_engine is not called directly at subprocess level

All tests are tagged @tdd_bug @tdd_bug_990 @tdd_issue @tdd_issue_990
@tdd_expected_fail. The @tdd_expected_fail tag inverts the result so CI
passes while the bug is unfixed. Both @tdd_bug and @tdd_issue tags are
included: @tdd_bug per reviewer convention, @tdd_issue to satisfy the
tag validation rules in features/environment.py.

ISSUES CLOSED: #1031
2026-03-31 02:12:09 +00:00
..
2026-02-23 03:11:12 +00:00