-
Notifications
You must be signed in to change notification settings - Fork 147
/
Copy pathExceptionGeneratorTest.cs
51 lines (43 loc) · 1.93 KB
/
ExceptionGeneratorTest.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// <copyright file="ExceptionGeneratorTest.cs" company="Datadog">
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2 License.
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2022 Datadog, Inc.
// </copyright>
using Datadog.Profiler.IntegrationTests.Helpers;
using Xunit;
using Xunit.Abstractions;
namespace Datadog.Profiler.SmokeTests
{
public class ExceptionGeneratorTest
{
private readonly ITestOutputHelper _output;
public ExceptionGeneratorTest(ITestOutputHelper output)
{
_output = output;
}
// NOTE: now that .NET Framework is supported by default, the profiler tries to connect
// to connect to the Agent using namedpipe. Since the Agent does not exist in CI,
// the ETW support is disabled in the tests for .NET Framework.
[TestAppFact("Samples.ExceptionGenerator")]
public void CheckSmoke(string appName, string framework, string appAssembly)
{
var runner = new SmokeTestRunner(appName, framework, appAssembly, _output);
if (framework == "net462")
{
runner.EnvironmentHelper.SetVariable(EnvironmentVariables.EtwEnabled, "0");
}
runner.RunAndCheck();
}
[Trait("Category", "LinuxOnly")]
[TestAppFact("Samples.ExceptionGenerator")]
public void CheckSmokeForOldWayToStackWalk(string appName, string framework, string appAssembly)
{
var runner = new SmokeTestRunner(appName, framework, appAssembly, _output);
if (framework == "net462")
{
runner.EnvironmentHelper.SetVariable(EnvironmentVariables.EtwEnabled, "0");
}
runner.EnvironmentHelper.CustomEnvironmentVariables[EnvironmentVariables.UseBacktrace2] = "0";
runner.RunAndCheck();
}
}
}