Skip to content

Commit

Permalink
Cron job (MacOS, Linux, Winows) every 6Hrs (#660)
Browse files Browse the repository at this point in the history
* Conditional emulator tests

Explicit Nuget.Config

* Conditional emulator tests

Explicit Nuget.Config

* Ignoring a misisng container in debug mode

* Tracing failures

* More tracing improvements

* Unix path handling

* Handling DllNotFoundException

* Tracing only 20 lines

* Limiting to mac and unix

* Contract tests

* Break the equals

* Excluding functoinal

* Excluding contract changes from non-windows

* Test fix

* Bug ifx

* Explicit restore

* Undo last change

* Listing packages

* Adding retry

* Changing flow

* always

* Ubuntu latest

* Limiting to restore only

* Excluding MAC

* Clean restore

* Excuding nuget.org

* Moved to build command

* Perform acne tests project file removed

* Removing copy entries

* Test file enabling

* Conditional for non-linux

* OS passing from YAML

* Full definition

* Reset changes

* Reset

* Adding extra tracing

* Deadcode

* Reverting valdiation to origianl code

* Reverting LocationCache changes

* Including missed publish test results
  • Loading branch information
kirankumarkolli authored Aug 12, 2019
1 parent 3b83f13 commit add4bef
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 19 deletions.
18 changes: 13 additions & 5 deletions Microsoft.Azure.Cosmos/src/Handler/RequestMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace Microsoft.Azure.Cosmos
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Net;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
Expand Down Expand Up @@ -156,12 +157,19 @@ internal async Task AssertPartitioningDetailsAsync(CosmosClient client, Cancella
}

#if DEBUG
CollectionCache collectionCache = await client.DocumentClient.GetCollectionCacheAsync();
ContainerProperties collectionFromCache =
await collectionCache.ResolveCollectionAsync(this.ToDocumentServiceRequest(), cancellationToken);
if (collectionFromCache.PartitionKey?.Paths?.Count > 0)
try
{
Debug.Assert(this.AssertPartitioningPropertiesAndHeaders());
CollectionCache collectionCache = await client.DocumentClient.GetCollectionCacheAsync();
ContainerProperties collectionFromCache =
await collectionCache.ResolveCollectionAsync(this.ToDocumentServiceRequest(), cancellationToken);
if (collectionFromCache.PartitionKey?.Paths?.Count > 0)
{
Debug.Assert(this.AssertPartitioningPropertiesAndHeaders());
}
}
catch (DocumentClientException ex) when (ex.StatusCode == HttpStatusCode.NotFound)
{
// Ignore container non-existence
}
#else
await Task.CompletedTask;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

[TestCategory("Windows")]
[TestClass]
public class ContractEnforcement
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ namespace Microsoft.Azure.Cosmos
using Microsoft.Azure.Documents;
using Microsoft.VisualStudio.TestTools.UnitTesting;

[TestCategory("Windows")]
[TestClass]
public class DirectContractTests
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<ProjectReference Include="..\..\src\Microsoft.Azure.Cosmos.csproj" />
</ItemGroup>

<ItemGroup>
<ItemGroup Condition="$(OS) != 'Linux'">
<None Include="$(NugetPackageRoot)\Microsoft.Azure.Cosmos.Serialization.HybridRow\$(HybridRowVersion)\microsoft.azure.cosmos.serialization.hybridrow.nuspec">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions azure-pipelines-cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ schedules:


variables:
TestArguments: ' --filter "TestCategory!=Quarantine" --verbosity normal '
TestArguments: ' --filter "TestCategory!=Quarantine & TestCategory!=Functional" --verbosity normal '
NonWindowsTestArguments: ' --filter "TestCategory!=Quarantine & TestCategory!=Functional & TestCategory!=Windows" --verbosity normal '
BuildConfiguration: Release


Expand All @@ -26,14 +27,16 @@ jobs:
- template: templates/build-test.yml
parameters:
BuildConfiguration: Release
Arguments: $(TestArguments)
Arguments: $(NonWindowsTestArguments)
VmImage: macOS-10.14
OS: MacOS

- template: templates/build-test.yml
parameters:
BuildConfiguration: Release
Arguments: $(TestArguments)
VmImage: ubuntu-16.04
Arguments: $(NonWindowsTestArguments)
VmImage: ubuntu-latest
OS: Linux

- template: templates/build-test.yml
parameters:
Expand Down
12 changes: 8 additions & 4 deletions templates/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ parameters:
BuildConfiguration: ''
Arguments: ''
VmImage: '' # https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops
OS: 'Windows'

jobs:
- job:
Expand All @@ -20,14 +21,16 @@ jobs:
displayName: Microsoft.Azure.Cosmos.Tests
condition: succeeded()
inputs:
command: test
command: test
projects: 'Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/*.csproj'
arguments: ${{ parameters.Arguments }} --configuration ${{ parameters.BuildConfiguration }}
arguments: ${{ parameters.Arguments }} --configuration ${{ parameters.BuildConfiguration }} /p:OS=${{ parameters.OS }}
publishTestResults: true
nugetConfigPath: NuGet.config
testRunTitle: Microsoft.Azure.Cosmos.Tests

- job:
displayName: ${{ parameters.BuildConfiguration }}-${{ parameters.VmImage }} Microsoft.Azure.Cosmos.EmulatorTests
condition: and(succeeded(), eq('${{ parameters.OS }}', 'Windows'))
pool:
vmImage: ${{ parameters.VmImage }}

Expand All @@ -44,7 +47,8 @@ jobs:
inputs:
command: test
projects: 'Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/*.csproj'
arguments: ${{ parameters.Arguments }} --configuration ${{ parameters.BuildConfiguration }}
arguments: ${{ parameters.Arguments }} --configuration ${{ parameters.BuildConfiguration }} /p:OS=${{ parameters.OS }}
nugetConfigPath: NuGet.config
publishTestResults: true
testRunTitle: Microsoft.Azure.Cosmos.EmulatorTests

0 comments on commit add4bef

Please sign in to comment.