forked from cleveragents/cleveragents-core
f61f29ac26
Add Robot Framework integration test suite and Python helper for
Specification Workflow Example 16: Devcontainer-Driven Development.
Files added:
- robot/wf16_devcontainer.robot: 5 Robot Framework test cases
- robot/helper_wf16_devcontainer.py: Python helper with 5 subcommands
Test coverage:
- WF16 Step 1: Resource auto-detection of .devcontainer/devcontainer.json
via discover_devcontainers() API
- WF16 Step 2: Project create and link-resource with git-checkout resource
- WF16 Step 3: Plan creation with supervised automation profile
- WF16 Step 4: Plan execute with devcontainer lazy activation (mocked
container runtime via _MockRunner)
- WF16 Step 5: Plan apply writing changes to host via bind mount tracking
Design decisions:
- Container operations fully mocked via DevcontainerHandler and
DevcontainerLifecycleService using _MockRunner (no real Docker)
- Container IDs use valid lowercase hex format matching
_CONTAINER_ID_PATTERN (^[a-f0-9]{12,64}$)
- .devcontainer/devcontainer.json fixture created in temp directory
for auto-detection testing
- Exercises 6-level execution environment precedence chain (level 3:
nearest-ancestor devcontainer)
Quality gates: lint PASS, typecheck PASS (0 errors), 5/5 WF16 tests PASS
ISSUES CLOSED: #780
76 lines
3.7 KiB
Plaintext
76 lines
3.7 KiB
Plaintext
*** Settings ***
|
|
Documentation Integration test for Specification Workflow Example 16:
|
|
... Devcontainer-Driven Development (supervised profile).
|
|
...
|
|
... Exercises devcontainer auto-discovery from
|
|
... ``.devcontainer/devcontainer.json``, lazy container
|
|
... activation on first execution, execution environment
|
|
... routing to container workspace, and host apply via
|
|
... bind mount using mocked LLM providers and mocked
|
|
... container operations.
|
|
Force Tags wf16 integration devcontainer v3.7.0 tdd_issue tdd_issue_780
|
|
Resource ${CURDIR}/common.resource
|
|
Suite Setup Setup Test Environment With Database Isolation
|
|
Suite Teardown Cleanup Test Environment
|
|
|
|
*** Variables ***
|
|
${HELPER} ${CURDIR}/helper_wf16_devcontainer.py
|
|
|
|
*** Test Cases ***
|
|
WF16 Step 1 Resource Auto Detection
|
|
[Documentation] Register git-checkout resource with
|
|
... ``.devcontainer/`` directory and verify
|
|
... auto-detection of devcontainer-instance child
|
|
... resource via ``discover_devcontainers()``.
|
|
[Timeout] 120s
|
|
${result}= Run Process ${PYTHON} ${HELPER} wf16-resource-auto-detection cwd=${WORKSPACE} timeout=120s on_timeout=kill
|
|
Log ${result.stdout}
|
|
Log ${result.stderr}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} wf16-detect-ok
|
|
|
|
WF16 Step 2 Project And Link
|
|
[Documentation] Create project and link the git-checkout resource
|
|
... that contains a devcontainer configuration.
|
|
[Timeout] 120s
|
|
${result}= Run Process ${PYTHON} ${HELPER} wf16-project-and-link cwd=${WORKSPACE} timeout=120s on_timeout=kill
|
|
Log ${result.stdout}
|
|
Log ${result.stderr}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} wf16-project-ok
|
|
|
|
WF16 Step 3 Plan With Devcontainer
|
|
[Documentation] Create action and ``plan use`` with supervised
|
|
... automation profile targeting the devcontainer
|
|
... project. Verifies plan is created in strategize
|
|
... phase.
|
|
[Timeout] 120s
|
|
${result}= Run Process ${PYTHON} ${HELPER} wf16-plan-with-devcontainer cwd=${WORKSPACE} timeout=120s on_timeout=kill
|
|
Log ${result.stdout}
|
|
Log ${result.stderr}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} wf16-plan-ok
|
|
|
|
WF16 Step 4 Execute In Container
|
|
[Documentation] ``plan execute`` triggers devcontainer lazy build
|
|
... and routes tool invocations to the container
|
|
... workspace. Verifies lazy activation via mocked
|
|
... container operations and session ID propagation.
|
|
[Timeout] 120s
|
|
${result}= Run Process ${PYTHON} ${HELPER} wf16-execute-in-container cwd=${WORKSPACE} timeout=120s on_timeout=kill
|
|
Log ${result.stdout}
|
|
Log ${result.stderr}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} wf16-execute-ok
|
|
|
|
WF16 Step 5 Apply To Host
|
|
[Documentation] ``plan apply --yes`` writes changes back to host
|
|
... via bind mount. Verifies host_workspace_path
|
|
... tracking and container stop after apply.
|
|
[Timeout] 120s
|
|
${result}= Run Process ${PYTHON} ${HELPER} wf16-apply-to-host cwd=${WORKSPACE} timeout=120s on_timeout=kill
|
|
Log ${result.stdout}
|
|
Log ${result.stderr}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} wf16-apply-ok
|