Skip to content

Commit

Permalink
reuse code and snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyredondo committed May 31, 2024
1 parent 8a129d8 commit 5f70ddf
Show file tree
Hide file tree
Showing 14 changed files with 162 additions and 19,957 deletions.
2 changes: 1 addition & 1 deletion tracer/src/Datadog.Trace/Ci/CIVisibility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ internal static IApiRequestFactory GetRequestFactory(ImmutableTracerSettings tra
factory.SetProxy(new WebProxy(proxyHttpsUriBuilder.Uri, true, settings.ProxyNoProxy, credential), credential);
}
}

return factory;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// <copyright file="PipesXUnitEvpTests.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 2017 Datadog, Inc.
// </copyright>
#if NETCOREAPP3_1_OR_GREATER
using System;
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;

namespace Datadog.Trace.ClrProfiler.IntegrationTests.CI;

public class PipesXUnitEvpTests(ITestOutputHelper output) : XUnitEvpTests(output)
{
[SkippableTheory]
[MemberData(nameof(GetData))]
[Trait("Category", "EndToEnd")]
[Trait("Category", "TestIntegrations")]
public override async Task SubmitTraces(string packageVersion, string evpVersionToRemove, bool expectedGzip)
{
EnvironmentHelper.EnableWindowsNamedPipes();

// The server implementation of named pipes is flaky so have 3 attempts
var attemptsRemaining = 3;
while (true)
{
try
{
attemptsRemaining--;
await base.SubmitTraces(packageVersion, evpVersionToRemove, expectedGzip);
return;
}
catch (Exception ex) when (attemptsRemaining > 0 && ex is not SkipException)
{
await ReportRetry(Output, attemptsRemaining, ex);
}
}
}

[SkippableTheory]
[MemberData(nameof(GetDataForEarlyFlakeDetection))]
[Trait("Category", "EndToEnd")]
[Trait("Category", "TestIntegrations")]
[Trait("Category", "EarlyFlakeDetection")]
public override async Task EarlyFlakeDetection(string packageVersion, string evpVersionToRemove, bool expectedGzip, string settingsJson, string testsJson, int expectedSpans, string friendlyName)
{
EnvironmentHelper.EnableWindowsNamedPipes();

// The server implementation of named pipes is flaky so have 3 attempts
var attemptsRemaining = 3;
while (true)
{
try
{
attemptsRemaining--;
await base.EarlyFlakeDetection(packageVersion, evpVersionToRemove, expectedGzip, settingsJson, testsJson, expectedSpans, friendlyName);
return;
}
catch (Exception ex) when (attemptsRemaining > 0 && ex is not SkipException)
{
await ReportRetry(Output, attemptsRemaining, ex);
}
}
}
}
#endif

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// <copyright file="TcpXUnitEvpTests.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 2017 Datadog, Inc.
// </copyright>
#if NETCOREAPP3_1_OR_GREATER
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;

namespace Datadog.Trace.ClrProfiler.IntegrationTests.CI;

public class TcpXUnitEvpTests(ITestOutputHelper output) : XUnitEvpTests(output)
{
[SkippableTheory]
[MemberData(nameof(GetData))]
[Trait("Category", "EndToEnd")]
[Trait("Category", "TestIntegrations")]
public override Task SubmitTraces(string packageVersion, string evpVersionToRemove, bool expectedGzip)
{
EnvironmentHelper.EnableDefaultTransport();
return base.SubmitTraces(packageVersion, evpVersionToRemove, expectedGzip);
}

[SkippableTheory]
[MemberData(nameof(GetDataForEarlyFlakeDetection))]
[Trait("Category", "EndToEnd")]
[Trait("Category", "TestIntegrations")]
[Trait("Category", "EarlyFlakeDetection")]
public override Task EarlyFlakeDetection(string packageVersion, string evpVersionToRemove, bool expectedGzip, string settingsJson, string testsJson, int expectedSpans, string friendlyName)
{
EnvironmentHelper.EnableDefaultTransport();
return base.EarlyFlakeDetection(packageVersion, evpVersionToRemove, expectedGzip, settingsJson, testsJson, expectedSpans, friendlyName);
}
}
#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// <copyright file="TcpXUnitTests.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 2017 Datadog, Inc.
// </copyright>
#if NETCOREAPP3_1_OR_GREATER
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;

namespace Datadog.Trace.ClrProfiler.IntegrationTests.CI
{
public class TcpXUnitTests(ITestOutputHelper output) : XUnitTests(output)
{
[SkippableTheory]
[MemberData(nameof(PackageVersions.XUnit), MemberType = typeof(PackageVersions))]
[Trait("Category", "EndToEnd")]
[Trait("Category", "TestIntegrations")]
public override Task SubmitTraces(string packageVersion)
{
EnvironmentHelper.EnableDefaultTransport();
return base.SubmitTraces(packageVersion);
}
}
}
#endif
Loading

0 comments on commit 5f70ddf

Please sign in to comment.