diff --git a/.azure-pipelines/ultimate-pipeline.yml b/.azure-pipelines/ultimate-pipeline.yml index 57774d4b2696..f979125f47f3 100644 --- a/.azure-pipelines/ultimate-pipeline.yml +++ b/.azure-pipelines/ultimate-pipeline.yml @@ -2034,9 +2034,10 @@ stages: - script: tracer\build.cmd BuildAspNetIntegrationTests -Framework $(framework) displayName: BuildWindowsIntegrationTests - - script: | - docker compose build --build-arg dotnet_tracer_msi=.$(relativeMsiOutputDirectory)/*.msi --build-arg ENABLE_32_BIT=$(enable32bit) IntegrationTests.IIS - docker compose up -d IntegrationTests.IIS + - powershell: | + mkdir -Force "./artifacts/build_data/logs/LoaderOptimizationStartup" + docker compose build --build-arg DOTNET_TRACER_MSI=.$(relativeMsiOutputDirectory)/*.msi --build-arg ENABLE_32_BIT=$(enable32bit) IntegrationTests.IIS.LoaderOptimizationStartup + docker compose up -d IntegrationTests.IIS.LoaderOptimizationStartup displayName: docker-compose start IntegrationTests.IIS retryCountOnTaskFailure: 5 env: diff --git a/docker-compose.yml b/docker-compose.yml index be0e1399d555..36dcc41a9a1e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -340,14 +340,16 @@ services: # The IIS images are based on Windows images, so they can only be run on Docker for Windows, # and only after switching to run Windows containers - IntegrationTests.IIS: + IntegrationTests.IIS.LoaderOptimizationStartup: build: context: ./ args: - ENABLE_32_BIT - DOTNET_TRACER_MSI - dockerfile: ./tracer/build/_build/docker/iis.dockerfile + dockerfile: ./tracer/build/_build/docker/iis.loaderoptimization.dockerfile image: datadog-iis-loaderoptimizationregkey + volumes: + - ./artifacts/build_data/logs/LoaderOptimizationStartup:c:/ProgramData/Datadog .NET Tracer/logs ports: - "8080:80" environment: diff --git a/tracer/build/_build/docker/iis.dockerfile b/tracer/build/_build/docker/iis.loaderoptimization.dockerfile similarity index 100% rename from tracer/build/_build/docker/iis.dockerfile rename to tracer/build/_build/docker/iis.loaderoptimization.dockerfile diff --git a/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/IIS/LoaderOptimizationStartup.cs b/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/IIS/LoaderOptimizationStartup.cs index 3a72e8069ba7..00f015887724 100644 --- a/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/IIS/LoaderOptimizationStartup.cs +++ b/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/IIS/LoaderOptimizationStartup.cs @@ -4,10 +4,14 @@ // #if NETFRAMEWORK +using System.IO; using System.Net; using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using Datadog.Trace.Configuration.Telemetry; +using Datadog.Trace.Logging; +using FluentAssertions; using Xunit; using Xunit.Abstractions; @@ -60,6 +64,14 @@ public async Task ApplicationDoesNotReturnErrors() // Server is ready to receive requests var responseMessage = await client.GetAsync(Url); Assert.Equal(HttpStatusCode.OK, responseMessage.StatusCode); + + // verify we have some logs, so we know instrumentation happened + var logDirectory = Path.Combine( + DatadogLoggingFactory.GetLogDirectory(NullConfigurationTelemetry.Instance), + nameof(LoaderOptimizationStartup)); + + Output.WriteLine($"Reading files from {logDirectory}"); + Directory.GetFiles(logDirectory).Should().NotBeEmpty(); } } }