-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
Adds the ability for module tests to use a project file for configs and secrets. This allows them to use the standard project toml file, or a specific toml file on a per test basis ``` ctx := ftltest.Context( ftltest.WithProjectFile("path/to/ftl-project.toml"), ... ) ``` Other changes: - modulecontext has been moved to `/internal` as it is not meant to be part of ftl's public API - modulecontext no longer uses the `configuration` package. The steps to create a modulecontext from a project file are now: - create a manager with the path:`cf.NewDefaultConfigurationManagerFromConfig([]string{ path })` - `ConfigFromEnvironment()` allows the passed in config to be used if that is desired - extract the relevant info and pass it into a module context builder: `modulecontext.NewBuilder(name).AddConfigs(manager.MapForModule(name))` - This means a lot of modules have had their go.mod and go.sum files updated - `UpdateFromEnvironment` has been split into accessing configuration directly (see above) and getting databases from the environment and passing that into a builder like so: ``` databases, err := DatabasesFromEnvironment(ctx, "echo") ... response := NewBuilder("echo").AddDatabases(databases).Build() ``` - Test for reading in project toml into modulecontext has been moved to an integration test with the `wrapped` module, which now a test case for using `ftltest.WithProjectFile(...)`
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.