File tree Expand file tree Collapse file tree 4 files changed +16
-2
lines changed
tests/IntegrationTests/Setup Expand file tree Collapse file tree 4 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -6,4 +6,5 @@ KEY_VAULT_NAME=key-vault-name
66USE_JSON_FORMATTING = false
77USE_OUTPUT_CACHE = true
88USE_MOCKING = true
9+ SHOW_MOCKING_LOGS = false
910MARKET_CLIENT_URL = http://localhost:9091
Original file line number Diff line number Diff line change 3939 --coverage --coverage-output-format xml --coverage-output ${{ github.workspace }}/coverage.xml
4040 env :
4141 USE_MOCKING : ${{ vars.USE_MOCKING }}
42+ SHOW_MOCKING_LOGS : ${{ vars.SHOW_MOCKING_LOGS }}
4243 - name : Find coverage files and generate report
4344 run : |
4445 dotnet tool run reportgenerator -reports:"${{ github.workspace }}/**/coverage.xml" \
Original file line number Diff line number Diff line change @@ -7,13 +7,17 @@ public static class EnvVarKeys
77 public const string UseOutputCache = "USE_OUTPUT_CACHE" ;
88 public const string MarketClientUrl = "MARKET_CLIENT_URL" ;
99 public const string UseMocking = "USE_MOCKING" ;
10+ public const string ShowMockingLogs = "SHOW_MOCKING_LOGS" ;
1011}
1112
1213public static class EnvVarAccessors
1314{
1415 public static bool UseMocking =>
1516 bool . TryParse ( Environment . GetEnvironmentVariable ( EnvVarKeys . UseMocking ) , out var value ) && value ;
1617
18+ public static bool ShowMockingLogs =>
19+ bool . TryParse ( Environment . GetEnvironmentVariable ( EnvVarKeys . ShowMockingLogs ) , out var value ) && value ;
20+
1721 public static bool UseJsonFormatting =>
1822 bool . TryParse ( Environment . GetEnvironmentVariable ( EnvVarKeys . UseJsonFormatting ) , out var value ) && value ;
1923}
Original file line number Diff line number Diff line change @@ -46,17 +46,25 @@ public async ValueTask InitializeAsync()
4646 {
4747 if ( _wireMockContainer is not null )
4848 {
49+ var ct = TestContext . Current . CancellationToken ;
4950 TestContext . Current . SendDiagnosticMessage ( "Starting Wiremock container" ) ;
50- await _wireMockContainer . StartAsync ( TestContext . Current . CancellationToken ) . ConfigureAwait ( false ) ;
51+ await _wireMockContainer . StartAsync ( ct ) . ConfigureAwait ( false ) ;
52+
53+ if ( EnvVarAccessors . ShowMockingLogs )
54+ {
55+ var ( Stdout , _) = await _wireMockContainer . GetLogsAsync ( ct : ct ) . ConfigureAwait ( false ) ;
56+ TestContext . Current . SendDiagnosticMessage ( $ "[WireMock] { Stdout } ") ;
57+ }
5158 }
5259 }
5360
5461 public async ValueTask DisposeAsync ( )
5562 {
5663 if ( _wireMockContainer is not null )
5764 {
65+ var ct = TestContext . Current . CancellationToken ;
5866 TestContext . Current . SendDiagnosticMessage ( "Stopping Wiremock container" ) ;
59- await _wireMockContainer . StopAsync ( TestContext . Current . CancellationToken ) . ConfigureAwait ( false ) ;
67+ await _wireMockContainer . StopAsync ( ct ) . ConfigureAwait ( false ) ;
6068 await _wireMockContainer . DisposeAsync ( ) . ConfigureAwait ( false ) ;
6169 }
6270 GC . SuppressFinalize ( this ) ;
You can’t perform that action at this time.
0 commit comments