-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStackExchangeRedisTests.cs
45 lines (38 loc) · 1.2 KB
/
StackExchangeRedisTests.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
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
#if NET
using IntegrationTests.Helpers;
using Xunit.Abstractions;
namespace IntegrationTests;
[Collection(RedisCollection.Name)]
public class StackExchangeRedisTests : TestHelper
{
private readonly RedisFixture _redis;
public StackExchangeRedisTests(ITestOutputHelper output, RedisFixture redis)
: base("StackExchangeRedis", output)
{
_redis = redis;
}
[Theory]
[Trait("Category", "EndToEnd")]
[Trait("Containers", "Linux")]
[MemberData(nameof(LibraryVersion.StackExchangeRedis), MemberType = typeof(LibraryVersion))]
public void SubmitsTraces(string packageVersion)
{
using var collector = new MockSpansCollector(Output);
SetExporter(collector);
const int spanCount = 8;
for (var i = 0; i < spanCount; i++)
{
collector.Expect("OpenTelemetry.Instrumentation.StackExchangeRedis");
}
EnableBytecodeInstrumentation();
RunTestApplication(new()
{
Arguments = $"--redis {_redis.Port}",
PackageVersion = packageVersion
});
collector.AssertExpectations();
}
}
#endif