Skip to content

Commit 3653c08

Browse files
feat: run tests on different port
This should stop tests from interferring with ftl dev fixes #2577
1 parent 58ce5a0 commit 3653c08

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

internal/integration/actions.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ func ExpectError(action Action, expectedErrorMsg ...string) Action {
220220
// Deploy a module from the working directory and wait for it to become available.
221221
func Deploy(module string) Action {
222222
return Chain(
223-
Exec("ftl", "deploy", module),
223+
Exec("ftl", "deploy", "--endpoint", "http://127.0.0.1:"+TestPort, module),
224224
Wait(module),
225225
)
226226
}

internal/integration/harness.go

+7-4
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ import (
2929
"github.com/TBD54566975/ftl/internal/rpc"
3030
)
3131

32+
const TestPort = "9892"
33+
const TestIngressPort = "9891"
34+
3235
func integrationTestTimeout() time.Duration {
3336
timeout := optional.Zero(os.Getenv("FTL_INTEGRATION_TEST_TIMEOUT")).Default("5s")
3437
d, err := time.ParseDuration(timeout)
@@ -174,16 +177,16 @@ func run(t *testing.T, actionsOrOptions ...ActionOrOption) {
174177
t.Run(language, func(t *testing.T) {
175178
tmpDir := initWorkDir(t, cwd, opts)
176179

177-
verbs := rpc.Dial(ftlv1connect.NewVerbServiceClient, "http://localhost:8892", log.Debug)
180+
verbs := rpc.Dial(ftlv1connect.NewVerbServiceClient, "http://localhost:"+TestPort, log.Debug)
178181

179182
var controller ftlv1connect.ControllerServiceClient
180183
var console pbconsoleconnect.ConsoleServiceClient
181184
if opts.startController {
182-
controller = rpc.Dial(ftlv1connect.NewControllerServiceClient, "http://localhost:8892", log.Debug)
183-
console = rpc.Dial(pbconsoleconnect.NewConsoleServiceClient, "http://localhost:8892", log.Debug)
185+
controller = rpc.Dial(ftlv1connect.NewControllerServiceClient, "http://localhost:"+TestPort, log.Debug)
186+
console = rpc.Dial(pbconsoleconnect.NewConsoleServiceClient, "http://localhost:"+TestPort, log.Debug)
184187

185188
Infof("Starting ftl cluster")
186-
ctx = startProcess(ctx, t, filepath.Join(binDir, "ftl"), "serve", "--recreate")
189+
ctx = startProcess(ctx, t, filepath.Join(binDir, "ftl"), "serve", "--recreate", "--bind", "http://127.0.0.1:"+TestIngressPort)
187190
}
188191

189192
testData := filepath.Join(cwd, "testdata", language)

0 commit comments

Comments
 (0)