From 1873b44f4e0fdab3904f9812e1297e04418d6e15 Mon Sep 17 00:00:00 2001 From: Steve Gordon Date: Tue, 27 Apr 2021 10:14:07 +0100 Subject: [PATCH] Skip on <7.13.0 and run in intrusive operation cluster --- .../ClientConcepts/Connection/HttpConnectionTests.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/Tests/ClientConcepts/Connection/HttpConnectionTests.cs b/tests/Tests/ClientConcepts/Connection/HttpConnectionTests.cs index 5ff5c864b42..542b439b557 100644 --- a/tests/Tests/ClientConcepts/Connection/HttpConnectionTests.cs +++ b/tests/Tests/ClientConcepts/Connection/HttpConnectionTests.cs @@ -31,6 +31,7 @@ using HttpMethod = Elasticsearch.Net.HttpMethod; using FluentAssertions; using System.Text.RegularExpressions; +using Tests.Core.Xunit; using Environment = System.Environment; namespace Tests.ClientConcepts.Connection @@ -348,11 +349,13 @@ protected override async Task SendAsync(HttpRequestMessage } } - public class HttpConnectionEnvironmentalTests : ClusterTestClassBase, IDisposable + // using IntrusiveOperationCluster to avoid affecting other tests with the ENV VAR + [SkipVersion("<7.13.0", "Setting only valid in 7.13.0+")] + public class HttpConnectionEnvironmentalTests : ClusterTestClassBase, IDisposable { private readonly string _previousEnvironmentVariable; - public HttpConnectionEnvironmentalTests(ReadOnlyCluster cluster) : base(cluster) => + public HttpConnectionEnvironmentalTests(IntrusiveOperationCluster cluster) : base(cluster) => _previousEnvironmentVariable = Environment.GetEnvironmentVariable(ConnectionConfiguration.ApiVersioningEnvironmentVariableName); [I] @@ -366,7 +369,6 @@ public async Task HttpClientSetsApiVersioningHeaderWhenEnabledAsTrue() responseMessage.RequestMessage.Content.Headers.ContentType.Should().NotBeNull(); var contentType = responseMessage.RequestMessage.Content.Headers.ContentType.ToString(); contentType.Should().Contain("compatible-with"); - }); var r = connection.Request(requestData);