Files
cleveragents-core/features/cli_init_yes_flag.feature
T
Brent E. Edwards d0689573e0
CI / lint (pull_request) Successful in 13s
CI / benchmark-publish (pull_request) Has been skipped
CI / quality (pull_request) Successful in 18s
CI / build (pull_request) Successful in 32s
CI / security (pull_request) Successful in 48s
CI / typecheck (pull_request) Successful in 55s
CI / unit_tests (pull_request) Failing after 2m41s
CI / docker (pull_request) Has been skipped
CI / integration_tests (pull_request) Successful in 3m25s
CI / coverage (pull_request) Successful in 5m56s
CI / benchmark-regression (pull_request) Successful in 33m35s
test(cli): add failing tests for session create DI container error
Add TDD regression tests for bug #570 where `_get_session_service()`
calls `container.db()` but the DI `Container` class has no `db`
provider, raising `AttributeError`.  Same root cause as bug #554.

Includes 4 Behave BDD scenarios tagged `@tdd_bug @tdd_bug_570
@tdd_expected_fail`, Robot Framework integration smoke tests with
`--format plain`, and ASV service-layer benchmarks.  Tests exercise the
real DI path by resetting `_service = None` and using a file-based
SQLite database.

Implements the `@tdd_expected_fail` inversion infrastructure:
- Behave: `after_scenario` hook in `features/environment.py` inverts
  pass/fail for scenarios tagged `@tdd_expected_fail`
- Robot: `robot/tdd_expected_fail_listener.py` listener (API v3)
  performs the same inversion for Robot test cases
- `noxfile.py`: registers the listener via `--listener` in both the
  `integration_tests` and `slow_integration_tests` sessions

Migrates 18 existing TDD scenarios across 5 feature files from the old
`@tdd @bugNNN` convention to the standardised `@tdd_bug @tdd_bug_NNN`
tags per CONTRIBUTING.md § TDD Bug Test Tags.

Refs: #570
2026-03-10 21:39:31 +00:00

57 lines
2.7 KiB
Gherkin

# These tests target bug #522 and are expected to fail until the fix is applied.
#
# NOTE FOR FIX AUTHOR (#522):
# Scenarios 1-4 will fail for TWO independent reasons:
# (a) The --yes / -y flag is not yet implemented (NoSuchOption).
# (b) The current init_command output format (project.py) does not match
# the spec-defined output at docs/specification.md:1381-1402.
# The fix must address both: add the --yes flag AND remodel the output to
# match the spec (Data Dir, Config, Database, Directories fields with the
# "Initialized (non-interactive)" status message).
Feature: CLI init --yes flag for non-interactive initialization
As a developer using CleverAgents in CI or scripts
I want to run "agents init --yes" for non-interactive initialization
So that I can skip interactive prompts and use sensible defaults
@tdd_bug @tdd_bug_522
Scenario: agents init --yes completes without error
Given I have a temporary project directory for init
When I run agents init with the --yes flag
Then the init command should exit with code 0
And the project service initialize_project should have been called
@tdd_bug @tdd_bug_522
Scenario: --yes suppresses interactive prompts
Given I have a temporary project directory for init
When I run agents init with the --yes flag
Then the init command should exit with code 0
And the init output should contain "Initialized (non-interactive)"
And no interactive prompt should have been presented
@tdd_bug @tdd_bug_522
Scenario: -y short-form alias completes without error
Given I have a temporary project directory for init
When I run agents init with the -y flag
Then the init command should exit with code 0
And the init output should contain "Initialized (non-interactive)"
And the project service initialize_project should have been called
@tdd_bug @tdd_bug_522
Scenario: Output includes expected initialization summary
Given I have a temporary project directory for init
When I run agents init with the --yes flag
Then the init command should exit with code 0
And the init output should contain "Data Dir:"
And the init output should contain "Config:"
And the init output should contain "Database:"
And the init output should contain "Directories:"
And the init output should contain "logs, cache, sessions, contexts"
And the init output should contain "Initialized"
@tdd_bug @tdd_bug_522
Scenario: Interactive mode without --yes presents a prompt
Given I have a temporary project directory for init
When I run agents init without the --yes flag
Then the init command should exit with code 0
And the init output should indicate interactive mode