diff --git a/internal/watch/discover_test.go b/internal/watch/discover_test.go index 69fb1ee9e8..74798acbe2 100644 --- a/internal/watch/discover_test.go +++ b/internal/watch/discover_test.go @@ -14,166 +14,161 @@ func TestDiscoverModules(t *testing.T) { ctx := log.ContextWithNewDefaultLogger(context.Background()) modules, err := DiscoverModules(ctx, []string{"testdata"}) assert.NoError(t, err) - expected := []Module{ + expected := []moduleconfig.ModuleConfig{ { - Config: moduleconfig.ModuleConfig{ - Dir: "testdata/alpha", - Language: "go", - Realm: "home", - Module: "alpha", - Deploy: []string{"main"}, - DeployDir: ".ftl", - Schema: "schema.pb", - Errors: "errors.pb", - Watch: []string{"**/*.go", "go.mod", "go.sum", "../../../../go-runtime/ftl/**/*.go"}, + Dir: "testdata/alpha", + Language: "go", + Realm: "home", + Module: "alpha", + Deploy: []string{"launch", "main"}, + DeployDir: ".ftl", + Errors: "errors.pb", + Watch: []string{ + "**/*.go", + "../../../../go-runtime/ftl/**/*.go", + "go.mod", + "go.sum", }, }, { - Config: moduleconfig.ModuleConfig{ - Dir: "testdata/another", - Language: "go", - Realm: "home", - Module: "another", - Deploy: []string{"main"}, - DeployDir: ".ftl", - Schema: "schema.pb", - Errors: "errors.pb", - Watch: []string{"**/*.go", "go.mod", "go.sum", "../../../../go-runtime/ftl/**/*.go"}, + Dir: "testdata/another", + Language: "go", + Realm: "home", + Module: "another", + Deploy: []string{"launch", "main"}, + DeployDir: ".ftl", + Errors: "errors.pb", + Watch: []string{ + "**/*.go", + "../../../../go-runtime/ftl/**/*.go", + "../../../../go-runtime/schema/testdata/**/*.go", + "go.mod", + "go.sum", }, }, { - Config: moduleconfig.ModuleConfig{ - Dir: "testdata/depcycle1", - Language: "go", - Realm: "home", - Module: "depcycle1", - Deploy: []string{"main"}, - DeployDir: ".ftl", - Schema: "schema.pb", - Errors: "errors.pb", - Watch: []string{"**/*.go", "go.mod", "go.sum"}, + Dir: "testdata/depcycle1", + Language: "go", + Realm: "home", + Module: "depcycle1", + Deploy: []string{"launch", "main"}, + DeployDir: ".ftl", + Errors: "errors.pb", + Watch: []string{ + "**/*.go", + "go.mod", + "go.sum", }, }, { - Config: moduleconfig.ModuleConfig{ - Dir: "testdata/depcycle2", - Language: "go", - Realm: "home", - Module: "depcycle2", - Deploy: []string{"main"}, - DeployDir: ".ftl", - Schema: "schema.pb", - Errors: "errors.pb", - Watch: []string{"**/*.go", "go.mod", "go.sum"}, + Dir: "testdata/depcycle2", + Language: "go", + Realm: "home", + Module: "depcycle2", + Deploy: []string{"launch", "main"}, + DeployDir: ".ftl", + Errors: "errors.pb", + Watch: []string{ + "**/*.go", + "go.mod", + "go.sum", }, }, { - Config: moduleconfig.ModuleConfig{ - Dir: "testdata/echokotlin", - Language: "kotlin", - Realm: "home", - Module: "echo", - Build: "mvn -B package", - Deploy: []string{ - "main", - "quarkus-app", - }, - DeployDir: "target", - GeneratedSchemaDir: "src/main/ftl-module-schema", - Schema: "schema.pb", - Errors: "errors.pb", - Watch: []string{ - "pom.xml", - "src/**", - "target/generated-sources", - }, - Java: moduleconfig.ModuleJavaConfig{ - BuildTool: "maven", - }, + + Dir: "testdata/echokotlin", + Language: "kotlin", + Realm: "home", + Module: "echo", + Build: "mvn -B package", + Deploy: []string{ + "launch", + "quarkus-app", }, - }, - { - Config: moduleconfig.ModuleConfig{ - Dir: "testdata/external", - Language: "go", - Realm: "home", - Module: "external", - Build: "", - Deploy: []string{ - "main", - }, - DeployDir: ".ftl", - Schema: "schema.pb", - Errors: "errors.pb", - Watch: []string{ - "**/*.go", - "go.mod", - "go.sum", - }, + DeployDir: "target", + GeneratedSchemaDir: "src/main/ftl-module-schema", + Errors: "errors.pb", + Watch: []string{ + "pom.xml", + "src/**", + "target/generated-sources", + }, + Java: moduleconfig.ModuleJavaConfig{ + BuildTool: "maven", }, }, { - Config: moduleconfig.ModuleConfig{ - Dir: "testdata/externalkotlin", - Language: "kotlin", - Realm: "home", - Module: "externalkotlin", - Build: "mvn -B package", - Deploy: []string{ - "main", - "quarkus-app", - }, - DeployDir: "target", - GeneratedSchemaDir: "src/main/ftl-module-schema", - Schema: "schema.pb", - Errors: "errors.pb", - Watch: []string{ - "pom.xml", - "src/**", - "target/generated-sources", - }, - Java: moduleconfig.ModuleJavaConfig{ - BuildTool: "maven", - }, + + Dir: "testdata/external", + Language: "go", + Realm: "home", + Module: "external", + Build: "", + Deploy: []string{ + "launch", + "main", + }, + DeployDir: ".ftl", + Errors: "errors.pb", + Watch: []string{ + "**/*.go", + "go.mod", + "go.sum", }, }, { - Config: moduleconfig.ModuleConfig{ - Dir: "testdata/highgoversion", - Language: "go", - Realm: "home", - Module: "highgoversion", - Deploy: []string{"main"}, - DeployDir: ".ftl", - Schema: "schema.pb", - Errors: "errors.pb", - Watch: []string{"**/*.go", "go.mod", "go.sum", "../../../../go-runtime/ftl/**/*.go"}, + + Dir: "testdata/externalkotlin", + Language: "kotlin", + Realm: "home", + Module: "externalkotlin", + Build: "mvn -B package", + Deploy: []string{ + "launch", + "quarkus-app", + }, + DeployDir: "target", + GeneratedSchemaDir: "src/main/ftl-module-schema", + Errors: "errors.pb", + Watch: []string{ + "pom.xml", + "src/**", + "target/generated-sources", + }, + Java: moduleconfig.ModuleJavaConfig{ + BuildTool: "maven", }, }, { - Config: moduleconfig.ModuleConfig{ - Dir: "testdata/integer", - Language: "go", - Realm: "home", - Module: "integer", - Deploy: []string{"main"}, - DeployDir: ".ftl", - Schema: "schema.pb", - Errors: "errors.pb", - Watch: []string{"**/*.go", "go.mod", "go.sum"}, + + Dir: "testdata/integer", + Language: "go", + Realm: "home", + Module: "integer", + Deploy: []string{"launch", "main"}, + DeployDir: ".ftl", + Watch: []string{ + "**/*.go", + "go.mod", + "go.sum", }, + Errors: "errors.pb", }, { - Config: moduleconfig.ModuleConfig{ - Dir: "testdata/other", - Language: "go", - Realm: "home", - Module: "other", - Deploy: []string{"main"}, - DeployDir: ".ftl", - Schema: "schema.pb", - Errors: "errors.pb", - Watch: []string{"**/*.go", "go.mod", "go.sum", "../../../../go-runtime/ftl/**/*.go"}, + + Dir: "testdata/other", + Language: "go", + Realm: "home", + Module: "other", + Deploy: []string{"launch", "main"}, + DeployDir: ".ftl", + Errors: "errors.pb", + Watch: []string{ + "**/*.go", + "../../../../go-runtime/ftl/**/*.go", + "../../../../go-runtime/schema/testdata/**/*.go", + "go.mod", + "go.sum", }, }, }