Skip to content

Commit

Permalink
Post build and test fixes cherrypick fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Mpdreamz committed Aug 19, 2016
1 parent e9795ea commit 802cba2
Show file tree
Hide file tree
Showing 55 changed files with 159 additions and 765 deletions.
14 changes: 10 additions & 4 deletions build/scripts/Testing.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,23 @@ open System.IO
open Fake
open Paths
open Projects
open Tooling

module Tests =
let private testProjectJson parallelization =
let p = Paths.Source "Tests/project.json"
Tooling.DotNet.Exec ["restore"; p;]
Tooling.DotNet.Exec ["test"; p; "-parallel"; parallelization; "-xml"; Paths.Output("TestResults-Core-Clr.xml")]
DotNetProject.AllPublishable
|> Seq.iter(fun p ->
let path = Paths.ProjectJson p.Name
DotNet.Exec ["restore"; path; "--verbosity Warning"]
)

let testPath = Paths.Source "Tests/project.json"
DotNet.Exec ["test"; testPath; "-parallel"; parallelization; "-xml"; Paths.Output("TestResults-Core-Clr.xml")]

let private testDesktopClr parallelization =
let folder = Paths.ProjectOutputFolder (PrivateProject PrivateProject.Tests) DotNetFramework.Net46
let testDll = Path.Combine(folder, "Tests.dll")
Tooling.XUnit.Exec [testDll; "-parallel"; parallelization; "-xml"; Paths.Output("TestResults-Desktop-Clr.xml")]
XUnit.Exec [testDll; "-parallel"; parallelization; "-xml"; Paths.Output("TestResults-Desktop-Clr.xml")]
|> ignore


