我正在尝试为我的微服务创建类似于Spotify 方法的集成测试。
I am still working on how to spin up and seed the database. Currently I have a .NET Core 2.0 project with FluentDocker v2.2.15 and DbUp 4.1.0.
I use FluentDocker to call DockerCompose and start my services, including the SQL Server container
var hosts = new Hosts().Discover();
var dockerHost = hosts.FirstOrDefault(x => x.IsNative) ?? hosts.FirstOrDefault(x => x.Name == "default");
if (dockerHost == null)
{
return;
}
var composeFile = Args["composeFile"];
var result = dockerHost.Host.ComposeUp(composeFile: composeFile);
Run Code Online (Sandbox Code Playgroud)
and …