Skip to content

Commit

Permalink
fix for windows?
Browse files Browse the repository at this point in the history
  • Loading branch information
mstoykov committed Feb 6, 2025
1 parent 0b0881a commit 859bf8f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions internal/js/modules/k6/grpc/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1405,13 +1405,13 @@ func TestClientLoadProtoAbsoluteRootWithFile(t *testing.T) {
t.Parallel()

ts := newTestState(t)
pwd := "file://" + ts.VU.InitEnvField.CWD.JoinPath("..").JoinPath("..").String()
rootPath := ts.VU.InitEnvField.CWD.JoinPath("../..").String()

tt := testcase{
initString: codeBlock{
code: `
var client = new grpc.Client();
client.load(["` + pwd + `"], "../../lib/testutils/httpmultibin/nested_types/nested_types.proto");`,
client.load(["` + rootPath + `"], "../../lib/testutils/httpmultibin/nested_types/nested_types.proto");`,
},
}

Expand Down
3 changes: 2 additions & 1 deletion internal/js/modules/k6/grpc/teststate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"io"
"net/url"
"os"
"path/filepath"
"runtime"
"sync"
"testing"
Expand Down Expand Up @@ -108,7 +109,7 @@ func newTestState(t *testing.T) testState {
if isWindows {
fs = fsext.NewTrimFilePathSeparatorFs(fs)
}
testRuntime.VU.InitEnvField.CWD = &url.URL{Path: cwd}
testRuntime.VU.InitEnvField.CWD = &url.URL{Scheme: "file", Path: filepath.ToSlash(cwd)}
testRuntime.VU.InitEnvField.FileSystems = map[string]fsext.Fs{"file": fs}

logger := logrus.New()
Expand Down

0 comments on commit 859bf8f

Please sign in to comment.