fix: update SDK for non-root user capsules
All checks were successful
ci/woodpecker/push/unit Pipeline was successful

- Update default template from minimal to minimal-ubuntu
- Replace /root and /home/user paths with /home/wrenn-user in tests
- Update file ownership from root:root to wrenn-user:wrenn-user
- Add sudo-related integration tests
- Regenerate pydantic models from updated OpenAPI spec
  - Add snapshotting status, AdminTemplate schema, protected field
  - Rename Type1→Type5 enums to match new spec
- Update OpenAPI spec for async snapshot endpoints
This commit is contained in:
2026-05-23 01:57:34 +06:00
parent 98028bab52
commit 08314b172b
6 changed files with 219 additions and 80 deletions

View File

@ -323,7 +323,7 @@ class TestFiles:
class TestGit:
"""Shared capsule for git operation tests.
Initializes a repo at /root (default cwd) since the exec API
Initializes a repo at /home/wrenn-user (default cwd) since the exec API
does not support the cwd parameter.
"""
@ -344,14 +344,14 @@ class TestGit:
pass
def test_init_created_repo(self):
assert self.capsule.files.exists("/root/.git")
assert self.capsule.files.exists("/home/wrenn-user/.git")
def test_status_clean(self):
status = self.capsule.git.status()
assert status.branch == "main"
def test_add_and_commit(self):
self.capsule.files.write("/root/hello.txt", "hello git")
self.capsule.files.write("/home/wrenn-user/hello.txt", "hello git")
self.capsule.git.add(all=True)
result = self.capsule.git.commit("initial commit")
assert result.exit_code == 0
@ -361,14 +361,14 @@ class TestGit:
assert status.is_clean
def test_status_with_changes(self):
self.capsule.files.write("/root/dirty.txt", "uncommitted")
self.capsule.files.write("/home/wrenn-user/dirty.txt", "uncommitted")
try:
status = self.capsule.git.status()
assert not status.is_clean
paths = [f.path for f in status.files]
assert "dirty.txt" in paths
finally:
self.capsule.files.remove("/root/dirty.txt")
self.capsule.files.remove("/home/wrenn-user/dirty.txt")
def test_branches(self):
branches = self.capsule.git.branches()