44 "context"
55 "crypto/rand"
66 "encoding/hex"
7+ "os"
78 "runtime"
89 "testing"
910
@@ -50,14 +51,17 @@ func TestRestartingErrorRun(t *testing.T) {
5051func TestStackedContexts (t * testing.T ) {
5152 const name = "testcred"
5253
54+ wd , err := os .Getwd ()
55+ require .NoError (t , err )
56+
5357 bytes := make ([]byte , 32 )
54- _ , err : = rand .Read (bytes )
58+ _ , err = rand .Read (bytes )
5559 require .NoError (t , err )
5660
5761 context1 := hex .EncodeToString (bytes )[:16 ]
5862 context2 := hex .EncodeToString (bytes )[16 :]
5963
60- run , err := g .Run (context .Background (), " test/credential.gpt" , Options {
64+ run , err := g .Run (context .Background (), wd + "/ test/credential.gpt" , Options {
6165 CredentialContexts : []string {context1 , context2 },
6266 })
6367 require .NoError (t , err )
@@ -71,7 +75,7 @@ func TestStackedContexts(t *testing.T) {
7175 require .Equal (t , cred .Context , context1 )
7276
7377 // Now change the context order and run the script again.
74- run , err = g .Run (context .Background (), " test/credential.gpt" , Options {
78+ run , err = g .Run (context .Background (), wd + "/ test/credential.gpt" , Options {
7579 CredentialContexts : []string {context2 , context1 },
7680 })
7781 require .NoError (t , err )
0 commit comments