Procházet zdrojové kódy

test: try fix windows tests

Kujtim Hoxha před 3 měsíci
rodič
revize
3cf895f5f0
1 změnil soubory, kde provedl 7 přidání a 1 odebrání
  1. 7 1
      internal/agent/common_test.go

+ 7 - 1
internal/agent/common_test.go

@@ -5,6 +5,7 @@ import (
 	"net/http"
 	"os"
 	"path/filepath"
+	"strings"
 	"testing"
 	"time"
 
@@ -154,10 +155,15 @@ func coderAgent(r *recorder.Recorder, env env, large, small fantasy.LanguageMode
 		t, _ := time.Parse("1/2/2006", "1/1/2025")
 		return t
 	}
+	path := filepath.ToSlash(env.workingDir)
+	// try fixing windows
+	if strings.Contains(path, ":") {
+		path = strings.Split(path, ":")[1]
+	}
 	prompt, err := coderPrompt(
 		prompt.WithTimeFunc(fixedTime),
 		prompt.WithPlatform("linux"),
-		prompt.WithWorkingDir(filepath.ToSlash(env.workingDir)),
+		prompt.WithWorkingDir(path),
 	)
 	if err != nil {
 		return nil, err