Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
utpilla committed Nov 15, 2023
1 parent cf924c5 commit a92d783
Show file tree
Hide file tree
Showing 13 changed files with 92 additions and 62 deletions.
5 changes: 4 additions & 1 deletion OpenTelemetry.sln
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{7CB2F02E
build\debug.snk = build\debug.snk
Directory.Packages.props = Directory.Packages.props
build\docfx.cmd = build\docfx.cmd
build\docker-compose.net6.0.yml = build\docker-compose.net6.0.yml
build\docker-compose.net7.0.yml = build\docker-compose.net7.0.yml
build\docker-compose.net8.0.yml = build\docker-compose.net8.0.yml
build\finalize-publicapi.ps1 = build\finalize-publicapi.ps1
build\GlobalAttrExclusions.txt = build\GlobalAttrExclusions.txt
build\opentelemetry-icon-color.png = build\opentelemetry-icon-color.png
Expand Down Expand Up @@ -266,8 +269,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{A49299
src\Shared\PeerServiceResolver.cs = src\Shared\PeerServiceResolver.cs
src\Shared\PeriodicExportingMetricReaderHelper.cs = src\Shared\PeriodicExportingMetricReaderHelper.cs
src\Shared\PooledList.cs = src\Shared\PooledList.cs
src\Shared\ResourceSemanticConventions.cs = src\Shared\ResourceSemanticConventions.cs
src\Shared\RequestMethodHelper.cs = src\Shared\RequestMethodHelper.cs
src\Shared\ResourceSemanticConventions.cs = src\Shared\ResourceSemanticConventions.cs
src\Shared\SemanticConventions.cs = src\Shared\SemanticConventions.cs
src\Shared\SpanAttributeConstants.cs = src\Shared\SpanAttributeConstants.cs
src\Shared\SpanHelper.cs = src\Shared\SpanHelper.cs
Expand Down
9 changes: 9 additions & 0 deletions build/docker-compose.net6.0.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: '3.7'

services:
tests:
build:
args:
PUBLISH_FRAMEWORK: net6.0
TEST_SDK_VERSION: "6.0"
BUILD_SDK_VERSION: "8.0"
9 changes: 9 additions & 0 deletions build/docker-compose.net7.0.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: '3.7'

services:
tests:
build:
args:
PUBLISH_FRAMEWORK: net7.0
TEST_SDK_VERSION: "7.0"
BUILD_SDK_VERSION: "8.0"
9 changes: 9 additions & 0 deletions build/docker-compose.net8.0.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: '3.7'

services:
tests:
build:
args:
PUBLISH_FRAMEWORK: net8.0
TEST_SDK_VERSION: "8.0"
BUILD_SDK_VERSION: "8.0"
2 changes: 1 addition & 1 deletion test/OpenTelemetry.Api.Tests/BaggageTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ public async Task AsyncLocalTests()
{
Baggage.SetBaggage("key1", "value1");

await InnerTask().ConfigureAwait(false);
await InnerTask();

Baggage.SetBaggage("key4", "value4");

Expand Down
6 changes: 3 additions & 3 deletions test/OpenTelemetry.Api.Tests/Trace/TracerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,16 @@ public async Task Tracer_StartRootSpan_StartsNewTrace()

async Task DoSomeAsyncWork()
{
await Task.Delay(10).ConfigureAwait(false);
await Task.Delay(10);
using (tracer.GetTracer("tracername").StartRootSpan("RootSpan2"))
{
await Task.Delay(10).ConfigureAwait(false);
await Task.Delay(10);
}
}

using (tracer.GetTracer("tracername").StartActiveSpan("RootSpan1"))
{
await DoSomeAsyncWork().ConfigureAwait(false);
await DoSomeAsyncWork();
}

Assert.Equal(2, exportedItems.Count);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public async Task InjectsHeadersAsync(bool shouldEnrich)
.Build())
{
using var c = new HttpClient();
await c.SendAsync(request).ConfigureAwait(false);
await c.SendAsync(request);
}

Assert.Equal(5, processor.Invocations.Count); // SetParentProvider/OnStart/OnEnd/OnShutdown/Dispose called.
Expand Down Expand Up @@ -248,7 +248,7 @@ public async Task InjectsHeadersAsync_CustomFormat()
.Build())
{
using var c = new HttpClient();
await c.SendAsync(request).ConfigureAwait(false);
await c.SendAsync(request);
}

Assert.Equal(5, processor.Invocations.Count); // SetParentProvider/OnStart/OnEnd/OnShutdown/Dispose called.
Expand Down Expand Up @@ -318,7 +318,7 @@ public async Task RespectsSuppress()
using var c = new HttpClient();
using (SuppressInstrumentationScope.Begin())
{
await c.SendAsync(request).ConfigureAwait(false);
await c.SendAsync(request);
}
}

