-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor
MockTracerAgent
to allow sending custom responses for any …
…endpoint (#4997) * Vendor in PushStreamContent to avoid in-memory buffering Based on (and simplified from) - https://github.com/aspnet/AspNetWebStack/blob/1231b77d79956152831b75ad7f094f844251b97f/src/System.Net.Http.Formatting/Internal/DelegatingStream.cs - https://github.com/aspnet/AspNetWebStack/blob/1231b77d79956152831b75ad7f094f844251b97f/src/System.Net.Http.Formatting/PushStreamContent.cs * Add support for streaming responses * Don't require the caller to call close on the stream (as it seems weird) * Update trimming file * Add a chunked encoding stream writer * Update the built-in HttpClient to use the chunked encoding writer for push stream content * Add support for reading chunked encoded streams to MockHttpParser * Add tests for chunked encoding * Update trimming file * Refactor MockTracerAgent to allow sending custom responses for any endpoint
- Loading branch information
1 parent
6726974
commit 3189baf
Showing
5 changed files
with
102 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
tracer/test/Datadog.Trace.TestHelpers/MockTracerResponseType.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// <copyright file="MockTracerResponseType.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> | ||
|
||
namespace Datadog.Trace.TestHelpers; | ||
|
||
public enum MockTracerResponseType | ||
{ | ||
/// <summary> | ||
/// Any request which doesn't match a known endpoint | ||
/// </summary> | ||
Unknown, | ||
|
||
/// <summary> | ||
/// The trace endpoint | ||
/// </summary> | ||
Traces, | ||
|
||
/// <summary> | ||
/// The Telemetry endpoint | ||
/// </summary> | ||
Telemetry, | ||
|
||
/// <summary> | ||
/// The discovery endpoint | ||
/// </summary> | ||
Info, | ||
|
||
/// <summary> | ||
/// The dynamic configuration endpoint | ||
/// </summary> | ||
Debugger, | ||
|
||
/// <summary> | ||
/// The trace stats endpoint | ||
/// </summary> | ||
Stats, | ||
|
||
/// <summary> | ||
/// The remote configuration endpoint | ||
/// </summary> | ||
RemoteConfig, | ||
|
||
/// <summary> | ||
/// The Data streams endpoint | ||
/// </summary> | ||
DataStreams, | ||
|
||
/// <summary> | ||
/// The CI Visibility EVP proxy endpoint | ||
/// </summary> | ||
EvpProxy, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters