Skip to content

Commit 1cc9af7

Browse files
russcamcodebrain
authored andcommitted
Get benchmarking and profiling working again
Broken with the move to new new csproj
1 parent 2efdb55 commit 1cc9af7

File tree

9 files changed

+32
-25
lines changed

9 files changed

+32
-25
lines changed

build/scripts/Benchmarking.fsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,10 @@ module Benchmarker =
2121
let projectJson = testsProjectDirectory @@ "project.json"
2222
// running benchmarks can timeout so clean up any generated benchmark files
2323
try
24-
DotNetCli.Restore(fun p ->
25-
{ p with
26-
Project = projectJson
27-
})
28-
2924
DotNetCli.RunCommand(fun p ->
3025
{ p with
31-
WorkingDir = testsProjectDirectory
32-
}) "run Benchmark"
26+
WorkingDir = testsProjectDirectory
27+
}) "run -f net46 -c Release Benchmark"
3328
finally
3429
let benchmarkOutputFiles =
3530
let output = combinePaths testsProjectDirectory "BenchmarkDotNet.Artifacts"

build/scripts/Commandline.fsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,17 @@ module Commandline =
6767
setEnvironVar "FAKEBUILD" "1"
6868
printfn "%A" arguments
6969
match arguments with
70-
| [] | ["build"] | ["test"] | ["clean"] -> ignore()
70+
| [] | ["build"] | ["test"] | ["clean"] | ["benchmark"] | ["profile"] -> ignore()
7171
| ["release"; version] -> setBuildParam "version" version
7272

7373
| ["test"; testFilter] -> setBuildParam "testfilter" testFilter
7474

75-
| ["profile"; esVersions] -> setBuildParam "esversions" esVersions
75+
| ["profile"; esVersions] ->
76+
setBuildParam "esversions" esVersions
7677
| ["profile"; esVersions; testFilter] ->
7778
setBuildParam "esversions" esVersions
78-
setBuildParam "testfilter" testFilter
79-
79+
setBuildParam "testfilter" testFilter
80+
8081
| ["integrate"; esVersions] -> setBuildParam "esversions" esVersions
8182
| ["integrate"; esVersions; clusterFilter] ->
8283
setBuildParam "esversions" esVersions

build/scripts/Profiling.fsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ module Profiler =
4848
member val Commit = commit with get, set
4949
member val Functions = functions with get, set
5050

51-
let private project = "Tests"
52-
let private profiledApp = sprintf "%s/%s/%s.exe" (Paths.Output("v4.6")) project project
51+
let private project = PrivateProject(Tests).Name
52+
let private profiledApp = sprintf "%s/net46/%s.exe" (Paths.Output("Tests")) project
5353
let private snapShotOutput = Paths.Output("ProfilingSnapshot.dtp")
5454
let private snapShotStatsOutput = Paths.Output("ProfilingSnapshotStats.html")
5555
let private profileOutput = Paths.Output("ProfilingReport.xml")
@@ -63,7 +63,8 @@ module Profiler =
6363

6464
let Run() =
6565
let date = DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ss.fffz")
66-
Tooling.execProcessWithTimeout profiledApp ["Profile";"Class";getBuildParam "testfilter"] (TimeSpan.FromMinutes 30.) |> ignore
66+
trace profiledApp
67+
Tooling.execProcessWithTimeout profiledApp ["Profile";"Class";getBuildParam "testfilter"] (TimeSpan.FromMinutes 30.) "." |> ignore
6768
trace "Profiling finished."
6869

6970
let performanceOutput = Paths.Output("profiling/performance") |> directoryInfo

src/CodeGeneration/ApiGenerator/ApiGenerator.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
</ItemGroup>
1515
<ItemGroup>
1616
<Folder Include="RestSpecification\XPack\Info" />
17-
<Folder Include="RestSpecification\XPack\MachineLearning" />
1817
</ItemGroup>
18+
<Import Project="..\..\..\.paket\Paket.Restore.targets" />
1919
<Import Project="..\..\outputpath.props" />
2020
</Project>

src/CodeGeneration/DocGenerator/DocGenerator.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@
1818
<PackageReference Include="System.Collections.Immutable" Version="1.3.1" />
1919
<PackageReference Include="Newtonsoft.Json" Version="10.0.1" />
2020
</ItemGroup>
21+
<Import Project="..\..\..\.paket\Paket.Restore.targets" />
2122
<Import Project="..\..\outputpath.props" />
22-
</Project>
23+
</Project>

