Skip to content

Commit 32be96c

Browse files
committed
sync changes with 7.12
1 parent 0bae416 commit 32be96c

File tree

8 files changed

+61
-53
lines changed

8 files changed

+61
-53
lines changed

Directory.Build.props

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@
3333
<OutputPath Condition="'$(OutputPathBaseDir)' != ''">$(OutputPathBaseDir)\$(MSBuildProjectName)\</OutputPath>
3434
<SolutionRoot>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), build.bat))</SolutionRoot>
3535

36+
<DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>
37+
<RestoreLockedMode>true</RestoreLockedMode>
38+
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
39+
3640
<DefineConstants Condition="'$(TargetFramework)'=='net461' or '$(TargetFramework)'=='net472'">$(DefineConstants);FULLFRAMEWORK</DefineConstants>
3741
<DefineConstants Condition="$(DefineConstants.Contains(FULLFRAMEWORK)) == False">$(DefineConstants);DOTNETCORE</DefineConstants>
3842
<DefineConstants Condition="$(DefineConstants.Contains(FULLFRAMEWORK)) == False and '$(TargetFramework)'!='netstandard2.0'">$(DefineConstants);DOTNETCORE_2_1_OR_HIGHER</DefineConstants>

build/scripts/Building.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ open System.IO.Compression
1919

2020
module Build =
2121

22-
let Restore() = DotNet.Exec ["restore"; Paths.Solution; ] |> ignore
22+
let Restore () = DotNet.Exec ["restore"; Paths.Solution; ] |> ignore
2323

2424
let Compile _ version =
2525
let props =

build/scripts/Commandline.fs

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ open System
88
open System.Runtime.InteropServices
99
open Fake.Core
1010
open Fake.IO
11+
open Octokit
1112

1213
//this is ugly but a direct port of what used to be duplicated in our DOS and bash scripts
1314
module Commandline =
@@ -83,7 +84,7 @@ Execution hints can be provided anywhere on the command line
8384
type MultiTarget = All | One
8485

8586
type VersionArguments = { Version: string; OutputLocation: string option }
86-
type TestArguments = { TrxExport: bool; CodeCoverage: bool; TestFilter: string option; }
87+
type TestArguments = { TrxExport: bool; TestFilter: string option; }
8788
type IntegrationArguments = { TrxExport: bool; TestFilter: string option; ClusterFilter: string option; ElasticsearchVersions: string list; }
8889

8990
type BenchmarkArguments = { Endpoint: string; Username: string option; Password: string option; }
@@ -117,16 +118,12 @@ Execution hints can be provided anywhere on the command line
117118
RuntimeInformation.IsOSPlatform(OSPlatform.Linux) ||
118119
RuntimeInformation.IsOSPlatform(OSPlatform.OSX)
119120

120-
let private buildingOnAzurePipeline = Environment.environVarAsBool "TF_BUILD"
121-
122-
let runningOnAzureDevops = Environment.hasEnvironVar "TF_BUILD"
123-
let runningOnCi = runningOnAzureDevops || Environment.hasEnvironVar "APPVEYOR_BUILD_VERSION"
124-
125121
let parse (args: string list) =
126122

