Skip to content

Commit

Permalink
fix: use separate gptscript for window cred override test
Browse files Browse the repository at this point in the history
  • Loading branch information
thedadams committed Jul 22, 2024
1 parent d757d09 commit d70493d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 6 additions & 1 deletion gptscript_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,12 @@ func TestCredentialOverride(t *testing.T) {
t.Fatalf("Error getting working directory: %v", err)
}

run, err := g.Run(context.Background(), wd+"/test/credential-override.gpt", Options{
gptscriptFile := "credential-override.gpt"
if runtime.GOOS == "windows" {
gptscriptFile = "credential-override-windows.gpt"
}

run, err := g.Run(context.Background(), filepath.Join(wd, "test", gptscriptFile), Options{
DisableCache: true,
CredentialOverrides: []string{
"test.ts.credential_override:TEST_CRED=foo",
Expand Down
5 changes: 5 additions & 0 deletions test/credential-override-windows.gpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
credentials: github.com/gptscript-ai/credential as test.ts.credential_override with TEST_CRED as env

#!/usr/bin/env powershell.exe

echo "$env:TEST_CRED"

0 comments on commit d70493d

Please sign in to comment.