@@ -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
}
@@ -181,6 +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 ... ))
186
+ t .Setenv ("FTL_ENDPOINT" , "http://127.0.0.1:" + TestPort )
184
187
output , err := ftlexec .Capture (ic , ic .workDir , cmd , args ... )
185
188
assert .Error (t , err )
186
189
assert .Contains (t , string (output ), want )
@@ -220,7 +223,7 @@ func ExpectError(action Action, expectedErrorMsg ...string) Action {
220
223
// Deploy a module from the working directory and wait for it to become available.
221
224
func Deploy (module string ) Action {
222
225
return Chain (
223
- Exec ("ftl" , "deploy" , module ),
226
+ Exec ("ftl" , "deploy" , "--endpoint" , "http://127.0.0.1:" + TestPort , module ),
224
227
Wait (module ),
225
228
)
226
229
}
@@ -521,7 +524,7 @@ func JsonData(t testing.TB, body interface{}) []byte {
521
524
func HttpCall (method string , path string , headers map [string ][]string , body []byte , onResponse func (t testing.TB , resp * HTTPResponse )) Action {
522
525
return func (t testing.TB , ic TestContext ) {
523
526
Infof ("HTTP %s %s" , method , path )
524
- baseURL , err := url .Parse (fmt .Sprintf ("http://localhost:8891" ))
527
+ baseURL , err := url .Parse (fmt .Sprintf ("http://localhost:" + TestIngressPort ))
525
528
assert .NoError (t , err )
526
529
527
530
u , err := baseURL .Parse (path )
0 commit comments