src/Elasticsearch.Net/Elasticsearch.Net.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@
1616
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.3.0" />
1717
<PackageReference Include="Microsoft.CSharp" Version="4.3.0" />
1818
</ItemGroup>
19+
<Import Project="..\..\.paket\Paket.Restore.targets" />
1920
<Import Project="..\outputpath.props" />
20-
</Project>
21+
</Project>

src/Nest/Nest.csproj

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,19 @@
1818
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.3.0" />
1919
<PackageReference Include="System.Linq.Queryable" Version="4.0.1" />
2020
</ItemGroup>
21+
<ItemGroup>
22+
<Folder Include="Cluster\RemoteInfo" />
23+
<Folder Include="Cluster\RemoteInfo" />
24+
<Folder Include="Document\Single\SourceExists" />
25+
<Folder Include="Mapping\Types\Specialized\Attachment" />
26+
<Folder Include="QueryDsl\FullText\MatchPhrase" />
27+
<Folder Include="QueryDsl\FullText\MatchPhrasePrefix" />
28+
<Folder Include="Search\FieldCapabilities" />
29+
<Folder Include="XPack\Info\XPackInfo" />
30+
<Folder Include="XPack\Info\XPackInfo" />
31+
<Folder Include="XPack\Info\XPackUsage" />
32+
</ItemGroup>
33+
<!--<Import Project="..\..\.paket\Paket.Restore.targets" />-->
34+
<Import Project="..\..\.paket\Paket.Restore.targets" />
2135
<Import Project="..\outputpath.props" />
2236
</Project>

src/Tests/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ static Program()
5959
// TODO: Renamed this from Main to TestMain because of a bug with Resharper and running unit tests
6060
// in Visual Studio with .NET Core: https://youtrack.jetbrains.com/issue/RSRP-464233
6161
// Once this is fixed, look at renaming back and removing additional packages. See https://github.com/elastic/elasticsearch-net/pull/2793
62-
public static void TestMain(string[] args)
62+
public static void Main(string[] args)
6363
{
6464
if (args.Length == 0)
6565
Console.WriteLine("Must specify at least one argument: TestAssemblyPath, Profile or Benchmark ");

src/Tests/Tests.csproj

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
<VersionPrefix>6.0.0</VersionPrefix>
1010
<VersionSuffix>alpha</VersionSuffix>
1111
<DefineConstants Condition="'$(TargetFramework)'=='netcoreapp1.1' OR '$(DotNetCoreOnly)'=='1'">$(DefineConstants);DOTNETCORE</DefineConstants>
12-
<DebugType Condition="'$(DotNetCoreOnly)'==''">embedded</DebugType>
13-
<DebugType Condition="'$(Configuration)'=='Debug'">full</DebugType>
1412
</PropertyGroup>
1513
<ItemGroup>
1614
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.0-beta1-build3642" />
@@ -25,7 +23,6 @@
2523
<PackageReference Include="BenchMarkDotNet" Version="0.10.0" />
2624
<PackageReference Include="DiffPlex" Version="1.4.1" />
2725
<PackageReference Include="System.Reactive" Version="3.1.1" />
28-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
2926
<!-- TODO only for Desktop CLR? -->
3027
<PackageReference Include="System.Buffers" Version="4.3.0" />
3128
<!-- TODO update -->
@@ -34,9 +31,6 @@
3431
<PackageReference Include="JetBrains.Profiler.Kernel.Windows.Api" Version="108.0.20170209.151431-eap01" />
3532
<Reference Include="..\..\build\profiling\JetBrains.Profiler.Windows.SelfApi.dll" />
3633
</ItemGroup>
37-
<ItemGroup Condition="'$(TargetFramework)'!='net45'">
38-
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
39-
</ItemGroup>
4034
<ItemGroup Condition="'$(TargetFramework)'=='netcoreapp1.1'">
4135
<PackageReference Include="System.Net.Http" Version="4.3.0" />
4236
<PackageReference Include="System.Diagnostics.FileVersionInfo" Version="4.3.0" />
@@ -45,4 +39,4 @@
4539
<EmbeddedResource Include="Document\Single\Index\Attachment_Test_Document.pdf" />
4640
</ItemGroup>
4741
<Import Project="..\outputpath.props" />
48-
</Project>
42+
</Project>

0 commit comments

Comments
 (0)