Skip to content

Commit c300d6a

Browse files
Update YAML tests and SDK Docker image (#5296) (#5297)
- Updated Dockerfile with Debian certificates issue workaround listed at NuGet/Announcements#49 (comment) - Updated YAML tests to use updated version naming Co-authored-by: Steve Gordon <sgordon@hotmail.co.uk>
1 parent 730fee4 commit c300d6a

File tree

7 files changed

+15
-18
lines changed

7 files changed

+15
-18
lines changed

.ci/DockerFile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
ARG DOTNET_VERSION=5.0.100
2-
FROM mcr.microsoft.com/dotnet/sdk:${DOTNET_VERSION} AS elasticsearch-net-build
1+
ARG DOTNET_VERSION=5.0.102
2+
FROM mcr.microsoft.com/dotnet/sdk:${DOTNET_VERSION}-1 AS elasticsearch-net-build
33

44
WORKDIR /sln
55

6-
76
COPY ./*.sln ./nuget.config ./*.Build.props ./*.Build.targets ./
87

98
COPY ./dotnet-tools.json ./
@@ -32,5 +31,4 @@ RUN dotnet restore
3231
COPY . .
3332

3433
# making sure enough git info is available inside the container
35-
RUN git rev-parse HEAD .
36-
34+
RUN git rev-parse HEAD .

tests/Tests.YamlRunner/Models.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ open Microsoft.FSharp.Reflection
1313

1414
let private getName a = match FSharpValue.GetUnionFields(a, a.GetType()) with | (case, _) -> case.Name
1515

16-
type TestSuite = Oss | XPack
16+
type TestSuite = Free | Platinum
1717

1818
type YamlMap = Dictionary<Object,Object>
1919
type YamlValue = YamlDictionary of YamlMap | YamlString of string

tests/Tests.YamlRunner/OperationExecutor.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ type OperationExecutor(client:IElasticLowLevelClient) =
428428
|> Seq.filter (fun feature -> not (SupportedFeatures |> List.contains feature))
429429
|> Seq.toList
430430

431-
let noXPackButXPack = features.Contains(NoXPack) && op.Suite = XPack
431+
let noXPackButXPack = features.Contains(NoXPack) && op.Suite = Platinum
432432
match (unsupportedFeatures, noXPackButXPack) with
433433
| ([], false) -> NotSkipped op
434434
| ([], true) ->

tests/Tests.YamlRunner/Program.fs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ let private defaultEndpoint namedSuite =
4141
match (runningProxy, namedSuite) with
4242
| (true, _) -> "ipv4.fiddler"
4343
| _ -> "localhost"
44-
let https = match namedSuite with | XPack -> "s" | _ -> ""
44+
let https = match namedSuite with | Platinum -> "s" | _ -> ""
4545
sprintf "http%s://%s:9200" https host;
4646

4747
let private createClient endpoint namedSuite =
@@ -54,7 +54,7 @@ let private createClient endpoint namedSuite =
5454
let tokens = e.UserInfo.Split(':') |> Seq.toList
5555
match (tokens, namedSuite) with
5656
| ([username; password], _) -> uri, Some (username, password)
57-
| (_, XPack) -> uri, Some ("elastic", "changeme")
57+
| (_, Platinum) -> uri, Some ("elastic", "changeme")
5858
| _ -> uri, None
5959
let settings = new ConnectionConfiguration(uri)
6060
// proxy
@@ -70,7 +70,7 @@ let private createClient endpoint namedSuite =
7070
// certs
7171
let certSettings =
7272
match namedSuite with
73-
| XPack ->
73+
| Platinum ->
7474
authSettings.ServerCertificateValidationCallback(fun _ _ _ _ -> true)
7575
| _ -> authSettings
7676
ElasticLowLevelClient(certSettings)
@@ -107,7 +107,7 @@ let validateRevisionParams endpoint _passedRevision namedSuite =
107107

108108
let runMain (parsed:ParseResults<Arguments>) = async {
109109

110-
let namedSuite = parsed.TryGetResult NamedSuite |> Option.defaultValue Oss
110+
let namedSuite = parsed.TryGetResult NamedSuite |> Option.defaultValue Free
111111
let directory = parsed.TryGetResult Folder //|> Option.defaultValue "indices.create" |> Some
112112
let file = parsed.TryGetResult TestFile //|> Option.defaultValue "10_basic.yml" |> Some
113113
let section = parsed.TryGetResult TestSection //|> Option.defaultValue "10_basic.yml" |> Some

tests/Tests.YamlRunner/TestSuiteBootstrap.fs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ module Tests.YamlRunner.TestSuiteBootstrap
66

77
open System
88
open System.Linq
9-
109
open Elasticsearch.Net
1110
open Elasticsearch.Net.Specification.CatApi
1211
open Elasticsearch.Net.Specification.ClusterApi
@@ -42,7 +41,7 @@ let DefaultSetup : Operation list = [Actions("Setup", fun (client, suite) ->
4241
|> Seq.toList
4342

4443
match suite with
45-
| Oss ->
44+
| Free ->
4645
let snapshots =
4746
client.Cat.Snapshots<StringResponse>(CatSnapshotsRequestParameters(Headers=["id,repository"].ToArray()))
4847
.Body.Split("\n")
@@ -57,7 +56,7 @@ let DefaultSetup : Operation list = [Actions("Setup", fun (client, suite) ->
5756
let deleteRepositories = client.Snapshot.DeleteRepository<DynamicResponse>("*")
5857
firstFailure <| [deleteAll()] @ templates() @ snapshots @ [deleteRepositories]
5958

60-
| XPack ->
59+
| Platinum ->
6160
firstFailure <| seq {
6261
//delete all templates
6362

tests/Tests.YamlRunner/TestsDownloader.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ let private openSourceResourcePath = "rest-api-spec/src/main/resources"
1717
let private xpackResourcesPath = "x-pack/plugin/src/test/resources"
1818

1919
let private path namedSuite revision =
20-
let path = match namedSuite with | Oss -> openSourceResourcePath | XPack -> xpackResourcesPath
20+
let path = match namedSuite with | Free -> openSourceResourcePath | Platinum -> xpackResourcesPath
2121
sprintf "%s/%s/rest-api-spec/test" revision path
2222

2323
let TestGithubRootUrl namedSuite revision = sprintf "%s/tree/%s" rootListingUrl <| path namedSuite revision
@@ -40,7 +40,7 @@ let private download url = async {
4040
return yaml
4141
}
4242
let CachedOrDownload namedSuite revision folder file url = async {
43-
let suite = match namedSuite with | Oss -> "oss" | XPack -> "xpack"
43+
let suite = match namedSuite with | Free -> "free" | Platinum -> "platinum"
4444
let parent = (TemporaryPath revision suite).Force()
4545
let directory = Path.Combine(parent, folder)
4646
let file = Path.Combine(directory, file)

tests/Tests.YamlRunner/TestsRunner.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ type TestRunner(client:IElasticLowLevelClient, version: string, suite: TestSuite
141141

142142
member this.GlobalSetup () =
143143
match suite with
144-
| Oss -> ignore()
145-
| XPack ->
144+
| Free -> ignore()
145+
| Platinum ->
146146
let data = PostData.String @"{""password"":""x-pack-test-password"", ""roles"":[""superuser""]}"
147147
let r = client.Security.PutUser<DynamicResponse>("x_pack_rest_user", data)
148148
let userCreated = r.Success

0 commit comments

Comments
 (0)