@@ -37,8 +37,8 @@ public void W3CTraceContextTestSuiteAsync(string value)
37
37
{
38
38
// configure SDK
39
39
using var tracerProvider = Sdk . CreateTracerProviderBuilder ( )
40
- . AddAspNetCoreInstrumentation ( )
41
- . Build ( ) ;
40
+ . AddAspNetCoreInstrumentation ( )
41
+ . Build ( ) ;
42
42
43
43
var builder = WebApplication . CreateBuilder ( ) ;
44
44
using var app = builder . Build ( ) ;
@@ -68,12 +68,14 @@ public void W3CTraceContextTestSuiteAsync(string value)
68
68
69
69
app . RunAsync ( "http://localhost:5000/" ) ;
70
70
71
- string result = RunCommand ( "python" , "trace-context/test/test.py http://localhost:5000/" ) ;
71
+ ( var stdout , var stderr ) = RunCommand ( "python" , "-W ignore trace-context/test/test.py http://localhost:5000/" ) ;
72
72
73
73
// Assert
74
- string lastLine = ParseLastLine ( result ) ;
74
+ // TODO: after W3C Trace Context test suite passes, it might go in standard output
75
+ string lastLine = ParseLastLine ( stderr ) ;
75
76
76
- this . output . WriteLine ( "result:" + result ) ;
77
+ this . output . WriteLine ( "[stderr]" + stderr ) ;
78
+ this . output . WriteLine ( "[stdout]" + stdout ) ;
77
79
78
80
// Assert on the last line
79
81
Assert . StartsWith ( "OK" , lastLine , StringComparison . Ordinal ) ;
@@ -84,7 +86,7 @@ public void Dispose()
84
86
this . httpClient . Dispose ( ) ;
85
87
}
86
88
87
- private static string RunCommand ( string command , string args )
89
+ private static ( string StdOut , string StdErr ) RunCommand ( string command , string args )
88
90
{
89
91
using var proc = new Process
90
92
{
@@ -101,10 +103,12 @@ private static string RunCommand(string command, string args)
101
103
} ;
102
104
proc . Start ( ) ;
103
105
104
- // TODO: after W3C Trace Context test suite passes, it might go in standard output
105
- var results = proc . StandardError . ReadToEnd ( ) ;
106
+ var stdout = proc . StandardOutput . ReadToEnd ( ) ;
107
+ var stderr = proc . StandardError . ReadToEnd ( ) ;
108
+
106
109
proc . WaitForExit ( ) ;
107
- return results ;
110
+
111
+ return ( stdout , stderr ) ;
108
112
}
109
113
110
114
private static string ParseLastLine ( string output )
0 commit comments