Expand Down
1 change: 0 additions & 1 deletion paket.lock
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ NUGET
runtime.native.System.Security.Cryptography (4.0) - framework: >= netstandard13
Microsoft.NETCore.Platforms (>= 1.0.1)
Microsoft.NETCore.Targets (>= 1.0.1)
SemanticVersioning (0.6.17)
ShellProgressBar (3.0)
System.AppContext (4.1) - framework: >= netstandard13
System.Runtime (>= 4.1) - framework: dnxcore50, netstandard13, >= netstandard15
Expand Down
4 changes: 2 additions & 2 deletions src/Benchmarking/Benchmarking.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -1290,7 +1290,7 @@
</When>
</Choose>
<Choose>
<When Condition="($(TargetFrameworkIdentifier) == '.NETStandard' And ($(TargetFrameworkVersion) == 'v1.3' Or $(TargetFrameworkVersion) == 'v1.4' Or $(TargetFrameworkVersion) == 'v1.5' Or $(TargetFrameworkVersion) == 'v1.6')) Or ($(TargetFrameworkIdentifier) == '.NETCoreApp' And $(TargetFrameworkVersion) == 'v1.0')">
<When Condition="($(TargetFrameworkIdentifier) == '.NETStandard' And $(TargetFrameworkVersion) == 'v1.6') Or ($(TargetFrameworkIdentifier) == '.NETCoreApp' And $(TargetFrameworkVersion) == 'v1.0')">
<ItemGroup>
<Reference Include="System.Threading.Thread">
<HintPath>..\..\packages\System.Threading.Thread\ref\netstandard1.3\System.Threading.Thread.dll</HintPath>
Expand Down Expand Up @@ -1362,4 +1362,4 @@
</ItemGroup>
</When>
</Choose>
</Project>
</Project>
3 changes: 1 addition & 2 deletions src/CodeGeneration/ApiGenerator/ApiGenerator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
<Compile Include="Overrides\Descriptors\ClearCacheDescriptorOverrides.cs" />
<Compile Include="Overrides\Descriptors\ClearCachedRealmsDescriptorOverrides.cs" />
<Compile Include="Overrides\Descriptors\ClearCachedRolesDescriptorOverrides.cs" />
<Compile Include="Overrides\Descriptors\DeleteWarmerDescriptorOverrides.cs" />
<Compile Include="Overrides\Descriptors\DescriptorOverridesBase.cs" />
<Compile Include="Overrides\Descriptors\FieldStatsDescriptorOverrides.cs" />
<Compile Include="Overrides\Descriptors\GraphExploreDescriptorOverrides.cs" />
Expand Down Expand Up @@ -960,4 +959,4 @@
</ItemGroup>
</When>
</Choose>
</Project>
</Project>
338 changes: 13 additions & 325 deletions src/CodeGeneration/DocGenerator/DocGenerator.csproj

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions src/Profiling/Profiling.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@
<Compile Include="Async\ScrollAsync.cs" />
<Compile Include="Async\SearchAsync.cs" />
<Compile Include="Async\SearchAsyncOperation.cs" />
<Compile Include="Async\SearchExistsAsync.cs" />
<Compile Include="Async\SearchShardsAsync.cs" />
<Compile Include="Async\SearchTemplateAsync.cs" />
<Compile Include="Async\SegmentsAsync.cs" />
Expand Down Expand Up @@ -1503,7 +1502,7 @@
</When>
</Choose>
<Choose>
<When Condition="($(TargetFrameworkIdentifier) == '.NETStandard' And ($(TargetFrameworkVersion) == 'v1.3' Or $(TargetFrameworkVersion) == 'v1.4' Or $(TargetFrameworkVersion) == 'v1.5' Or $(TargetFrameworkVersion) == 'v1.6')) Or ($(TargetFrameworkIdentifier) == '.NETCoreApp' And $(TargetFrameworkVersion) == 'v1.0')">
<When Condition="($(TargetFrameworkIdentifier) == '.NETStandard' And $(TargetFrameworkVersion) == 'v1.6') Or ($(TargetFrameworkIdentifier) == '.NETCoreApp' And $(TargetFrameworkVersion) == 'v1.0')">
<ItemGroup>
<Reference Include="System.Threading.Thread">
<HintPath>..\..\packages\System.Threading.Thread\ref\netstandard1.3\System.Threading.Thread.dll</HintPath>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using FluentAssertions;
using Nest;
using Tests.Framework;
using Tests.Framework.Integration;
using Tests.Framework.MockData;
using static Nest.Infer;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using FluentAssertions;
using Nest;
using Tests.Framework;
using Tests.Framework.Integration;
using Tests.Framework.MockData;
using Xunit;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using FluentAssertions;
using Nest;
using Tests.Framework;
using Tests.Framework.Integration;
using Tests.Framework.MockData;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using FluentAssertions;
using Nest;
using Tests.Framework;
using Tests.Framework.Integration;
using Tests.Framework.MockData;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using FluentAssertions;
using Nest;
using Tests.Framework;
using Tests.Framework.Integration;
using Tests.Framework.MockData;

Expand Down
3 changes: 1 addition & 2 deletions src/Tests/Cat/CatHealth/CatHealthApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ protected override void ExpectResponse(ICatResponse<CatHealthRecord> response)
}
}