Expand Down Expand Up @@ -357,7 +357,7 @@ public async Task ExportsSpansCreatedForRetries()
using var clientHandler = new HttpClientHandler();
using var retryHandler = new RetryHandler(clientHandler, maxRetries);
using var httpClient = new HttpClient(retryHandler);
await httpClient.SendAsync(request).ConfigureAwait(false);
await httpClient.SendAsync(request);

// number of exported spans should be 3(maxRetries)
Assert.Equal(maxRetries, exportedItems.Count());
Expand Down Expand Up @@ -407,7 +407,7 @@ public async Task HttpRequestMethodIsSetOnActivityAsPerSpec(string originalMetho

try
{
await httpClient.SendAsync(request).ConfigureAwait(false);
await httpClient.SendAsync(request);
}
catch
{
Expand Down Expand Up @@ -467,7 +467,7 @@ public async Task HttpRequestMethodIsSetonRequestDurationMetricAsPerSpec(string

try
{
await httpClient.SendAsync(request).ConfigureAwait(false);
await httpClient.SendAsync(request);
}
catch
{
Expand Down Expand Up @@ -511,7 +511,7 @@ public async Task RedirectTest()
.Build())
{
using var c = new HttpClient();
await c.GetAsync($"{this.url}redirect").ConfigureAwait(false);
await c.GetAsync($"{this.url}redirect");
}

#if NETFRAMEWORK
Expand Down Expand Up @@ -562,7 +562,7 @@ public async void RequestNotCollectedWhenInstrumentationFilterApplied()
.Build())
{
using var c = new HttpClient();
await c.GetAsync(this.url).ConfigureAwait(false);
await c.GetAsync(this.url);
}

#if NETFRAMEWORK
Expand Down Expand Up @@ -593,7 +593,7 @@ public async void RequestNotCollectedWhenInstrumentationFilterThrowsException()
{
using var c = new HttpClient();
using var inMemoryEventListener = new InMemoryEventListener(HttpInstrumentationEventSource.Log);
await c.GetAsync(this.url).ConfigureAwait(false);
await c.GetAsync(this.url);
Assert.Single(inMemoryEventListener.Events.Where((e) => e.EventId == 4));
}

Expand All @@ -614,7 +614,7 @@ public async Task ReportsExceptionEventForNetworkFailuresWithGetAsync()
using var c = new HttpClient();
try
{
await c.GetAsync("https://sdlfaldfjalkdfjlkajdflkajlsdjf.sdlkjafsdjfalfadslkf.com/").ConfigureAwait(false);
await c.GetAsync("https://sdlfaldfjalkdfjlkajdflkajlsdjf.sdlkjafsdjfalfadslkf.com/");
}
catch
{
Expand All @@ -640,7 +640,7 @@ public async Task DoesNotReportExceptionEventOnErrorResponseWithGetAsync()
using var c = new HttpClient();
try
{
await c.GetAsync($"{this.url}500").ConfigureAwait(false);
await c.GetAsync($"{this.url}500");
}
catch
{
Expand Down Expand Up @@ -671,7 +671,7 @@ public async Task DoesNotReportExceptionEventOnErrorResponseWithGetStringAsync()
using var c = new HttpClient();
try
{
await c.GetStringAsync($"{this.url}500").ConfigureAwait(false);
await c.GetStringAsync($"{this.url}500");
}
catch
{
Expand Down Expand Up @@ -746,7 +746,7 @@ public async Task CustomPropagatorCalled(bool sample, bool createParentActivity)
};

using var c = new HttpClient();
await c.SendAsync(request).ConfigureAwait(false);
await c.SendAsync(request);

parent?.Stop();

Expand Down
22 changes: 11 additions & 11 deletions test/OpenTelemetry.Instrumentation.Http.Tests/HttpClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ await HttpOutCallsAreCollectedSuccessfullyBodyAsync(
tc,
enableTracing: true,
enableMetrics: true,
semanticConvention: HttpSemanticConvention.Old).ConfigureAwait(false);
semanticConvention: HttpSemanticConvention.Old);
}

[Theory]
Expand All @@ -59,7 +59,7 @@ await HttpOutCallsAreCollectedSuccessfullyBodyAsync(
tc,
enableTracing: true,
enableMetrics: true,
semanticConvention: HttpSemanticConvention.Dupe).ConfigureAwait(false);
semanticConvention: HttpSemanticConvention.Dupe);
}
#endif

