Skip to content

Commit

Permalink
use different hostname for testcontainer
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaid authored and Zaid committed Oct 1, 2024
1 parent 1fd802b commit fc8914e
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions specmatic-order-bff-csharp.test/contract/ContractTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,12 @@ private async Task RunContractTests()
{
var localReportDirectory = Path.Combine(Pwd, "reports");
Directory.CreateDirectory(localReportDirectory);

var hostIp = Environment.GetEnvironmentVariable("HOST_IP") ?? "host-gateway";
Console.WriteLine($"HostIp: {hostIp}");

_testContainer = new ContainerBuilder()
.WithImage("znsio/specmatic").WithCommand("test")
.WithCommand("--port=8080")
.WithCommand("--host=host.docker.internal")
.WithExtraHost("host.docker.internal", hostIp)
.WithCommand("--host=host.testcontainers.internal")
.WithOutputConsumer(Consume.RedirectStdoutAndStderrToConsole())
.WithNetwork(new NetworkBuilder().WithName("test").Build())
.WithWaitStrategy(Wait.ForUnixContainer().UntilMessageIsLogged("Tests run:"))
.WithBindMount(localReportDirectory, $"{TestContainerDirectory}/build/reports")
.WithBindMount(
Expand Down

0 comments on commit fc8914e

Please sign in to comment.