127123
let filteredArgs =
128124
args
129125
|> List.filter(fun x ->
126+
x <> "--report" &&
130127
x <> "skiptests" &&
131128
x <> "gendocs" &&
132129
x <> "skipdocs" &&
@@ -146,6 +143,9 @@ Execution hints can be provided anywhere on the command line
146143
| _ -> "build"
147144
let skipTests = args |> List.exists (fun x -> x = "skiptests") || target = "documentation"
148145
let skipDocs = args |> List.exists (fun x -> x = "skipdocs")
146+
let report = args |> List.exists (fun x -> x = "--report")
147+
148+
printf "%b exist" report
149149

150150
let parsed = {
151151
NonInteractive = args |> List.exists (fun x -> x = "non-interactive")
@@ -211,25 +211,22 @@ Execution hints can be provided anywhere on the command line
211211
{
212212
parsed with CommandArguments = Test {
213213
TestFilter = None
214-
TrxExport = buildingOnAzurePipeline
215-
CodeCoverage = buildingOnAzurePipeline
214+
TrxExport = report
216215
}
217216
}
218217

219218
| ["test"] ->
220219
{
221220
parsed with CommandArguments = Test {
222221
TestFilter = None
223-
TrxExport = buildingOnAzurePipeline
224-
CodeCoverage = false
222+
TrxExport = report
225223
}
226224
}
227225
| ["test"; testFilter] ->
228226
{
229227
parsed with CommandArguments = Test {
230228
TestFilter = Some testFilter
231-
TrxExport = buildingOnAzurePipeline
232-
CodeCoverage = false
229+
TrxExport = report
233230
}
234231
}
235232

@@ -253,14 +250,14 @@ Execution hints can be provided anywhere on the command line
253250
| ["integrate"; esVersions] ->
254251
{
255252
parsed with CommandArguments = Integration {
256-
TrxExport = buildingOnAzurePipeline
253+
TrxExport = report
257254
ElasticsearchVersions = split esVersions; ClusterFilter = None; TestFilter = None
258255
}
259256
}
260257
| ["integrate"; esVersions; clusterFilter] ->
261258
{
262259
parsed with CommandArguments = Integration {
263-
TrxExport = buildingOnAzurePipeline
260+
TrxExport = report
264261
ElasticsearchVersions = split esVersions;
265262
ClusterFilter = Some clusterFilter;
266263
TestFilter = None
@@ -269,7 +266,7 @@ Execution hints can be provided anywhere on the command line
269266
| ["integrate"; esVersions; clusterFilter; testFilter] ->
270267
{
271268
parsed with CommandArguments = Integration {
272-
TrxExport = buildingOnAzurePipeline
269+
TrxExport = report
273270
ElasticsearchVersions = split esVersions;
274271
ClusterFilter = Some clusterFilter
275272
TestFilter = Some testFilter

build/scripts/Targets.fs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ open System.IO
1010
open Bullseye
1111
open ProcNet
1212
open Fake.Core
13+
open Fake.IO.Globbing.Operators
1314

1415
module Main =
1516

@@ -60,11 +61,10 @@ module Main =
6061
let canaryChain = [ "version"; "release"; "test-nuget-package";]
6162

6263
// the following are expected to be called as targets directly
63-
conditional "clean" parsed.ReleaseBuild <| fun _ -> Build.Clean parsed
64+
conditional "clean" (parsed.ReleaseBuild || parsed.Target = "clean") <| fun _ -> Build.Clean parsed
6465
target "version" <| fun _ -> printfn "Artifacts Version: %O" artifactsVersion
6566

66-
target "restore" Build.Restore
67-
67+
target "restore" Build.Restore
6868
target "full-build" <| fun _ -> Build.Compile parsed artifactsVersion
6969

7070
//TEST
@@ -79,7 +79,7 @@ module Main =
7979

8080
target "nuget-pack" <| fun _ -> Build.Pack artifactsVersion
8181

82-
conditional "nuget-pack-versioned" (isCanary && Environment.isWindows) <| fun _ -> Build.VersionedPack artifactsVersion
82+
conditional "nuget-pack-versioned" (isCanary) <| fun _ -> Build.VersionedPack artifactsVersion
8383

8484
conditional "generate-release-notes" (not isCanary) <| fun _ -> ReleaseNotes.GenerateNotes buildVersions
8585

@@ -93,16 +93,16 @@ module Main =
9393
printfn "Finished Release Build %O, artifacts available at: %s" artifactsVersion Paths.BuildOutput
9494
| Some path ->
9595
Fake.IO.Shell.cp_r Paths.BuildOutput path
96+
let zipName = sprintf "elasticsearch-net-%O.zip" artifactsVersion.Full
97+
let outputZip = Path.Combine(path, zipName)
98+
let files = !! (sprintf "%s/*.*" path) -- outputZip
99+
Fake.IO.Zip.createZip "." outputZip "elastic/elasticsearch-net artifact" 9 true files
96100
printfn "Finished Release Build %O, output copied to: %s" artifactsVersion path
97101

98-
conditional "test-nuget-package" (not parsed.SkipTests && Environment.isWindows) <| fun _ ->
99-
// run release unit tests puts packages in the system cache prevent this from happening locally
100-
if not Commandline.runningOnCi then ignore ()
101-
else Tests.RunReleaseUnitTests artifactsVersion parsed |> ignore
102-
102+
conditional "test-nuget-package" (not parsed.SkipTests) <| fun _ -> Tests.RunReleaseUnitTests artifactsVersion parsed
103+
103104
//CANARY
104-
command "canary" canaryChain <| fun _ ->
105-
printfn "Finished Release Build %O" artifactsVersion
105+
command "canary" canaryChain <| fun _ -> printfn "Finished Release Build %O" artifactsVersion
106106

107107
// ADDITIONAL COMMANDS
108108

build/scripts/Testing.fs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,23 @@ module Tests =
4141
let runSettings =
4242
// force the logger section to be cleared so that azure devops can work its magic.
4343
// relies heavily on the original console logger
44-
let prefix = if runningOnAzureDevops then ".ci" else ""
44+
let wants = match args.CommandArguments with | Integration a -> a.TrxExport | Test t -> t.TrxExport | _ -> false
45+
let prefix = if wants then ".ci" else ""
4546
sprintf "tests/%s.runsettings" prefix
4647

4748
Directory.CreateDirectory Paths.BuildOutput |> ignore
4849
let command = ["test"; proj; "--nologo"; "-c"; "Release"; "-s"; runSettings; "--no-build"]
4950

5051
let wantsTrx =
5152
let wants = match args.CommandArguments with | Integration a -> a.TrxExport | Test t -> t.TrxExport | _ -> false
52-
match wants with | true -> ["--logger"; "trx"] | false -> []
53-
let wantsCoverage =
54-
let wants = match args.CommandArguments with | Test t -> t.CodeCoverage | _ -> false
55-
match wants with | true -> ["--collect:\"XPlat Code Coverage\""] | false -> []
53+
let junitOutput = Path.GetFullPath <| Path.Combine(Paths.BuildOutput, "junit-{assembly}-{framework}-test-results.xml")
54+
let loggerPathArgs = sprintf "LogFilePath=%s" junitOutput
55+
let loggerArg = sprintf "--logger:\"junit;%s\"" loggerPathArgs
56+
match wants with | true -> [loggerArg] | false -> []
5657

57-
let commandWithAdditionalOptions =
58-
wantsCoverage |> List.append wantsTrx |> List.append command
58+
let commandWithAdditionalOptions = wantsTrx |> List.append command
5959

60-
Tooling.DotNet.ExecInWithTimeout "." commandWithAdditionalOptions (TimeSpan.FromMinutes 60.)
60+
Tooling.DotNet.ExecInWithTimeout "." commandWithAdditionalOptions (TimeSpan.FromMinutes 30.)
6161

6262
let RunReleaseUnitTests version args =
6363
//xUnit always does its own build, this env var is picked up by Tests.csproj
@@ -70,7 +70,8 @@ module Tests =
7070
//package and not one from cache...y
7171
Environment.setEnvironVar "TestPackageVersion" (version.Full.ToString())
7272
Tooling.DotNet.ExecIn "tests/Tests" ["clean";] |> ignore
73-
Tooling.DotNet.ExecIn "tests/Tests" ["restore";] |> ignore
73+
// needs forced eval because it picks up local nuget packages not part of package.lock.json
74+
Tooling.DotNet.ExecIn "tests/Tests" ["restore"; "--force-evaluate"] |> ignore
7475
dotnetTest "tests/Tests/Tests.csproj" args
7576

7677
let RunUnitTests args =

build/scripts/Tooling.fs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ module Tooling =
3838
let startArgs = ExecArguments(bin, args |> List.toArray)
3939
if (Option.isSome workinDir) then
4040
startArgs.WorkingDirectory <- Option.defaultValue "" workinDir
41+
let options = args |> String.concat " "
42+
printfn ":: Running command: %s %s" bin options
4143
let result = Proc.Exec(startArgs, timeout)
4244
try
4345
if not result.HasValue || result.Value > 0 then

build/scripts/packages.lock.json

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
},
1111
"Elastic.Elasticsearch.Managed": {
1212
"type": "Direct",
13-
"requested": "[0.2.5, )",
14-
"resolved": "0.2.5",
15-
"contentHash": "LhsYu04GBS2WydeGpIMDoEbZqCnQCk0BrLTRgorCEp/bpooxdR4A8XYKEIuHFlUK6rtqabMiZRd56/JCWktepw==",
13+
"requested": "[0.2.6, )",
14+
"resolved": "0.2.6",
15+
"contentHash": "JvAFjwwQ7lsPHA3AfDoKgwxs40gd8NrU9troMpKuqW5Ah9vi30wq6AzSYc6fXJ7g3KL9P2gLRyc8XnMjxJj2iw==",
1616
"dependencies": {
17-
"Elastic.Stack.ArtifactsApi": "0.2.5",
17+
"Elastic.Stack.ArtifactsApi": "0.2.6",
1818
"Proc": "0.6.1",
1919
"System.Net.Http": "4.3.1"
2020
}
@@ -84,6 +84,12 @@
8484
"resolved": "5.0.0",
8585
"contentHash": "iHoYXA0VaSQUONGENB1aVafjDDZDZpwu39MtaRCTrmwFW/cTcK0b2yKNVYneFHJMc3ChtsSoM9lNtJ1dYXkHfA=="
8686
},
87+
"Microsoft.NETFramework.ReferenceAssemblies": {
88+
"type": "Direct",
89+
"requested": "[1.0.0-preview.2, )",
90+
"resolved": "1.0.0-preview.2",
91+
"contentHash": "m+pJPEO7HyXvrOna5Sr3s77ewXonjYWJTNL6drh8xACnMNxnlqUDKx9HfGeSE9wmfY0lQwppaeZpFTPGaH7kZg=="
92+
},
8793
"Newtonsoft.Json": {
8894
"type": "Direct",
8995
"requested": "[12.0.1, )",
@@ -111,8 +117,8 @@
111117
},
112118
"Elastic.Stack.ArtifactsApi": {
113119
"type": "Transitive",
114-
"resolved": "0.2.5",
115-
"contentHash": "E3kLvad48eROrhryEbw7uZHVzctrkZk3i3D8d1kDc5WSFzo8AMaFGxv3+PwqKl141fPIKpDl4iF/ybd7bl61xg==",
120+
"resolved": "0.2.6",
121+
"contentHash": "3ewZWhWQcQLCu/vAifxbKNCr+h1eXTyNcS7FqAJ2wupaZZ0yjsNf+YGHcOFI7P+hEByYW9kIyEFoOTUwa0/oaQ==",
116122
"dependencies": {
117123
"SemanticVersioning": "0.8.0",
118124
"System.Text.Json": "4.6.0"

build/scripts/scripts.fsproj

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,14 @@
2222
<ItemGroup>
2323
<Content Include="..\..\build.sh"><Link>build.sh</Link></Content>
2424
<Content Include="..\..\build.bat"><Link>build.bat</Link></Content>
25-
<Content Include="..\..\appveyor.yml"><Link>appveyor.yml</Link></Content>
26-
<Content Include="..\..\azure-pipelines.yml"><Link>azure-pipelines.yml</Link></Content>
27-
<Content Include="..\..\.github\workflows\auto-label.yml">
28-
<Link>auto-label.yml</Link>
29-
</Content>
30-
<Content Include="..\..\.github\workflows\backport.yml">
31-
<Link>backport.yml</Link>
32-
</Content>
33-
<Content Include="..\..\.github\auto-label.json">
34-
<Link>auto-label.json</Link>
25+
<Content Include="..\..\.github\workflows\auto-label.yml"><Link>auto-label.yml</Link></Content>
26+
<Content Include="..\..\.github\workflows\backport.yml"><Link>backport.yml</Link></Content>
27+
<Content Include="..\..\.github\auto-label.json"><Link>auto-label.json</Link></Content>
28+
<Content Include="..\..\.github\workflows\test-jobs.yml"><Link>test-jobs.yml</Link></Content>
29+
<Content Include="..\..\.github\workflows\stale-jobs.yml"><Link>stale-jobs.yml</Link></Content>
30+
<Content Include="..\..\.github\workflows\integration-jobs.yml"><Link>integration-jobs.yml</Link></Content>
31+
<Content Include="..\..\.github\workflows\unified-release.yml">
32+
<Link>unified-release.yml</Link>
3533
</Content>
3634
<Content Include="..\..\.github\workflows\make-codegen.yml">
3735
<Link>make-codegen.yml</Link>
@@ -41,7 +39,7 @@
4139
<PackageReference Include="FSharp.Core" Version="5.0.0" />
4240

4341
<PackageReference Include="Bullseye" Version="3.3.0" />
44-
<PackageReference Include="Elastic.Elasticsearch.Managed" Version="0.2.5" />
42+
<PackageReference Include="Elastic.Elasticsearch.Managed" Version="0.2.6" />
4543

4644
<PackageReference Include="Fake.Core.Environment" Version="5.15.0" />
4745
<PackageReference Include="Fake.Core.SemVer" Version="5.15.0" />

0 commit comments

Comments
 (0)