@@ -160,7 +160,9 @@ func DebugShell() Action {
160
160
func Exec (cmd string , args ... string ) Action {
161
161
return func (t testing.TB , ic TestContext ) {
162
162
Infof ("Executing (in %s): %s %s" , ic .workDir , cmd , shellquote .Join (args ... ))
163
- err := ftlexec .Command (ic , log .Debug , ic .workDir , cmd , args ... ).RunStderrError (ic )
163
+ command := ftlexec .Command (ic , log .Debug , ic .workDir , cmd , args ... )
164
+ command .Env = append (command .Env , "FTL_ENDPOINT=http://127.0.0.1:" + TestPort )
165
+ err := command .RunStderrError (ic )
164
166
assert .NoError (t , err )
165
167
}
166
168
}
@@ -170,7 +172,7 @@ func Exec(cmd string, args ...string) Action {
170
172
func ExecWithExpectedOutput (want string , cmd string , args ... string ) Action {
171
173
return func (t testing.TB , ic TestContext ) {
172
174
Infof ("Executing: %s %s" , cmd , shellquote .Join (args ... ))
173
- output , err := ftlexec .Capture (ic , ic .workDir , cmd , args ... )
175
+ output , err := ftlexec .CaptureWithEnv (ic , ic .workDir , cmd , [] string { "FTL_ENDPOINT=http://127.0.0.1:" + TestPort } , args ... )
174
176
assert .NoError (t , err )
175
177
assert .Equal (t , output , []byte (want ))
176
178
}
@@ -181,7 +183,7 @@ func ExecWithExpectedOutput(want string, cmd string, args ...string) Action {
181
183
func ExecWithExpectedError (want string , cmd string , args ... string ) Action {
182
184
return func (t testing.TB , ic TestContext ) {
183
185
Infof ("Executing: %s %s" , cmd , shellquote .Join (args ... ))
184
- output , err := ftlexec .Capture (ic , ic .workDir , cmd , args ... )
186
+ output , err := ftlexec .CaptureWithEnv (ic , ic .workDir , cmd , [] string { "FTL_ENDPOINT=http://127.0.0.1:" + TestPort } , args ... )
185
187
assert .Error (t , err )
186
188
assert .Contains (t , string (output ), want )
187
189
}
@@ -193,7 +195,7 @@ func ExecWithExpectedError(want string, cmd string, args ...string) Action {
193
195
func ExecWithOutput (cmd string , args []string , capture func (output string )) Action {
194
196
return func (t testing.TB , ic TestContext ) {
195
197
Infof ("Executing: %s %s" , cmd , shellquote .Join (args ... ))
196
- output , err := ftlexec .Capture (ic , ic .workDir , cmd , args ... )
198
+ output , err := ftlexec .CaptureWithEnv (ic , ic .workDir , cmd , [] string { "FTL_ENDPOINT=http://127.0.0.1:" + TestPort } , args ... )
197
199
assert .NoError (t , err , "%s" , string (output ))
198
200
capture (string (output ))
199
201
}
@@ -220,7 +222,7 @@ func ExpectError(action Action, expectedErrorMsg ...string) Action {
220
222
// Deploy a module from the working directory and wait for it to become available.
221
223
func Deploy (module string ) Action {
222
224
return Chain (
223
- Exec ("ftl" , "deploy" , module ),
225
+ Exec ("ftl" , "deploy" , "--endpoint" , "http://127.0.0.1:" + TestPort , module ),
224
226
Wait (module ),
225
227
)
226
228
}
@@ -521,7 +523,7 @@ func JsonData(t testing.TB, body interface{}) []byte {
521
523
func HttpCall (method string , path string , headers map [string ][]string , body []byte , onResponse func (t testing.TB , resp * HTTPResponse )) Action {
522
524
return func (t testing.TB , ic TestContext ) {
523
525
Infof ("HTTP %s %s" , method , path )
524
- baseURL , err := url .Parse (fmt .Sprintf ("http://localhost:8891" ))
526
+ baseURL , err := url .Parse (fmt .Sprintf ("http://localhost:" + TestIngressPort ))
525
527
assert .NoError (t , err )
526
528
527
529
u , err := baseURL .Parse (path )
0 commit comments