Expand All @@ -73,7 +73,7 @@ await HttpOutCallsAreCollectedSuccessfullyBodyAsync(
tc,
enableTracing: true,
enableMetrics: true,
semanticConvention: HttpSemanticConvention.New).ConfigureAwait(false);
semanticConvention: HttpSemanticConvention.New);
}

[Theory]
Expand All @@ -85,7 +85,7 @@ await HttpOutCallsAreCollectedSuccessfullyBodyAsync(
this.port,
tc,
enableTracing: false,
enableMetrics: true).ConfigureAwait(false);
enableMetrics: true);
}

[Theory]
Expand All @@ -97,7 +97,7 @@ await HttpOutCallsAreCollectedSuccessfullyBodyAsync(
this.port,
tc,
enableTracing: true,
enableMetrics: false).ConfigureAwait(false);
enableMetrics: false);
}

[Theory]
Expand All @@ -109,7 +109,7 @@ await HttpOutCallsAreCollectedSuccessfullyBodyAsync(
this.port,
tc,
enableTracing: false,
enableMetrics: false).ConfigureAwait(false);
enableMetrics: false);
}

#if !NET8_0_OR_GREATER
Expand Down Expand Up @@ -150,8 +150,8 @@ public async Task DebugIndividualTestAsync()
[Fact]
public async Task CheckEnrichmentWhenSampling()
{
await CheckEnrichment(new AlwaysOffSampler(), false, this.url).ConfigureAwait(false);
await CheckEnrichment(new AlwaysOnSampler(), true, this.url).ConfigureAwait(false);
await CheckEnrichment(new AlwaysOffSampler(), false, this.url);
await CheckEnrichment(new AlwaysOnSampler(), true, this.url);
}

#if NET8_0_OR_GREATER
Expand All @@ -178,7 +178,7 @@ public async Task ValidateNet8MetricsAsync(HttpTestData.HttpOutTestCase tc)

request.Headers.Add("contextRequired", "false");
request.Headers.Add("responseCode", (tc.ResponseCode == 0 ? 200 : tc.ResponseCode).ToString());
await c.SendAsync(request).ConfigureAwait(false);
await c.SendAsync(request);
}
catch (Exception)
{
Expand Down Expand Up @@ -286,7 +286,7 @@ private static async Task HttpOutCallsAreCollectedSuccessfullyBodyAsync(
request.Headers.Add("contextRequired", "false");
request.Headers.Add("responseCode", (tc.ResponseCode == 0 ? 200 : tc.ResponseCode).ToString());

await c.SendAsync(request).ConfigureAwait(false);
await c.SendAsync(request);
}
catch (Exception)
{
Expand Down Expand Up @@ -643,7 +643,7 @@ private static async Task CheckEnrichment(Sampler sampler, bool enrichExpected,
.Build())
{
using var c = new HttpClient();
using var r = await c.GetAsync(url).ConfigureAwait(false);
using var r = await c.GetAsync(url);
}

if (enrichExpected)
Expand Down
Loading

0 comments on commit a92d783

Please sign in to comment.