@@ -70,15 +70,17 @@ type runner struct {
7070 workDir string // Directory for running tests
7171 log log.Logger
7272 runID string
73- timeout time.Duration // Add timeout configuration
73+ timeout time.Duration // Test timeout
74+ goBinary string // Path to the Go binary
7475}
7576
7677type Config struct {
7778 Registry * registry.Registry
7879 TargetGate string
7980 WorkDir string
8081 Log log.Logger
81- Timeout time.Duration // Add timeout configuration
82+ Timeout time.Duration // Test timeout
83+ GoBinary string // path to the Go binary
8284}
8385
8486// NewTestRunner creates a new test runner instance
@@ -109,12 +111,17 @@ func NewTestRunner(cfg Config) (TestRunner, error) {
109111 cfg .Timeout = 5 * time .Minute // Default timeout
110112 }
111113
114+ if cfg .GoBinary == "" {
115+ cfg .GoBinary = "go" // Default to "go" if not specified
116+ }
117+
112118 return & runner {
113119 registry : cfg .Registry ,
114120 validators : validators ,
115121 workDir : cfg .WorkDir ,
116122 log : cfg .Log ,
117123 timeout : cfg .Timeout ,
124+ goBinary : cfg .GoBinary ,
118125 }, nil
119126}
120127
@@ -329,7 +336,7 @@ func (r *runner) listTestsInPackage(pkg string) ([]string, error) {
329336 ctx , cancel := context .WithTimeout (context .Background (), 30 * time .Second ) // Shorter timeout for listing
330337 defer cancel ()
331338
332- listCmd := exec .CommandContext (ctx , "go" , "test" , pkg , "-list" , "^Test" )
339+ listCmd := exec .CommandContext (ctx , r . goBinary , "test" , pkg , "-list" , "^Test" )
333340 listCmd .Dir = r .workDir
334341 var listOut , listOutErr bytes.Buffer
335342 listCmd .Stdout = & listOut
@@ -392,7 +399,7 @@ func (r *runner) runSingleTest(metadata types.ValidatorMetadata) (*types.TestRes
392399 defer cancel ()
393400
394401 args := r .buildTestArgs (metadata )
395- cmd := exec .CommandContext (ctx , "go" , args ... )
402+ cmd := exec .CommandContext (ctx , r . goBinary , args ... )
396403 cmd .Dir = r .workDir
397404
398405 var stdout , stderr bytes.Buffer
@@ -403,7 +410,8 @@ func (r *runner) runSingleTest(metadata types.ValidatorMetadata) (*types.TestRes
403410 "dir" , cmd .Dir ,
404411 "package" , metadata .Package ,
405412 "command" , cmd .String (),
406- "timeout" , r .timeout )
413+ "timeout" , r .timeout ,
414+ "goBinary" , r .goBinary )
407415
408416 result := types.TestResult {
409417 Metadata : metadata ,
0 commit comments