Skip to content

Commit

Permalink
Removed dependency from ConsoleExporter (#1760)
Browse files Browse the repository at this point in the history
* Removed dependency from ConsoleExporter

* Correcting the namespace

* Use TestExporter instead of InMemory Exporter

* Removed unnecessary using statements

Co-authored-by: Cijo Thomas <cithomas@microsoft.com>
  • Loading branch information
utpilla and cijothomas authored Jan 30, 2021
1 parent 959f443 commit b843e8d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
1 change: 0 additions & 1 deletion test/OpenTelemetry.Tests/OpenTelemetry.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<ItemGroup>
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry\OpenTelemetry.csproj" />
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Exporter.InMemory\OpenTelemetry.Exporter.InMemory.csproj" />
<ProjectReference Include="..\..\src\OpenTelemetry.Exporter.Console\OpenTelemetry.Exporter.Console.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.1'">
Expand Down
13 changes: 5 additions & 8 deletions test/OpenTelemetry.Tests/Trace/ExportProcessorTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,11 @@
// limitations under the License.
// </copyright>

using System.Collections.Generic;
using System.Diagnostics;
using OpenTelemetry.Exporter;
using OpenTelemetry.Exporter.Console;
using OpenTelemetry.Trace;
using OpenTelemetry.Tests;
using Xunit;

namespace OpenTelemetry.Tests.Trace
namespace OpenTelemetry.Trace.Tests
{
public class ExportProcessorTest
{
Expand All @@ -31,7 +28,7 @@ public class ExportProcessorTest
public void ExportProcessorIgnoresActivityWhenDropped()
{
var sampler = new AlwaysOffSampler();
var processor = new TestActivityExportProcessor(new ConsoleActivityExporter(null));
var processor = new TestActivityExportProcessor(new TestExporter<Activity>(_ => { }));
using var activitySource = new ActivitySource(ActivitySourceName);
using var sdk = Sdk.CreateTracerProviderBuilder()
.AddSource(ActivitySourceName)
Expand All @@ -52,7 +49,7 @@ public void ExportProcessorIgnoresActivityWhenDropped()
public void ExportProcessorIgnoresActivityMarkedAsRecordOnly()
{
var sampler = new RecordOnlySampler();
var processor = new TestActivityExportProcessor(new ConsoleActivityExporter(null));
var processor = new TestActivityExportProcessor(new TestExporter<Activity>(_ => { }));
using var activitySource = new ActivitySource(ActivitySourceName);
using var sdk = Sdk.CreateTracerProviderBuilder()
.AddSource(ActivitySourceName)
Expand All @@ -73,7 +70,7 @@ public void ExportProcessorIgnoresActivityMarkedAsRecordOnly()
public void ExportProcessorExportsActivityMarkedAsRecordAndSample()
{
var sampler = new AlwaysOnSampler();
var processor = new TestActivityExportProcessor(new ConsoleActivityExporter(null));
var processor = new TestActivityExportProcessor(new TestExporter<Activity>(_ => { }));
using var activitySource = new ActivitySource(ActivitySourceName);
using var sdk = Sdk.CreateTracerProviderBuilder()
.AddSource(ActivitySourceName)
Expand Down

0 comments on commit b843e8d

Please sign in to comment.