@@ -18,6 +18,7 @@ import (
1818 "github.com/gastownhall/gascity/internal/beads"
1919 "github.com/gastownhall/gascity/internal/beads/beadstest"
2020 "github.com/gastownhall/gascity/internal/doctor"
21+ "gopkg.in/yaml.v3"
2122)
2223
2324const (
@@ -74,17 +75,7 @@ func TestBdStoreConformance(t *testing.T) {
7475
7576 runBDInit (t , wsDir , prefix , serverPort )
7677
77- // Explicitly set issue_prefix (required for bd create).
78- bdConfig := exec .Command ("bd" , "config" , "set" , "issue_prefix" , prefix )
79- bdConfig .Dir = wsDir
80- if out , err := bdConfig .CombinedOutput (); err != nil {
81- t .Fatalf ("bd config set: %v: %s" , err , out )
82- }
83- customTypes := exec .Command ("bd" , "config" , "set" , "types.custom" , strings .Join (doctor .RequiredCustomTypes , "," ))
84- customTypes .Dir = wsDir
85- if out , err := customTypes .CombinedOutput (); err != nil {
86- t .Fatalf ("bd config set types.custom: %v: %s" , err , out )
87- }
78+ writeCustomTypesConfig (t , wsDir , doctor .RequiredCustomTypes )
8879
8980 return beads .NewBdStore (wsDir , beads .ExecCommandRunner ())
9081 }
@@ -176,6 +167,38 @@ func runBDInit(t *testing.T, dir, prefix, port string) {
176167 }
177168}
178169
170+ func writeCustomTypesConfig (t * testing.T , wsDir string , customTypes []string ) {
171+ t .Helper ()
172+
173+ configPath := filepath .Join (wsDir , ".beads" , "config.yaml" )
174+ data , err := os .ReadFile (configPath )
175+ if err != nil {
176+ t .Fatalf ("reading config.yaml: %v" , err )
177+ }
178+
179+ cfg := map [string ]any {}
180+ if len (data ) > 0 {
181+ if err := yaml .Unmarshal (data , & cfg ); err != nil {
182+ t .Fatalf ("parsing config.yaml: %v" , err )
183+ }
184+ }
185+
186+ typesCfg , ok := cfg ["types" ].(map [string ]any )
187+ if ! ok || typesCfg == nil {
188+ typesCfg = map [string ]any {}
189+ }
190+ typesCfg ["custom" ] = strings .Join (customTypes , "," )
191+ cfg ["types" ] = typesCfg
192+
193+ out , err := yaml .Marshal (cfg )
194+ if err != nil {
195+ t .Fatalf ("marshaling config.yaml: %v" , err )
196+ }
197+ if err := os .WriteFile (configPath , out , 0o644 ); err != nil {
198+ t .Fatalf ("writing config.yaml: %v" , err )
199+ }
200+ }
201+
179202// ensureDoltIdentity ensures dolt has user.name and user.email set.
180203// Copies from git config if available, otherwise sets defaults.
181204func ensureDoltIdentity (t * testing.T ) {
0 commit comments