Files
cleveragents-core/features/application_container_coverage.feature
T
HAL9000 f808abff86 chore(ci): fix pre-commit hook failures
Fix JSON syntax errors in .devcontainer/devcontainer.json (removed
invalid JS-style // comments) and .devcontainer/opencode.json (removed
90+ trailing commas). Apply auto-fixes for end-of-file and trailing
whitespace issues across 100+ files. Fix SIM105 ruff violations in
benchmarks/core_circuit_breaker_bench.py (use contextlib.suppress).

Note: The security fix from issue #7478 (validate_path startswith bypass)
was already delivered to master in commit e18ac5f2. This PR as currently
structured is non-atomic (35 commits across 10+ issues) and needs
significant restructure before merge. This commit only addresses the
CI/pre-commit failures.

ISSUES CLOSED: #7478
2026-06-14 09:51:14 -04:00

73 lines
3.2 KiB
Gherkin

Feature: Application Container Dependency Injection Coverage
As a developer
I want to ensure the application container properly manages service dependencies
So that all container methods and singleton patterns are thoroughly tested
@phase1
Scenario: Container settings method returns valid application settings
Given I have initialized an application container
When I request the application settings from the container
Then the container should return valid settings object
@phase1
Scenario: Container project service method creates and returns service instance
Given I have initialized an application container
When I request a project service from the container
Then the container should return a valid project service instance
@phase1
Scenario: Container context service method creates and returns service instance
Given I have initialized an application container
When I request a context service from the container
Then the container should return a valid context service instance
@phase1
Scenario: Container plan service method creates and returns service instance
Given I have initialized an application container
When I request a plan service from the container
Then the container should return a valid plan service instance
@phase1
Scenario: Get container function creates singleton on first call
Given no global container exists
When I access the global container for the first time
Then a new container instance should be created and cached
And subsequent accesses should return the same instance
@phase1
Scenario: Reset container function clears singleton for testing
Given a global container exists
When I reset the global container
Then the global container should be cleared
And the next access should create a new instance
@phase1
Scenario: Mock AI provider loads when testing env flag is enabled
Given I enable the mock AI provider environment flag
And I ensure the features directory path is not already on sys path
When I request the AI provider from the container helpers
Then the mock AI provider should be returned and features path added
@phase1
Scenario: Mock AI provider flag overrides configured providers
Given I enable the mock AI provider environment flag
And I set the "OPENAI_API_KEY" environment variable to "sk-live-test"
And I ensure the features directory path is not already on sys path
When I request the AI provider from the container helpers
Then the mock AI provider should be returned and features path added
@phase1
Scenario: Mock AI provider import failure gracefully falls back
Given I enable the mock AI provider environment flag
And I simulate a failure when importing the mock AI provider
When I request the AI provider from the container helpers
Then the mock AI provider should not be returned due to import failure
@phase1
Scenario: Override providers uses object provider for database url
Given no global container exists
When I override the database url provider with "sqlite:///:memory:"
Then the overridden database url should be used by the container
And I reset the container overrides to avoid test leakage