Skip to content

Commit

Permalink
Release 3.36.0: Fixes client config test and preview pipeline (#4149)
Browse files Browse the repository at this point in the history
* Fixed client cpnfig test and preview pipeline

* fix telemertry service step
  • Loading branch information
sourabh1007 authored Oct 23, 2023
1 parent 3f48041 commit 70855cb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
Expand Down Expand Up @@ -45,7 +46,11 @@ public async Task ClientConfigTest()
ItemResponse<ToDoActivity> response = await this.Container.CreateItemAsync(testItem, new Cosmos.PartitionKey(testItem.pk));
Assert.IsNotNull(response.Diagnostics);
ITrace trace = ((CosmosTraceDiagnostics)response.Diagnostics).Value;
Assert.AreEqual(trace.Data.Count, 1);
#if PREVIEW
Assert.AreEqual(trace.Data.Count, 2, string.Join(",", trace.Data.Select(a => $"{a.Key}: {a.Value}"))); // Distributed Tracing Id
#else
Assert.AreEqual(trace.Data.Count, 1, string.Join(",", trace.Data.Select(a => $"{a.Key}: {a.Value}")));
#endif
ClientConfigurationTraceDatum clientConfigurationTraceDatum = (ClientConfigurationTraceDatum)trace.Data["Client Configuration"];
Assert.IsNotNull(clientConfigurationTraceDatum.UserAgentContainer.UserAgent);
}
Expand Down
22 changes: 10 additions & 12 deletions azure-pipelines-official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,28 @@ pr: none

variables:
ReleaseArguments: ' --filter "TestCategory!=Quarantine" --verbosity normal '
VmImage: windows-latest # https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops
BuildConfiguration: Release
Packaging.EnableSBOMSigning: true
OS: 'Windows'
VmImage: windows-latest # https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops

stages:
- stage:
displayName: Gate
jobs:
- template: templates/static-tools.yml
parameters:
BuildConfiguration: $(BuildConfiguration)
VmImage: $(VmImage)
BuildConfiguration: '${{ variables.BuildConfiguration }}'
VmImage: '${{ variables.VmImage }}'

- template: templates/build-test.yml
parameters:
BuildConfiguration: $(BuildConfiguration)
Arguments: $(ReleaseArguments)
VmImage: $(VmImage)
BuildConfiguration: '${{ variables.BuildConfiguration }}'
Arguments: '${{ variables.ReleaseArguments }}'
VmImage: '${{ variables.VmImage }}'

- job:
displayName: TelemetryToService $(BuildConfiguration)
displayName: TelemetryToService ${{ variables.BuildConfiguration }}
timeoutInMinutes: 120
condition: and(succeeded(), eq('$(OS)', 'Windows'))
pool:
vmImage: windows-2019

Expand All @@ -48,7 +46,7 @@ stages:
inputs:
command: test
projects: 'Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/*.csproj'
arguments: --filter "TestCategory=ClientTelemetryRelease" --verbosity normal --configuration $(BuildConfiguration) /p:OS=$(OS)
arguments: --filter "TestCategory=ClientTelemetryRelease" --verbosity normal --configuration ${{ variables.BuildConfiguration }} /p:OS=Windows
nugetConfigPath: NuGet.config
publishTestResults: true
testRunTitle: Microsoft.Azure.Cosmos.EmulatorTests
Expand All @@ -62,7 +60,7 @@ stages:
- template: templates/nuget-pack.yml
parameters:
BuildConfiguration: Release
VmImage: $(VmImage)
VmImage: '${{ variables.VmImage }}'
ReleasePackage: true
OutputPath: '$(Build.ArtifactStagingDirectory)/bin/AnyCPU/$(BuildConfiguration)/Microsoft.Azure.Cosmos'
OutputPath: '$(Build.ArtifactStagingDirectory)/bin/AnyCPU/Release/Microsoft.Azure.Cosmos'
BlobVersion: $(BlobVersion)

0 comments on commit 70855cb

Please sign in to comment.