Files
cleveragents-core/features/cow_sandbox_coverage_boost.feature
T
Jeffrey Phillips Freeman 36c571db83
CI / lint (pull_request) Successful in 15s
CI / typecheck (pull_request) Successful in 30s
CI / security (pull_request) Successful in 22s
CI / quality (pull_request) Successful in 16s
CI / integration_tests (pull_request) Successful in 5m12s
CI / build (pull_request) Successful in 16s
CI / lint (push) Successful in 13s
CI / typecheck (push) Successful in 29s
CI / security (push) Successful in 23s
CI / quality (push) Successful in 16s
CI / unit_tests (pull_request) Successful in 13m42s
CI / integration_tests (push) Successful in 4m53s
CI / build (push) Successful in 16s
CI / unit_tests (push) Successful in 15m9s
CI / coverage (pull_request) Successful in 7m58s
CI / coverage (push) Successful in 8m14s
CI / docker (pull_request) Successful in 9s
CI / docker (push) Successful in 8s
feat(repo): add resource repositories
2026-02-16 21:35:54 +00:00

89 lines
3.9 KiB
Gherkin

Feature: Copy-on-write sandbox coverage boost
As a developer
I want to exercise uncovered edge-case paths in CopyOnWriteSandbox
So that code coverage for copy_on_write.py is comprehensive
# --- SandboxCreationError re-raise when original path is a file ---
Scenario: Creating a sandbox on a file (not directory) raises SandboxCreationError
Given a cowcb temporary file instead of a directory
When a cowcb sandbox is created on that file for plan "plan-err"
Then a cowcb SandboxCreationError should be raised
And the cowcb sandbox status should be "errored"
# --- get_path with _sandbox_path manually set to None ---
Scenario: get_path raises SandboxStateError when sandbox_path is None
Given a cowcb sandbox with status CREATED and sandbox_path None
When cowcb get_path is called with "file.txt"
Then a cowcb SandboxStateError should be raised with message "Sandbox path not set"
# --- commit with _sandbox_path manually set to None ---
Scenario: commit raises SandboxStateError when sandbox_path is None
Given a cowcb sandbox with status ACTIVE and sandbox_path None
When cowcb commit is called
Then a cowcb SandboxStateError should be raised with message "Sandbox path not set"
# --- commit triggers OSError during sync ---
Scenario: commit wraps OSError into SandboxCommitError
Given a cowcb test directory is initialised
And a cowcb sandbox is created and activated for plan "plan-oserr"
When the cowcb original directory is removed before commit
And cowcb commit is called
Then a cowcb SandboxCommitError should be raised
And the cowcb sandbox status should be "errored"
# --- rollback with _sandbox_path manually set to None ---
Scenario: rollback raises SandboxStateError when sandbox_path is None
Given a cowcb sandbox with status ACTIVE and sandbox_path None
When cowcb rollback is called
Then a cowcb SandboxStateError should be raised with message "Sandbox path not set"
# --- rollback triggers OSError during re-copy ---
Scenario: rollback wraps OSError into SandboxRollbackError
Given a cowcb test directory is initialised
And a cowcb sandbox is created and activated for plan "plan-rbfail"
When the cowcb original directory is removed before rollback
And cowcb rollback is called
Then a cowcb SandboxRollbackError should be raised
And the cowcb sandbox status should be "errored"
# --- cleanup when _sandbox_path is None ---
Scenario: cleanup succeeds when sandbox_path is None
Given a cowcb sandbox with status PENDING and sandbox_path None
When cowcb cleanup is called
Then the cowcb sandbox status should be "cleaned_up"
# --- cleanup when sandbox parent directory does not exist ---
Scenario: cleanup succeeds when sandbox parent directory is already gone
Given a cowcb test directory is initialised
And a cowcb sandbox is created for plan "plan-cleanparent"
When the cowcb sandbox parent directory is removed
And cowcb cleanup is called
Then the cowcb sandbox status should be "cleaned_up"
# --- commit with dst_dir that needs creation (added file in subdirectory) ---
Scenario: commit creates missing destination subdirectories for added files
Given a cowcb test directory is initialised
And a cowcb sandbox is created and activated for plan "plan-subdir"
When a cowcb file "newdir/nested/added.txt" is created in the sandbox
And cowcb commit is called
Then the cowcb commit should succeed
And the cowcb file "newdir/nested/added.txt" should exist in the original directory
# --- commit with file deleted from sandbox that is already missing from original ---
Scenario: commit handles deleted file not present in original
Given a cowcb test directory is initialised
And a cowcb sandbox is created and activated for plan "plan-delmissing"
When the cowcb file "existing.txt" is deleted from both sandbox and original
And cowcb commit is called
Then the cowcb commit should succeed