-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAzureTests.cs
48 lines (39 loc) · 1.49 KB
/
AzureTests.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
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
using IntegrationTests.Helpers;
using Xunit.Abstractions;
namespace IntegrationTests;
[Collection(AzureCollection.Name)]
public class AzureTests : TestHelper
{
private readonly AzureFixture _azure;
public AzureTests(ITestOutputHelper output, AzureFixture azure)
: base("Azure", output)
{
_azure = azure;
}
[Theory]
[Trait("Category", "EndToEnd")]
[Trait("Containers", "Linux")]
[MemberData(nameof(LibraryVersion.Azure), MemberType = typeof(LibraryVersion))]
public void SubmitsTraces(string packageVersion)
{
using var collector = new MockSpansCollector(Output);
SetExporter(collector);
collector.Expect("Azure.Core.Http");
collector.Expect("Azure.Storage.Blobs.BlobContainerClient");
#if NET
collector.Expect("System.Net.Http");
#elif NETFRAMEWORK
// On .NET Framework the "OpenTelemetry.Instrumentation.Http.HttpWebRequest"
// ends up being suppressed by the addition of headers via the Azure instrumentation
// See https://github.com/open-telemetry/opentelemetry-dotnet/blob/f6a1c04e8115a828dd33269f639daf2924796bae/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpWebRequestActivitySource.netfx.cs#L279-L284
#endif
RunTestApplication(new()
{
Arguments = $"{_azure.Port}",
PackageVersion = packageVersion
});
collector.AssertExpectations();
}
}