-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWcfServerTestHelper.cs
34 lines (27 loc) · 1.21 KB
/
WcfServerTestHelper.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
using IntegrationTests.Helpers;
using Xunit.Abstractions;
namespace IntegrationTests;
internal class WcfServerTestHelper : TestHelper
{
private const string ServiceName = "TestApplication.Wcf.Server.NetFramework";
public WcfServerTestHelper(ITestOutputHelper output)
: base("Wcf.Server.NetFramework", output)
{
SetEnvironmentVariable("OTEL_SERVICE_NAME", ServiceName);
}
public ProcessHelper RunWcfServer(MockSpansCollector collector)
{
var baseBinDirectory = EnvironmentHelper.GetTestApplicationBaseBinDirectory();
var exeFileName = $"{EnvironmentHelper.FullTestApplicationName}.exe";
var testApplicationPath = Path.Combine(baseBinDirectory, EnvironmentTools.GetPlatformDir(), EnvironmentTools.GetBuildConfiguration(), "net462", exeFileName);
if (!File.Exists(testApplicationPath))
{
throw new Exception($"Unable to find executing assembly at {testApplicationPath}");
}
SetExporter(collector);
var process = InstrumentedProcessHelper.Start(testApplicationPath, null, EnvironmentHelper);
return new ProcessHelper(process);
}
}