chore: add frontend dependencies and update test fixtures
- Add react-router-dom, @tanstack/react-query, zustand, @headlessui/react - Update pnpm workspace configuration - Update test fixtures to reference OpenCode instead of RunFusion - Add frontend environment variable examples - Update .gitignore for .opencode and .sisyphus directories
This commit is contained in:
@@ -6,7 +6,6 @@ import pytest
|
||||
from pydantic import ValidationError
|
||||
|
||||
from app.tools.models import (
|
||||
ExecutableConfig,
|
||||
HealthCheckConfig,
|
||||
MountConfig,
|
||||
PortConfig,
|
||||
@@ -36,33 +35,32 @@ def _minimal_manifest(**overrides: object) -> ToolManifest:
|
||||
# Valid construction
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
def test_valid_runfusion_shape() -> None:
|
||||
def test_valid_opencode_shape() -> None:
|
||||
manifest = ToolManifest(
|
||||
id="runfusion",
|
||||
name="RunFusion",
|
||||
description="Executable Node.js environment.",
|
||||
image="node:22-slim",
|
||||
id="opencode",
|
||||
name="OpenCode",
|
||||
description="AI-powered terminal-based development environment.",
|
||||
image="ghcr.io/opencode-ai/opencode:latest",
|
||||
runtime_working_dir="/workspace",
|
||||
ports=[PortConfig(container_port=8080, name="http", primary=True)],
|
||||
ports=[PortConfig(container_port=3000, name="http", primary=True)],
|
||||
workspace_mounts=[
|
||||
MountConfig(source_pattern="{project_repo}", target="/workspace")
|
||||
],
|
||||
config_mounts=[
|
||||
MountConfig(
|
||||
source_pattern="{user_config}/runfusion", target="/home/node/.config"
|
||||
source_pattern="{user_config}/opencode", target="/root/.config/opencode"
|
||||
)
|
||||
],
|
||||
env={"NODE_ENV": "development"},
|
||||
env={"TERM": "xterm-256color", "FORCE_COLOR": "1"},
|
||||
health_check=HealthCheckConfig(
|
||||
type="http", path="/", port=8080, start_period_seconds=10
|
||||
type="http", path="/", port=3000, start_period_seconds=15
|
||||
),
|
||||
resource_limits=ResourceLimits(cpus=2.0, memory_mb=2048),
|
||||
executable=ExecutableConfig(node_version="22", package_manager="npm"),
|
||||
resource_limits=ResourceLimits(cpus=2.0, memory_mb=4096),
|
||||
traefik=TraefikConfig(
|
||||
enabled=True, subdomain_prefix="runfusion", port=8080
|
||||
enabled=True, subdomain_prefix="opencode", port=3000
|
||||
),
|
||||
)
|
||||
assert manifest.id == "runfusion"
|
||||
assert manifest.id == "opencode"
|
||||
assert manifest.ports[0].primary is True
|
||||
assert manifest.traefik is not None
|
||||
assert manifest.traefik.enabled is True
|
||||
@@ -102,13 +100,13 @@ def test_valid_code_server_shape() -> None:
|
||||
|
||||
def test_invalid_id_uppercase() -> None:
|
||||
with pytest.raises(ValidationError) as exc_info:
|
||||
_minimal_manifest(id="RunFusion")
|
||||
_minimal_manifest(id="OpenCode")
|
||||
assert "id" in str(exc_info.value)
|
||||
|
||||
|
||||
def test_invalid_id_spaces() -> None:
|
||||
with pytest.raises(ValidationError) as exc_info:
|
||||
_minimal_manifest(id="run fusion")
|
||||
_minimal_manifest(id="open code")
|
||||
assert "id" in str(exc_info.value)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user