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

Function TestRepoMemoryConfigDefault

pkg/workflow/repo_memory_test.go:14–58  ·  view source on GitHub ↗

TestRepoMemoryConfigDefault tests basic repo-memory configuration with boolean true

(t *testing.T)

Source from the content-addressed store, hash-verified

12
13// TestRepoMemoryConfigDefault tests basic repo-memory configuration with boolean true
14func TestRepoMemoryConfigDefault(t *testing.T) {
15 toolsMap := map[string]any{
16 "repo-memory": true,
17 }
18
19 toolsConfig, err := ParseToolsConfig(toolsMap)
20 if err != nil {
21 t.Fatalf("Failed to parse tools config: %v", err)
22 }
23
24 compiler := NewCompiler()
25 config, err := compiler.extractRepoMemoryConfig(toolsConfig, "my-workflow")
26 if err != nil {
27 t.Fatalf("Failed to extract repo-memory config: %v", err)
28 }
29
30 if config == nil {
31 t.Fatal("Expected non-nil config")
32 }
33
34 if len(config.Memories) != 1 {
35 t.Fatalf("Expected 1 memory, got %d", len(config.Memories))
36 }
37
38 memory := config.Memories[0]
39 if memory.ID != "default" {
40 t.Errorf("Expected ID 'default', got '%s'", memory.ID)
41 }
42
43 if memory.BranchName != "memory/my-workflow" {
44 t.Errorf("Expected branch name 'memory/my-workflow', got '%s'", memory.BranchName)
45 }
46
47 if memory.MaxFileSize != 102400 {
48 t.Errorf("Expected max file size 102400, got %d", memory.MaxFileSize)
49 }
50
51 if memory.MaxFileCount != 100 {
52 t.Errorf("Expected max file count 100, got %d", memory.MaxFileCount)
53 }
54
55 if !memory.CreateOrphan {
56 t.Error("Expected create-orphan to be true by default")
57 }
58}
59
60// TestRepoMemoryConfigObject tests repo-memory configuration with object notation
61func TestRepoMemoryConfigObject(t *testing.T) {

Callers

nothing calls this directly

Calls 5

ParseToolsConfigFunction · 0.85
NewCompilerFunction · 0.85
ErrorfMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected