Skip to content

Commit

Permalink
Use Directory mount to save html report
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaid authored and Zaid committed Oct 1, 2024
1 parent 7b23139 commit 6193183
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions specmatic-order-bff-csharp.test/contract/ContractTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ public class ContractTests : IAsyncLifetime
[Fact]
public async Task ContractTestsAsync()
{
var readBytes = await _testContainer
.ReadFileAsync(TestContainerDirectory+ "/build/reports/specmatic/html/index.html");
var file = new FileInfo(Pwd + "/reports/specmaticReport.html");
file.Directory?.Create();
await File.WriteAllBytesAsync(file.FullName, readBytes);
await RunContractTests();
}

public async Task InitializeAsync()
Expand All @@ -31,7 +27,6 @@ await TestcontainersSettings.ExposeHostPortsAsync(8080)

StartOrderBffService();
await StartDomainServiceStub();
await RunContractTests();
}

private async Task RunContractTests()
Expand All @@ -45,6 +40,7 @@ private async Task RunContractTests()
.WithPortBinding(8090)
.WithExposedPort(8090)
.WithWaitStrategy(Wait.ForUnixContainer().UntilMessageIsLogged("Tests run:"))
.WithBindMount($"{Pwd}/reports", $"{TestContainerDirectory}/build/reports")
.WithBindMount(
$"{Pwd}/specmatic.yaml",
$"{TestContainerDirectory}/specmatic.yaml").Build();
Expand Down

0 comments on commit 6193183

Please sign in to comment.