4
4
"context"
5
5
"crypto/rand"
6
6
"encoding/hex"
7
+ "os"
7
8
"runtime"
8
9
"testing"
9
10
@@ -50,14 +51,17 @@ func TestRestartingErrorRun(t *testing.T) {
50
51
func TestStackedContexts (t * testing.T ) {
51
52
const name = "testcred"
52
53
54
+ wd , err := os .Getwd ()
55
+ require .NoError (t , err )
56
+
53
57
bytes := make ([]byte , 32 )
54
- _ , err : = rand .Read (bytes )
58
+ _ , err = rand .Read (bytes )
55
59
require .NoError (t , err )
56
60
57
61
context1 := hex .EncodeToString (bytes )[:16 ]
58
62
context2 := hex .EncodeToString (bytes )[16 :]
59
63
60
- run , err := g .Run (context .Background (), " test/credential.gpt" , Options {
64
+ run , err := g .Run (context .Background (), wd + "/ test/credential.gpt" , Options {
61
65
CredentialContexts : []string {context1 , context2 },
62
66
})
63
67
require .NoError (t , err )
@@ -71,7 +75,7 @@ func TestStackedContexts(t *testing.T) {
71
75
require .Equal (t , cred .Context , context1 )
72
76
73
77
// 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 {
75
79
CredentialContexts : []string {context2 , context1 },
76
80
})
77
81
require .NoError (t , err )
0 commit comments