MCPcopy Create free account
hub / github.com/github/gh-aw / TestOpenCodeEngine

Function TestOpenCodeEngine

pkg/workflow/opencode_engine_test.go:14–30  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

12)
13
14func TestOpenCodeEngine(t *testing.T) {
15 engine := NewOpenCodeEngine()
16
17 t.Run("engine identity and capabilities", func(t *testing.T) {
18 capabilities := engine.GetCapabilities()
19 assert.Equal(t, "opencode", engine.GetID(), "Engine ID should be 'opencode'")
20 assert.Equal(t, "OpenCode", engine.GetDisplayName(), "Display name should be 'OpenCode'")
21 assert.True(t, engine.IsExperimental(), "OpenCode engine should be experimental")
22 assert.False(t, capabilities.ToolsAllowlist, "Should not support tools allowlist")
23 assert.True(t, capabilities.MaxTurns, "Should support max turns")
24 assert.False(t, capabilities.WebSearch, "Should not support built-in web search")
25 })
26
27 t.Run("model env var name", func(t *testing.T) {
28 assert.Equal(t, constants.OpenCodeCLIModelEnvVar, engine.GetModelEnvVarName(), "Should return OPENCODE_MODEL")
29 })
30}
31
32func TestOpenCodeEngineInstallationAndExecution(t *testing.T) {
33 engine := NewOpenCodeEngine()

Callers

nothing calls this directly

Calls 7

GetModelEnvVarNameMethod · 0.95
NewOpenCodeEngineFunction · 0.85
GetCapabilitiesMethod · 0.65
GetIDMethod · 0.65
GetDisplayNameMethod · 0.65
IsExperimentalMethod · 0.65
RunMethod · 0.45

Tested by

no test coverage detected