[Collection(TypeOfCluster.ReadOnly)]
public class CatHealthNoTimestampApiTests : ApiIntegrationTestBase<ICatResponse<CatHealthRecord>, ICatHealthRequest, CatHealthDescriptor, CatHealthRequest>
public class CatHealthNoTimestampApiTests : ApiIntegrationTestBase<ReadOnlyCluster, ICatResponse<CatHealthRecord>, ICatHealthRequest, CatHealthDescriptor, CatHealthRequest>
{
public CatHealthNoTimestampApiTests(ReadOnlyCluster cluster, EndpointUsage usage) : base(cluster, usage) { }
protected override LazyResponses ClientUsage() => Calls(
Expand Down
3 changes: 1 addition & 2 deletions src/Tests/Cat/CatTasks/CatTasksApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@

namespace Tests.Cat.CatTasks
{
[Collection(TypeOfCluster.ReadOnly)]
public class CatTasksApiTests : ApiIntegrationTestBase<ICatResponse<CatTasksRecord>, ICatTasksRequest, CatTasksDescriptor, CatTasksRequest>
public class CatTasksApiTests : ApiIntegrationTestBase<ReadOnlyCluster, ICatResponse<CatTasksRecord>, ICatTasksRequest, CatTasksDescriptor, CatTasksRequest>
{
public CatTasksApiTests(ReadOnlyCluster cluster, EndpointUsage usage) : base(cluster, usage) { }
protected override LazyResponses ClientUsage() => Calls(
Expand Down
4 changes: 2 additions & 2 deletions src/Tests/ClientConcepts/Exceptions/ExceptionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public ExceptionTests(WritableCluster cluster)
//[I]
public void ServerTestWhenThrowExceptionsEnabled()
{
var settings = new ConnectionSettings(TestClient.CreateNode(_port))
var settings = new ConnectionSettings(TestClient.CreateUri(_port))
.ThrowExceptions();
var client = new ElasticClient(settings);
var exception = Assert.Throws<ElasticsearchClientException>(() => client.GetMapping<Project>(s => s.Index("doesntexist")));
Expand Down Expand Up @@ -55,7 +55,7 @@ public void ClientTestWhenThrowExceptionsEnabled()
//[I]
public void ServerTestWhenThrowExceptionsDisabled()
{
var settings = new ConnectionSettings(TestClient.CreateNode(_port));
var settings = new ConnectionSettings(TestClient.CreateUri(_port));
var client = new ElasticClient(settings);
var response = client.GetMapping<Project>(s => s.Index("doesntexist"));
#if DOTNETCORE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,12 @@ [U] public void ImplicitConversionFromString()
*/
[U] public void UsingStaticPropertyField()
{

var client = TestClient.Default;

var singleString = Index("name1"); // <1> specifying a single index using a string
var singleTyped = Index<Project>(); //<2> specifying a single index using a type

ISearchRequest singleStringRequest = new SearchDescriptor<Project>().Index(singleString);
ISearchRequest singleTypedRequest = new SearchDescriptor<Project>().Index(singleTyped);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,9 @@ namespace Tests.ClientConcepts.HighLevel.Inference
/**[[property-inference]]
* == Property Name Inference
*/
public class PropertyNames : SimpleIntegration, IClusterFixture<WritableCluster>
public class PropertyNames : IntegrationDocumentationTestBase , IClusterFixture<WritableCluster>
{
public PropertyNames(IndexingCluster cluster) : base(cluster) { }

public PropertyNames(WritableCluster cluster) : base(cluster)
{
_client = cluster.Client;
}
public PropertyNames(WritableCluster cluster) : base(cluster) { }

/**=== Appending suffixes to a Lambda expression body
* Suffixes can be appended to the body of a lambda expression, useful in cases where
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@

namespace Tests.Cluster.ClusterAllocationExplain
{
[Collection(TypeOfCluster.ReadOnly)]
public class ClusterAllocationExplainApiTests : ApiIntegrationTestBase<IClusterAllocationExplainResponse, IClusterAllocationExplainRequest, ClusterAllocationExplainDescriptor, ClusterAllocationExplainRequest>
public class ClusterAllocationExplainApiTests : ApiIntegrationTestBase<ReadOnlyCluster, IClusterAllocationExplainResponse, IClusterAllocationExplainRequest, ClusterAllocationExplainDescriptor, ClusterAllocationExplainRequest>
{
public ClusterAllocationExplainApiTests(ReadOnlyCluster cluster, EndpointUsage usage) : base(cluster, usage) { }
protected override LazyResponses ClientUsage() => Calls(
Expand Down
7 changes: 3 additions & 4 deletions src/Tests/Document/Multiple/BulkAll/BulkAllApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@

namespace Tests.Document.Multiple.BulkAll
{
[Collection(TypeOfCluster.Indexing)]
public class BulkAllApiTests : SerializationTestBase
public class BulkAllApiTests : SerializationTestBase, IClusterFixture<WritableCluster>
{
private class SmallObject
{
Expand All @@ -29,9 +28,9 @@ private IEnumerable<SmallObject> CreateLazyStreamOfDocuments(int count)
yield return new SmallObject() { Id = i };
}

public BulkAllApiTests(IndexingCluster cluster, EndpointUsage usage)
public BulkAllApiTests(WritableCluster cluster, EndpointUsage usage)
{
this._client = cluster.Client();
this._client = cluster.Client;
}

[I] public void ReturnsExpectedResponse()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

namespace Tests.Document.Multiple.DeleteByQuery
{
public class DeleteByQueryApiTests : ApiIntegrationTestBase<WritableCluster, IDeleteByQueryResponse, IDeleteByQueryRequest, DeleteByQueryDescriptor<Project>, DeleteByQueryRequest>
public class DeleteByQueryApiTests : ApiIntegrationTestBase<IntrusiveOperationCluster, IDeleteByQueryResponse, IDeleteByQueryRequest, DeleteByQueryDescriptor<Project>, DeleteByQueryRequest>
{
public DeleteByQueryApiTests(WritableCluster cluster, EndpointUsage usage) : base(cluster, usage) { }
public DeleteByQueryApiTests(IntrusiveOperationCluster cluster, EndpointUsage usage) : base(cluster, usage) { }

protected override void IntegrationSetup(IElasticClient client, CallUniqueValues values)
{
Expand Down Expand Up @@ -99,10 +99,9 @@ protected override void ExpectResponse(IDeleteByQueryResponse response)
}


[Collection(TypeOfCluster.OwnIndex)]
public class DeleteByQueryWaitForCompletionApiTests : DeleteByQueryApiTests
{
public DeleteByQueryWaitForCompletionApiTests(OwnIndexCluster cluster, EndpointUsage usage) : base(cluster, usage) { }
public DeleteByQueryWaitForCompletionApiTests(IntrusiveOperationCluster cluster, EndpointUsage usage) : base(cluster, usage) { }

protected override string UrlPath => $"/{CallIsolatedValue}/project/_delete_by_query?wait_for_completion=false&conflicts=proceed";

Expand Down Expand Up @@ -130,10 +129,9 @@ protected override void ExpectResponse(IDeleteByQueryResponse response)
}
}

[Collection(TypeOfCluster.OwnIndex)]
public class DeleteByQueryWithFailuresApiTests : DeleteByQueryApiTests
{
public DeleteByQueryWithFailuresApiTests(OwnIndexCluster cluster, EndpointUsage usage) : base(cluster, usage) { }
public DeleteByQueryWithFailuresApiTests(IntrusiveOperationCluster cluster, EndpointUsage usage) : base(cluster, usage) { }

protected override void IntegrationSetup(IElasticClient client, CallUniqueValues values)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,33 +114,5 @@ protected override void ExpectResponse(IMultiTermVectorsResponse response)
}
})
};

protected override void ExpectResponse(IMultiTermVectorsResponse response)
{
response.IsValid.Should().BeTrue();
response.Documents.Should().NotBeEmpty().And.HaveCount(2).And.OnlyContain(d => d.Found);
var termvectorDoc = response.Documents.FirstOrDefault(d => d.TermVectors.Count > 0);

termvectorDoc.Should().NotBeNull();
termvectorDoc.Index.Should().NotBeNull();
termvectorDoc.Type.Should().NotBeNull();
termvectorDoc.Id.Should().NotBeNull();

termvectorDoc.TermVectors.Should().NotBeEmpty().And.ContainKey("firstName");
var vectors = termvectorDoc.TermVectors["firstName"];
vectors.Terms.Should().NotBeEmpty();
foreach (var vectorTerm in vectors.Terms)
{
vectorTerm.Key.Should().NotBeNullOrWhiteSpace();
vectorTerm.Value.Should().NotBeNull();
vectorTerm.Value.TermFrequency.Should().BeGreaterThan(0);
vectorTerm.Value.DocumentFrequency.Should().BeGreaterThan(0);
vectorTerm.Value.TotalTermFrequency.Should().BeGreaterThan(0);
vectorTerm.Value.Tokens.Should().NotBeEmpty();

var token = vectorTerm.Value.Tokens.First();
token.EndOffset.Should().BeGreaterThan(0);
}
}
}
}
23 changes: 0 additions & 23 deletions src/Tests/Document/Multiple/Reindex/ReindexApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,29 +100,6 @@ public void ReturnsExpectedResponse()
onCompleted: () => ReindexSingleTypeCompleted(handles)
);

var searchResult = this._client.Search<CommitActivity>(s => s
.Index(NewManyTypesIndexName)
.From(0)
.Size(100)
.Query(q => q.MatchAll())
.SearchType(SearchType.Scan)
.Scroll(scroll)
);

do
{
var result = searchResult;
searchResult = this._client.Scroll<CommitActivity>(scroll, result.ScrollId);
foreach (var hit in searchResult.Hits)
{
hit.Timestamp.Should().HaveValue();
hit.Parent.Should().NotBeNullOrEmpty();
hit.Routing.Should().NotBeNullOrEmpty();
}
} while (searchResult.IsValid && searchResult.Documents.Any());
handles[0].Set();
}
);

WaitHandle.WaitAll(handles, TimeSpan.FromMinutes(3));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

namespace Tests.Document.Multiple.ReindexRethrottle
{
[Collection(TypeOfCluster.Reindex)]
public class ReindexRethrottleReindexApiTests : ReindexRethrottleApiTests
{
public ReindexRethrottleReindexApiTests(ReindexCluster cluster, EndpointUsage usage) : base(cluster, usage)
Expand All @@ -41,7 +40,6 @@ protected override void OnBeforeCall(IElasticClient client)
}
}

[Collection(TypeOfCluster.Reindex)]
public class ReindexRethrottleUpdateByQueryTests : ReindexRethrottleApiTests
{
public ReindexRethrottleUpdateByQueryTests(ReindexCluster cluster, EndpointUsage usage) : base(cluster, usage)
Expand All @@ -65,7 +63,7 @@ protected override void OnBeforeCall(IElasticClient client)
}

public abstract class ReindexRethrottleApiTests
: ApiIntegrationTestBase<IReindexRethrottleResponse, IReindexRethrottleRequest, ReindexRethrottleDescriptor, ReindexRethrottleRequest>
: ApiIntegrationTestBase<ReindexCluster, IReindexRethrottleResponse, IReindexRethrottleRequest, ReindexRethrottleDescriptor, ReindexRethrottleRequest>
{
protected TaskId TaskId => this.RanIntegrationSetup ? this.ExtendedValue<TaskId>(TaskIdKey) : "foo:1";

Expand Down
14 changes: 5 additions & 9 deletions src/Tests/Document/Single/Index/IndexApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,9 @@ protected override string UrlPath

}

public class IndexIntegrationTests : SimpleIntegration, IClusterFixture<WritableCluster>
public class IndexIntegrationTests : IntegrationDocumentationTestBase, IClusterFixture<WritableCluster>
{
public IndexIntegrationTests(WritableCluster cluster) : base(cluster)
{
}
public IndexIntegrationTests(WritableCluster cluster) : base(cluster) { }

[I]
public void OpTypeCreate()
Expand Down Expand Up @@ -129,11 +127,9 @@ public void Index()
}
}

public class IndexJObjectIntegrationTests : SimpleIntegration, IClusterFixture<WritableCluster>
public class IndexJObjectIntegrationTests : IntegrationDocumentationTestBase, IClusterFixture<WritableCluster>
{
public IndexJObjectIntegrationTests(WritableCluster cluster) : base(cluster)
{
}
public IndexJObjectIntegrationTests(WritableCluster cluster) : base(cluster) { }

[I]
public void Index()
Expand Down Expand Up @@ -185,7 +181,7 @@ public void Index()
}
}

public class IndexAnonymousTypesIntegrationTests : SimpleIntegration, IClusterFixture<WritableCluster>
public class IndexAnonymousTypesIntegrationTests : IntegrationDocumentationTestBase, IClusterFixture<WritableCluster>
{
public IndexAnonymousTypesIntegrationTests(WritableCluster cluster) : base(cluster) { }

Expand Down
Loading

0 comments on commit 802cba2

Please sign in to comment.