@@ -3,7 +3,9 @@ package harness
33import (
44 "fmt"
55 "os"
6+ "path/filepath"
67 "strconv"
8+ "strings"
79 "time"
810)
911
@@ -54,14 +56,18 @@ func NewSharedFixture(cfg *Config) (*SharedFixture, error) {
5456// Teardown removes all fixture resources. Deleting the board cascades to all
5557// child resources (cards, columns, comments, steps, reactions).
5658func (f * SharedFixture ) Teardown () error {
59+ var errs []string
5760 if f .BoardID != "" {
5861 r := f .run ("board" , "delete" , f .BoardID )
5962 if r .ExitCode != ExitSuccess && r .ExitCode != ExitNotFound {
60- return fmt .Errorf ("delete fixture board %s: exit %d\n stderr: %s" , f .BoardID , r .ExitCode , r .Stderr )
63+ errs = append ( errs , fmt .Sprintf ("delete fixture board %s: exit %d\n stderr: %s" , f .BoardID , r .ExitCode , r .Stderr ) )
6164 }
6265 }
6366 if err := os .RemoveAll (f .configHome ); err != nil {
64- return fmt .Errorf ("remove fixture config home %s: %w" , f .configHome , err )
67+ errs = append (errs , fmt .Sprintf ("remove fixture config home %s: %v" , f .configHome , err ))
68+ }
69+ if len (errs ) > 0 {
70+ return fmt .Errorf (strings .Join (errs , "\n " ))
6571 }
6672 return nil
6773}
@@ -143,6 +149,9 @@ func (f *SharedFixture) run(args ...string) *Result {
143149 "FIZZY_PROFILE" : f .cfg .Account ,
144150 "FIZZY_NO_KEYRING" : "1" ,
145151 "HOME" : f .configHome ,
152+ "XDG_CONFIG_HOME" : filepath .Join (f .configHome , "config" ),
153+ "XDG_DATA_HOME" : filepath .Join (f .configHome , "data" ),
154+ "XDG_STATE_HOME" : filepath .Join (f .configHome , "state" ),
146155 }
147156 return Execute (f .cfg .BinaryPath , fullArgs , env )
148157}
0 commit comments