Cron job (MacOS, Linux, Winows) every 6Hrs (#660)
* 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
This commit is contained in:
Родитель
3b83f13946
Коммит
add4bef051
|
@ -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;
|
||||
|
@ -156,12 +157,19 @@ namespace Microsoft.Azure.Cosmos
|
|||
}
|
||||
|
||||
#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;
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
[TestCategory("Windows")]
|
||||
[TestClass]
|
||||
public class ContractEnforcement
|
||||
{
|
||||
|
|
|
@ -14,6 +14,7 @@ namespace Microsoft.Azure.Cosmos
|
|||
using Microsoft.Azure.Documents;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
[TestCategory("Windows")]
|
||||
[TestClass]
|
||||
public class DirectContractTests
|
||||
{
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -13,6 +13,7 @@ namespace Microsoft.Azure.Cosmos.Properties {
|
|||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using Microsoft.Azure.Documents;
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
@ -88,7 +89,7 @@ namespace Microsoft.Azure.Cosmos.Properties {
|
|||
/// </summary>
|
||||
internal static byte[] BaselineTest_PartitionRoutingHelper_ExtractPartitionKeyRangeFromHeaders {
|
||||
get {
|
||||
string fileContent = File.ReadAllText(@"Routing\resources\BaselineTest.PartitionRoutingHelper.ExtractPartitionKeyRangeFromHeaders.json");
|
||||
string fileContent = File.ReadAllText(Resources.GetNormalizedFile(@"Routing\resources\BaselineTest.PartitionRoutingHelper.ExtractPartitionKeyRangeFromHeaders.json"));
|
||||
return Encoding.UTF8.GetBytes((string)fileContent);
|
||||
}
|
||||
}
|
||||
|
@ -98,7 +99,7 @@ namespace Microsoft.Azure.Cosmos.Properties {
|
|||
/// </summary>
|
||||
internal static byte[] BaselineTest_PartitionRoutingHelper_GetPartitionRoutingInfo {
|
||||
get {
|
||||
string fileContent = File.ReadAllText(@"Routing\resources\BaselineTest.PartitionRoutingHelper.GetPartitionRoutingInfo.json");
|
||||
string fileContent = File.ReadAllText(Resources.GetNormalizedFile(@"Routing\resources\BaselineTest.PartitionRoutingHelper.GetPartitionRoutingInfo.json"));
|
||||
return Encoding.UTF8.GetBytes((string)fileContent);
|
||||
}
|
||||
}
|
||||
|
@ -108,7 +109,7 @@ namespace Microsoft.Azure.Cosmos.Properties {
|
|||
/// </summary>
|
||||
internal static byte[] BaselineTest_PartitionSchemes {
|
||||
get {
|
||||
string fileContent = File.ReadAllText(@"Routing\resources\BaselineTest.PartitionSchemes.json");
|
||||
string fileContent = File.ReadAllText(Resources.GetNormalizedFile(@"Routing\resources\BaselineTest.PartitionSchemes.json"));
|
||||
return Encoding.UTF8.GetBytes((string)fileContent);
|
||||
}
|
||||
}
|
||||
|
@ -118,7 +119,7 @@ namespace Microsoft.Azure.Cosmos.Properties {
|
|||
/// </summary>
|
||||
internal static byte[] BaselineTest_PathParser {
|
||||
get {
|
||||
string fileContent = File.ReadAllText(@"Routing\resources\BaselineTest.PathParser.json");
|
||||
string fileContent = File.ReadAllText(Resources.GetNormalizedFile(@"Routing\resources\BaselineTest.PathParser.json"));
|
||||
return Encoding.UTF8.GetBytes((string)fileContent);
|
||||
}
|
||||
}
|
||||
|
@ -128,7 +129,7 @@ namespace Microsoft.Azure.Cosmos.Properties {
|
|||
/// </summary>
|
||||
internal static byte[] BaselineTest_PathParser_Extra {
|
||||
get {
|
||||
string fileContent = File.ReadAllText(@"Routing\resources\BaselineTest.PathParser.Extra.json");
|
||||
string fileContent = File.ReadAllText(Resources.GetNormalizedFile(@"Routing\resources\BaselineTest.PathParser.Extra.json"));
|
||||
return Encoding.UTF8.GetBytes((string)fileContent);
|
||||
}
|
||||
}
|
||||
|
@ -162,5 +163,15 @@ namespace Microsoft.Azure.Cosmos.Properties {
|
|||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
private static string GetNormalizedFile(string filewithPath)
|
||||
{
|
||||
if (Environment.OSVersion.Platform == PlatformID.Unix || Environment.OSVersion.Platform == PlatformID.MacOSX)
|
||||
{
|
||||
return filewithPath.Replace("\\", "/");
|
||||
}
|
||||
|
||||
return filewithPath;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
@ -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 }}
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче