Skip to content

Commit

Permalink
Add tests for changes to Datadog.Trace's Public API (#1681)
Browse files Browse the repository at this point in the history
* Add tests for public API and public browsable (intellisense) API

Note that we can't use Verify in Datadog.Trace.Tests because it uses v5.0.0 of the Logging abstractions library, which is unfortunately incompatible with v2.x of the aspnetcore libraries. Resorted to a poor man's version instead.

* Add public API snapshots based on v1.28.2 (pre assembly merge)

* Update snapshots _after_ assembly merge. This adds a _lot_ of surface area

* Update snapshots for master

* Make Security class internal

* Add [Browsable(false)] and [EditorBrowsable(EditorBrowsableState.Never)] to all public APIs in the ClrProfiler library

* Exclude non-browsable APIs from "public API"

* Try making some things internal

Co-authored-by: Lucas Pimentel-Ordyna <lucas.pimentel@datadoghq.com>

* More updates

* Fix test visibility

Co-authored-by: Lucas Pimentel-Ordyna <lucas.pimentel@datadoghq.com>
  • Loading branch information
andrewlock and lucaspimentel authored Aug 13, 2021
1 parent 6919e06 commit 0e6dadf
Show file tree
Hide file tree
Showing 221 changed files with 1,945 additions and 79 deletions.
4 changes: 2 additions & 2 deletions src/Datadog.Trace/AppSec/Security.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
namespace Datadog.Trace.AppSec
{
/// <summary>
/// The Secure is responsible cooridating app sec
/// The Secure is responsible coordinating app sec
/// </summary>
public class Security : IDatadogSecurity, IDisposable
internal class Security : IDatadogSecurity, IDisposable
{
private static readonly IDatadogLogger Log = DatadogLogging.GetLoggerFor<Security>();

Expand Down
3 changes: 3 additions & 0 deletions src/Datadog.Trace/AspNet/TracingHttpModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Web;
using Datadog.Trace.AppSec;
Expand All @@ -24,6 +25,8 @@ namespace Datadog.Trace.AspNet
/// <summary>
/// IHttpModule used to trace within an ASP.NET HttpApplication request
/// </summary>
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public class TracingHttpModule : IHttpModule
{
internal static readonly IntegrationInfo IntegrationId = IntegrationRegistry.GetIntegrationInfo(nameof(IntegrationIds.AspNet));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc.
// </copyright>

using System.ComponentModel;
using System.Net;

namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.AWS.SDK
{
/// <summary>
/// AmazonWebServiceResponse interface for ducktyping
/// </summary>
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public interface IAmazonWebServiceResponse
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc.
// </copyright>

using System.ComponentModel;

namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.AWS.SDK
{
/// <summary>
/// IClientConfig interface for ducktyping
/// </summary>
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public interface IClientConfig
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc.
// </copyright>

using System.ComponentModel;

namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.AWS.SDK
{
/// <summary>
/// IExecutionContext interface for ducktyping
/// </summary>
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public interface IExecutionContext
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc.
// </copyright>

using System.ComponentModel;

namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.AWS.SDK
{
/// <summary>
/// IRegionEndpoint interface for ducktyping
/// </summary>
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public interface IRegionEndpoint
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc.
// </copyright>

using System.ComponentModel;

namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.AWS.SDK
{
/// <summary>
/// IRequest interface for ducktyping
/// </summary>
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public interface IRequest
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc.
// </copyright>

using System.ComponentModel;

namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.AWS.SDK
{
/// <summary>
/// IRequestContext interface for ducktyping
/// </summary>
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public interface IRequestContext
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc.
// </copyright>

using System.ComponentModel;

namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.AWS.SDK
{
/// <summary>
/// IResponseContext interface for ducktyping
/// </summary>
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public interface IResponseContext
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@
// </copyright>

using System.Collections.Generic;
using System.ComponentModel;

namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.AWS.SDK
{
/// <summary>
/// ResponseMetadata interface for ducktyping
/// </summary>
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public interface IResponseMetadata
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// </copyright>

using System;
using System.ComponentModel;
using Datadog.Trace.ClrProfiler.CallTarget;
using Datadog.Trace.DuckTyping;
using Datadog.Trace.ExtensionMethods;
Expand All @@ -23,6 +24,8 @@ namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.AWS.SDK
MinimumVersion = "3.0.0",
MaximumVersion = "3.*.*",
IntegrationName = AwsConstants.IntegrationName)]
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public class RuntimePipelineInvokeAsyncIntegration
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// </copyright>

using System;
using System.ComponentModel;
using Datadog.Trace.ClrProfiler.CallTarget;
using Datadog.Trace.DuckTyping;
using Datadog.Trace.ExtensionMethods;
Expand All @@ -23,6 +24,8 @@ namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.AWS.SDK
MinimumVersion = "3.0.0",
MaximumVersion = "3.*.*",
IntegrationName = AwsConstants.IntegrationName)]
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public class RuntimePipelineInvokeSyncIntegration
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// </copyright>

using System;
using System.ComponentModel;
using System.Threading;
using Datadog.Trace.ClrProfiler.CallTarget;
using Datadog.Trace.DuckTyping;
Expand All @@ -23,6 +24,8 @@ namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.AWS.SQS
MinimumVersion = "3.0.0",
MaximumVersion = "3.*.*",
IntegrationName = AwsSqsCommon.IntegrationName)]
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public class CreateQueueAsyncIntegration
{
private const string Operation = "CreateQueue";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// </copyright>

using System;
using System.ComponentModel;
using Datadog.Trace.ClrProfiler.CallTarget;
using Datadog.Trace.DuckTyping;
using Datadog.Trace.Tagging;
Expand All @@ -22,6 +23,8 @@ namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.AWS.SQS
MinimumVersion = "3.0.0",
MaximumVersion = "3.*.*",
IntegrationName = AwsSqsCommon.IntegrationName)]
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public class CreateQueueIntegration
{
private const string Operation = "CreateQueue";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// </copyright>

using System;
using System.ComponentModel;
using System.Threading;
using Datadog.Trace.ClrProfiler.CallTarget;
using Datadog.Trace.DuckTyping;
Expand All @@ -23,6 +24,8 @@ namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.AWS.SQS
MinimumVersion = "3.0.0",
MaximumVersion = "3.*.*",
IntegrationName = AwsSqsCommon.IntegrationName)]
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public class DeleteMessageAsyncIntegration
{
private const string Operation = "DeleteMessage";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// </copyright>

using System;
using System.ComponentModel;
using System.Threading;
using Datadog.Trace.ClrProfiler.CallTarget;
using Datadog.Trace.DuckTyping;
Expand All @@ -23,6 +24,8 @@ namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.AWS.SQS
MinimumVersion = "3.0.0",
MaximumVersion = "3.*.*",
IntegrationName = AwsSqsCommon.IntegrationName)]
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public class DeleteMessageBatchAsyncIntegration
{
private const string Operation = "DeleteMessageBatch";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// </copyright>

using System;
using System.ComponentModel;
using Datadog.Trace.ClrProfiler.CallTarget;
using Datadog.Trace.DuckTyping;
using Datadog.Trace.Tagging;
Expand All @@ -22,6 +23,8 @@ namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.AWS.SQS
MinimumVersion = "3.0.0",
MaximumVersion = "3.*.*",
IntegrationName = AwsSqsCommon.IntegrationName)]
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public class DeleteMessageBatchIntegration
{
private const string Operation = "DeleteMessageBatch";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// </copyright>

using System;
using System.ComponentModel;
using Datadog.Trace.ClrProfiler.CallTarget;
using Datadog.Trace.DuckTyping;
using Datadog.Trace.Tagging;
Expand All @@ -22,6 +23,8 @@ namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.AWS.SQS
MinimumVersion = "3.0.0",
MaximumVersion = "3.*.*",
IntegrationName = AwsSqsCommon.IntegrationName)]
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public class DeleteMessageIntegration
{
private const string Operation = "DeleteMessage";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// </copyright>

using System;
using System.ComponentModel;
using System.Threading;
using Datadog.Trace.ClrProfiler.CallTarget;
using Datadog.Trace.DuckTyping;
Expand All @@ -23,6 +24,8 @@ namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.AWS.SQS
MinimumVersion = "3.0.0",
MaximumVersion = "3.*.*",
IntegrationName = AwsSqsCommon.IntegrationName)]
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public class DeleteQueueAsyncIntegration
{
private const string Operation = "DeleteQueue";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// </copyright>

using System;
using System.ComponentModel;
using Datadog.Trace.ClrProfiler.CallTarget;
using Datadog.Trace.DuckTyping;
using Datadog.Trace.Tagging;
Expand All @@ -22,6 +23,8 @@ namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.AWS.SQS
MinimumVersion = "3.0.0",
MaximumVersion = "3.*.*",
IntegrationName = AwsSqsCommon.IntegrationName)]
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public class DeleteQueueIntegration
{
private const string Operation = "DeleteQueue";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
Expand All @@ -14,6 +15,8 @@ namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.AWS.SQS
/// <summary>
/// Interface for ducktyping AmazonSQSRequest implementations with the QueueUrl property
/// </summary>
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public interface IAmazonSQSRequestWithQueueUrl
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@
// </copyright>

using System.Collections;
using System.ComponentModel;

namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.AWS.SQS
{
/// <summary>
/// MessageAttributes interface for ducktyping
/// </summary>
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public interface IContainsMessageAttributes
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@
// </copyright>

using System.Collections.Generic;
using System.ComponentModel;

namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.AWS.SQS
{
/// <summary>
/// CreateQueueRequest interface for ducktyping
/// </summary>
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public interface ICreateQueueRequest
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc.
// </copyright>

using System.ComponentModel;
using Datadog.Trace.ClrProfiler.AutoInstrumentation.AWS.SDK;

namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.AWS.SQS
{
/// <summary>
/// CreateQueueResponse interface for ducktyping
/// </summary>
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public interface ICreateQueueResponse : IAmazonWebServiceResponse
{
/// <summary>
Expand Down
Loading

0 comments on commit 0e6dadf

Please sign in to comment.