Files
cleveragents-core/features/tdd_container_instance_stop_2588.feature
freemo 9664271562
CI / lint (pull_request) Successful in 20s
CI / typecheck (pull_request) Successful in 1m17s
CI / quality (pull_request) Successful in 40s
CI / security (pull_request) Successful in 1m4s
CI / build (pull_request) Successful in 31s
CI / helm (pull_request) Successful in 23s
CI / unit_tests (pull_request) Successful in 6m52s
CI / e2e_tests (pull_request) Successful in 17m9s
CI / integration_tests (pull_request) Successful in 23m1s
CI / coverage (pull_request) Successful in 10m39s
CI / docker (pull_request) Successful in 1m21s
CI / status-check (pull_request) Successful in 1s
CI / benchmark-publish (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Successful in 58m45s
fix(resources): allow agents resource stop to stop container-instance and devcontainer-instance resources
Add container-instance to _STOPPABLE_TYPES so that agents resource stop
accepts both container-instance and devcontainer-instance resources, as
required by the specification. The stop_container function already uses
docker stop with the container_id from the lifecycle tracker, which works
generically for both resource types.

- Add container-instance to _STOPPABLE_TYPES frozenset
- Update resource_stop() docstring to reflect both stoppable types
- Update devcontainer_cleanup.feature: F19 scenario now expects success
  for container-instance stop (was incorrectly expecting rejection)
- Add TDD feature file and step definitions for issue #2588 regression
  guard

ISSUES CLOSED: #2588
2026-04-05 08:22:45 +00:00

36 lines
1.8 KiB
Gherkin

@tdd_issue @tdd_issue_2588
Feature: TDD Issue #2588 — agents resource stop rejects container-instance resources
As a CleverAgents user
I want to stop container-instance resources via agents resource stop
So that both container-instance and devcontainer-instance resources
can be stopped as required by the specification
The specification states:
"Stop an active devcontainer-instance or container-instance resource.
Transitions the container through running -> stopping -> stopped.
Only container-typed resources may be stopped."
Scenario: container-instance is accepted by resource stop
Given a running container-instance resource "local/my-ctr" with id "01TDD2588CONTAINERINST001"
When I invoke resource stop for "local/my-ctr" with --yes
Then the stop exit code should be 0
And the stop output should contain "Stopped"
Scenario: devcontainer-instance is still accepted by resource stop
Given a running devcontainer-instance resource "local/my-dc" with id "01TDD2588DEVCONTAINERINST1"
When I invoke resource stop for "local/my-dc" with --yes
Then the stop exit code should be 0
And the stop output should contain "Stopped"
Scenario: non-container resource type is still rejected by resource stop
Given a git-checkout resource "local/my-repo" with id "01TDD2588GITCHECKOUT00001"
When I invoke resource stop for "local/my-repo" with --yes
Then the stop exit code should be non-zero
And the stop output should contain "not a stoppable container type"
Scenario: _STOPPABLE_TYPES contains both container types
When I inspect the _STOPPABLE_TYPES constant
Then _STOPPABLE_TYPES should contain "container-instance"
And _STOPPABLE_TYPES should contain "devcontainer-instance"
And _STOPPABLE_TYPES should not contain "git-checkout"