Files
cleveragents-core/features/actor_cli_coverage.feature
T
hurui200320 2005b8ef82
CI / push-validation (push) Successful in 18s
CI / build (push) Successful in 19s
CI / helm (push) Successful in 24s
CI / lint (push) Successful in 29s
CI / security (push) Successful in 1m11s
CI / e2e_tests (push) Successful in 2m56s
CI / quality (push) Successful in 3m40s
CI / typecheck (push) Successful in 3m59s
CI / integration_tests (push) Successful in 4m3s
CI / unit_tests (push) Successful in 4m55s
CI / docker (push) Successful in 10s
CI / coverage (push) Successful in 10m44s
CI / status-check (push) Successful in 1s
CI / benchmark-regression (push) Has been skipped
CI / benchmark-publish (push) Successful in 1h13m28s
feat(tests): replace all @skip tags with proper @tdd_expected_fail tags or remove them across the entire codebase (#7221)
## Summary

Replaces all 234 bare `@skip` occurrences across 82 Behave feature files with the correct TDD issue-capture tagging system described in CONTRIBUTING.md § Bug Fix Workflow.

Previously, the noxfile ran Behave with `--tags=not @skip`, silently excluding all `@skip`-tagged scenarios from every CI run. These tests never ran, never inverted results via the `@tdd_expected_fail` mechanism, and never contributed to coverage — defeating the purpose of TDD issue-capture testing. Every `@skip` occurrence had a commented-out hint line immediately above it showing the intended proper tags (e.g., `# @tdd_issue @tdd_issue_4272 @tdd_expected_fail @skip`), confirming they were all intended for conversion.

## Changes

### Mechanical conversion (234 replacements across 82 files)
- Extracted the proper TDD tags from the comment hint above each `@skip` line, removed `@skip` from the tag set, and replaced the `@skip` line with those tags.
- Removed the now-redundant comment hint lines alongside each replacement.

### Bug-fixed scenarios — `@tdd_expected_fail` removed (84 scenarios)
- After conversion, ran `nox -s unit_tests` to identify which newly-enabled `@tdd_expected_fail` scenarios now **pass** (their referenced bugs have already been fixed). Removed `@tdd_expected_fail` from those 84 scenarios and their corresponding feature-level tags, leaving only the permanent `@tdd_issue @tdd_issue_<N>` regression-guard tags.
- Affected features include: `tdd_tool_runner_env_precedence`, `tdd_automation_profile_session_leak`, `tls_certificate_check`, `project_create_persist`, `resource_type_bootstrap_*`, and 18 others.

### Noxfile cleanup
- Removed all four `--tags=not @skip` arguments from `noxfile.py` (unit_tests and coverage sessions). With zero `@skip` tags remaining in the codebase, this filter was dead code and its presence would mislead future maintainers into thinking `@skip` is still a supported escape mechanism.

### Regression guard files
- Split the regression guards into two focused files:
  - `tdd_regression_guards_exec_env.feature` for bug #4281 (exec-env precedence)
  - `tdd_regression_guards_session_list.feature` for bug #4271 (session list summary)
- Each file carries only its own `@tdd_issue` tags at the feature level, avoiding cross-contamination via Behave tag inheritance. The `Background` step (`session-list-summary mock`) only appears in the session-list file where it is actually needed.

### Duplicate tag cleanup
- Removed duplicate `@tdd_issue @tdd_issue_4287` tag lines in `tdd_skill_add_regression.feature` (lines 20 and 29).

### Inline comment for retained `@tdd_expected_fail`
- Added inline comment in `ci_workflow_validation.feature:134` explaining why this specific #4227 scenario retains `@tdd_expected_fail` despite #4227 being closed (CI YAML does not encode threshold as a machine-readable value).

### Known edge cases — `@tdd_expected_fail` retained (closed issues, fix on master, scenarios still fail)
The following issues are **closed** and their fixes **are on master**, but the specific test assertions still fail because the fixes address other aspects of the bugs. The `@tdd_expected_fail` tags are functionally correct and must remain until the specific scenario assertions pass:
- `tdd_exec_env_resolution_precedence.feature` — bug #1080 (closed 2026-03-31). The precedence-level-2-vs-4 scenario still fails.
- `session_list_summary_dedup.feature` — bug #3046 (closed 2026-04-05). The dedup-consistency scenarios still fail.
- `actor_add_update_enforcement.feature` — bug #2609 (closed 2026-04-05). The enforcement scenarios still fail.
- `ci_workflow_validation.feature:134` — #4227 (closed 2026-04-08). The CI YAML threshold assertion still fails.

## Verification

- `grep -r "@skip" features/ --include="*.feature"` → **zero results** ✓
- `grep -n "tags=not @skip" noxfile.py` → **zero results** ✓
- `nox -s unit_tests` → **629 features passed, 0 failed** ✓ (up from ~545 before this PR)
- CI all green (coverage ≥ 97%) ✓
- Integration tests (Robot Framework) do not use `@skip` — confirmed no action needed ✓
- E2E tests (Robot Framework) do not use `@skip` — confirmed no action needed ✓
- `CHANGELOG.md` updated with entry for this change ✓
- `CONTRIBUTORS.md` — Rui Hu already listed ✓

## Issues Addressed

Closes #7025

Co-authored-by: CleverThis <hal9000@cleverthis.com>
Reviewed-on: #7221
Reviewed-by: HAL 9000 <HAL9000@cleverthis.com>
Reviewed-by: HAL9001 <hal9001@cleverthis.com>
Co-authored-by: Rui Hu <rui.hu@cleverthis.com>
Co-committed-by: Rui Hu <rui.hu@cleverthis.com>
2026-04-13 04:56:01 +00:00

319 lines
12 KiB
Gherkin

Feature: Actor CLI coverage
As a developer
I want actor CLI commands covered
So that actor management paths stay stable
Scenario: Add actor fails without config
Given an actor CLI runner
When I run actor add without config
Then the actor command should fail with bad parameter
@tdd_issue @tdd_issue_4232 @tdd_expected_fail
Scenario: Add actor with JSON config file
Given an actor CLI runner
And I have an actor JSON config file
When I run actor add with that config
Then the actor add should pass the loaded config
Scenario: Add actor requires unsafe confirmation when config is marked unsafe
Given an actor CLI runner
And I have an unsafe actor JSON config file
When I run actor add with that config
Then the actor command should fail with bad parameter
@tdd_issue @tdd_issue_4232 @tdd_expected_fail
Scenario: Add actor allows unsafe config when flag is provided
Given an actor CLI runner
And I have an unsafe actor JSON config file
When I run actor add with that config and unsafe flag
Then the actor add should pass the loaded config
Scenario: Add actor fails when config is missing
Given an actor CLI runner
When I run actor add with missing config path
Then the actor command should fail with bad parameter
Scenario: Add actor rejects non-dictionary config input
Given an actor CLI runner
And I have an actor list config file
When I run actor add with that config
Then the actor command should fail with bad parameter
@tdd_issue @tdd_issue_4232 @tdd_expected_fail
Scenario: Add actor falls back to YAML-only config
Given an actor CLI runner
And I have an actor YAML-only config file
When I run actor add with that config
Then the actor add should pass the loaded config
@tdd_issue @tdd_issue_4232 @tdd_expected_fail
Scenario: Add actor uses service path with graph descriptor
Given an actor CLI runner
And I have an actor graph config file
When I run actor add via service with that config
Then the service actor add should include graph descriptor
@tdd_issue @tdd_issue_4232 @tdd_expected_fail
Scenario: Add actor merges CLI options into config blob
Given an actor CLI runner
And I have an actor JSON config file
When I run actor add with that config and options overrides
Then the actor add should pass the loaded config
Scenario: Add actor rejects empty config file
Given an actor CLI runner
And I have an empty actor YAML config file
When I run actor add with that config
Then the actor command should fail with bad parameter
@tdd_issue @tdd_issue_4232 @tdd_expected_fail
Scenario: Add actor aborts on business rule violation
Given an actor CLI runner
When I run actor add with business rule violation
Then the actor command should abort with error
Scenario: Add actor rejects unsafe service config without confirmation
Given an actor CLI runner
And I have an unsafe actor JSON config file
When I run actor add via service without unsafe flag
Then the actor command should fail with bad parameter
And the actor service should not be called
Scenario: Update actor from YAML config and safe flag
Given an actor CLI runner
And I have an actor YAML config file returning empty data
When I run actor update with safe flag and yaml config
Then the actor update should set safe and merge config
Scenario: Update actor toggles unsafe flag
Given an actor CLI runner
When I run actor update with unsafe flag
Then the actor update should set unsafe flag
Scenario: Update actor aborts on validation error
Given an actor CLI runner
When I run actor update with validation error
Then the actor command should abort with error
Scenario: Update actor aborts when not found
Given an actor CLI runner
When I run actor update for missing actor
Then the actor command should abort for missing actor
Scenario: Update actor rejects conflicting safety flags
Given an actor CLI runner
When I run actor update with conflicting flags
Then the actor command should fail with bad parameter
Scenario: Update actor requires unsafe confirmation when requested
Given an actor CLI runner
When I run actor update requiring unsafe confirmation
Then the actor command should fail with bad parameter
Scenario: Update actor rejects unsafe service config without confirmation
Given an actor CLI runner
And I have an unsafe actor JSON config file
When I run actor update via service without unsafe flag
Then the actor command should abort with error
And the actor service should not be called
Scenario: Remove actor succeeds
Given an actor CLI runner
When I run actor remove successfully
Then the actor remove should succeed
Scenario: Remove actor aborts on validation error
Given an actor CLI runner
When I run actor remove and it fails validation
Then the actor command should abort with error
Scenario: List actors when none exist
Given an actor CLI runner
When I run actor list with no actors
Then the actor list should report empty state
Scenario: List actors with entries
Given an actor CLI runner
When I run actor list with two actors
Then the actor list should render rows
Scenario: Show actor displays details
Given an actor CLI runner
When I run actor show successfully
Then the actor show should display details
Scenario: Show actor aborts on validation error
Given an actor CLI runner
When I run actor show with validation error
Then the actor command should abort with error
Scenario: Set default actor succeeds
Given an actor CLI runner
When I run set-default actor successfully
Then the set default actor should display details
Scenario: Set default actor aborts on business rule violation
Given an actor CLI runner
When I run set-default actor with violation
Then the actor command should abort with error
@tdd_issue @tdd_issue_4232 @tdd_expected_fail
Scenario: Add actor merges options and parses boolean override
Given an actor CLI runner
And I have an actor JSON config file with options
When I run actor add with boolean option override
Then the actor add should pass the loaded config
Scenario: Add actor rejects option without separator
Given an actor CLI runner
And I have an actor JSON config file
When I run actor add with malformed option
Then the actor command should fail with bad parameter
Scenario: Add actor rejects empty option key
Given an actor CLI runner
And I have an actor JSON config file
When I run actor add with empty option key
Then the actor command should fail with bad parameter
@tdd_issue @tdd_issue_4232 @tdd_expected_fail
Scenario: Add actor via service rejects unsafe canonical config
Given an actor CLI runner
And I have an actor JSON config file
When I run actor add via service with unsafe canonical blob
Then the actor command should abort with error
Scenario: Update actor includes option overrides in registry call
Given an actor CLI runner
When I run actor update with option overrides
Then the actor update should include option overrides
Scenario: Update actor parses uppercase boolean option override
Given an actor CLI runner
When I run actor update with uppercase boolean option override
Then the actor update should include option overrides
Scenario: Update actor via service rejects unsafe canonical config
Given an actor CLI runner
And I have an actor JSON config file
When I run actor update via service with unsafe canonical blob
Then the actor command should abort with error
Scenario: Update actor via service succeeds with safe config
Given an actor CLI runner
And I have an actor JSON config file
When I run actor update via service with safe config
Then the actor service update should succeed
Scenario: Remove actor falls back to service path
Given an actor CLI runner
When I run actor remove via service path
Then the actor service remove should be called
@tdd_issue @tdd_issue_4232 @tdd_expected_fail
Scenario: Add actor parses uppercase boolean option override
Given an actor CLI runner
And I have an actor JSON config file with options
When I run actor add with uppercase boolean option override
Then the actor add should pass the loaded config
Scenario: Run actor uses load context with named context
Given an actor CLI runner
And I have an actor JSON config file
And I have a saved context JSON file
And I have an actor output file path
When I run actor run with load context and context name
Then the actor run should write output and persist context
Scenario: Run actor loads context without name
Given an actor CLI runner
And I have an actor JSON config file
And I have a saved context JSON file
When I run actor run with load context only
Then the actor run should update global context and echo result
Scenario: Run actor reuses named context
Given an actor CLI runner
And I have an actor JSON config file
When I run actor run with context only
Then the actor run should reuse saved context
Scenario: Run actor executes without context
Given an actor CLI runner
And I have an actor JSON config file
When I run actor run without context
Then the actor run should call single shot without context manager
Scenario: Run actor forwards allow-rxpy flag with named context and output
Given an actor CLI runner
And I have an actor JSON config file
And I have a saved context JSON file
And I have an actor output file path
When I run actor run with load context and context name allowing rxpy
Then the actor run should write output and persist context
And the actor run should pass allow rxpy flag
Scenario: Run actor forwards allow-rxpy flag when loading context only
Given an actor CLI runner
And I have an actor JSON config file
And I have a saved context JSON file
When I run actor run with load context only allowing rxpy
Then the actor run should update global context and echo result
And the actor run should pass allow rxpy flag
Scenario: Run actor forwards allow-rxpy flag when reusing context
Given an actor CLI runner
And I have an actor JSON config file
When I run actor run with context only allowing rxpy
Then the actor run should reuse saved context
And the actor run should pass allow rxpy flag
Scenario: Run actor forwards allow-rxpy flag without context
Given an actor CLI runner
And I have an actor JSON config file
When I run actor run without context allowing rxpy
Then the actor run should call single shot without context manager
And the actor run should pass allow rxpy flag
Scenario: Run actor reports unsafe configuration error
Given an actor CLI runner
And I have an actor JSON config file
When I run actor run with unsafe configuration error
Then the actor run should exit with error code 1
Scenario: Run actor reports clever agents error
Given an actor CLI runner
And I have an actor JSON config file
When I run actor run with clever agents error
Then the actor run should exit with error code 2
@coverage
Scenario: Run actor with single skill flag
Given an actor CLI runner
And I have an actor JSON config file
When I run actor run with a single skill flag
Then the actor run should pass skill names to the runtime
@coverage
Scenario: Run actor with multiple skill flags
Given an actor CLI runner
And I have an actor JSON config file
When I run actor run with multiple skill flags
Then the actor run should pass all skill names to the runtime
@coverage
Scenario: Run actor with unknown skill flag
Given an actor CLI runner
And I have an actor JSON config file
When I run actor run with an unknown skill flag
Then the actor run should exit with skill not found error
@coverage
Scenario: Run actor with skill and context flags combined
Given an actor CLI runner
And I have an actor JSON config file
When I run actor run with skill and context flags
Then the actor run should pass skill names to the runtime
And the context manager should have been instantiated
And the context manager exists should have been called