Files
cleveragents-core/robot/resource_handler_sandbox.robot
hamza.khyari 7bb77aee5c
CI / build (pull_request) Successful in 14s
CI / lint (pull_request) Successful in 4m3s
CI / quality (pull_request) Successful in 4m1s
CI / typecheck (pull_request) Successful in 4m30s
CI / security (pull_request) Successful in 5m12s
CI / unit_tests (pull_request) Successful in 8m45s
CI / integration_tests (pull_request) Successful in 8m43s
CI / docker (pull_request) Successful in 1m13s
CI / e2e_tests (pull_request) Successful in 13m7s
CI / coverage (pull_request) Successful in 12m43s
CI / status-check (pull_request) Successful in 1s
CI / benchmark-publish (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Successful in 1h9m12s
feat(resource): implement ResourceHandler sandbox and checkpoint methods
Extend the ResourceHandler protocol with four sandbox/lifecycle methods:
create_sandbox (idempotent), create_checkpoint, rollback_to, project_access.

Fixes from self-review:
- Instance-level checkpoint dict instead of ClassVar (no shared state)
- Git rollback uses 'git reset --hard' + 'git clean -fd' (not just checkout)
- FsDirectory rollback skips .git to preserve git metadata
- project_access separates ImportError (local mode) from ValueError (reject)
- Added discard_checkpoints() cleanup method
- Git rollback test verifies file content restored

ISSUES CLOSED: #836
2026-03-27 10:50:15 +00:00

29 lines
1.4 KiB
Plaintext

*** Settings ***
Documentation Integration tests for ResourceHandler sandbox and checkpoint lifecycle.
... Exercises the checkpoint -> modify -> rollback cycle on real
... temporary directories and git repos.
... Issue #836: ResourceHandler sandbox and checkpoint methods.
Resource ${CURDIR}/common.resource
Suite Setup Setup Test Environment
Suite Teardown Cleanup Test Environment
*** Variables ***
${HELPER} ${CURDIR}/helper_resource_handler_sandbox.py
*** Test Cases ***
FsDirectory Checkpoint Rollback Cycle
[Documentation] FsDirectory: sandbox -> checkpoint -> modify -> rollback -> verify restored
${result}= Run Process ${PYTHON} ${HELPER} fs-checkpoint-rollback cwd=${WORKSPACE} timeout=30s on_timeout=kill
Log ${result.stdout}
Log ${result.stderr}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} fs-checkpoint-rollback-ok
GitCheckout Checkpoint Rollback Cycle
[Documentation] GitCheckout: sandbox -> checkpoint -> modify -> rollback -> verify restored
${result}= Run Process ${PYTHON} ${HELPER} git-checkpoint-rollback cwd=${WORKSPACE} timeout=30s on_timeout=kill
Log ${result.stdout}
Log ${result.stderr}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} git-checkpoint-rollback-ok