-
Notifications
You must be signed in to change notification settings - Fork 147
/
Copy pathEtwEventsTests.cs
43 lines (33 loc) · 1.46 KB
/
EtwEventsTests.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
// <copyright file="EtwEventsTests.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 System.IO;
using System.Linq;
using Datadog.Profiler.IntegrationTests.Helpers;
using FluentAssertions;
using Xunit;
using Xunit.Abstractions;
namespace Datadog.Profiler.IntegrationTests.WindowsOnly
{
[Trait("Category", "WindowsOnly")]
public class EtwEventsTests
{
private readonly ITestOutputHelper _output;
public EtwEventsTests(ITestOutputHelper output)
{
_output = output;
}
[TestAppFact("Samples.Computer01", new[] { "net462" })]
public void CheckErrorWhenNoAgentIsAvailable(string appName, string framework, string appAssembly)
{
var runner = new TestApplicationRunner(appName, framework, appAssembly, _output, commandLine: "--scenario 1");
using var agent = MockDatadogAgent.CreateHttpAgent(runner.XUnitLogger);
runner.Run(agent);
var logFile = Directory.GetFiles(runner.Environment.LogDir)
.Single(f => Path.GetFileName(f).StartsWith("DD-DotNet-Profiler-Native-"));
var lines = File.ReadAllLines(logFile);
lines.Should().ContainMatch("*Impossible to connect to the Datadog Agent named pipe*");
}
}
}