Skip to content

Commit 3da50b6

Browse files
authored
Fix/7.x/snapshot test bundled jdk (#3990)
* Update abstractions to version that prints JAVA_HOME just before starting elasticsearch and forces it on the Process instance (cherry picked from commit ee496ad) * update abstractions (cherry picked from commit 2b409ff) * update to abstraction versions that takes prereleases into account again with SkipVersion * Audit trail test assumed timespan is never TimeSpan.Zero but of course can be (#3989) (cherry picked from commit 79a71ac) * Rename SkipOnTeamCity to skip on CI * skip xpack usage/info on CI, tad flakey due to elastic/elasticsearch#45250
1 parent 79a71ac commit 3da50b6

File tree

16 files changed

+50
-14
lines changed

16 files changed

+50
-14
lines changed

build/scripts/scripts.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
</PropertyGroup>
7070
<ItemGroup>
7171
<PackageReference Include="Bullseye" Version="2.4.0-rc.2" />
72-
<PackageReference Include="Elastic.Managed" Version="0.1.0-ci20190724T022011" />
72+
<PackageReference Include="Elastic.Managed" Version="0.1.0-ci20190806T115008" />
7373
<PackageReference Include="Fake.Core.Environment" Version="5.15.0" />
7474
<PackageReference Include="Fake.Core.SemVer" Version="5.15.0" />
7575
<PackageReference Include="Fake.IO.FileSystem" Version="5.15.0" />

src/Tests/Tests.Benchmarking/Tests.Benchmarking.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</ItemGroup>
1414
<ItemGroup>
1515
<PackageReference Include="BenchmarkDotNet" Version="0.11.5" />
16-
<PackageReference Include="Elastic.BenchmarkDotNetExporter" Version="0.1.0-ci20190724T022011" />
16+
<PackageReference Include="Elastic.BenchmarkDotNetExporter" Version="0.1.0-ci20190806T115008" />
1717
<PackageReference Include="LibGit2Sharp" Version="0.26.0-preview-0062" />
1818
</ItemGroup>
1919
</Project>

src/Tests/Tests.Configuration/TestConfigurationBase.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ public abstract class TestConfigurationBase
1313
/// <summary> The Elasticsearch version to test against, defined for both unit and integration tests</summary>
1414
public string ElasticsearchVersion { get; protected set; }
1515

16+
public bool ElasticsearchVersionIsSnapshot => !string.IsNullOrWhiteSpace(ElasticsearchVersion)
17+
&& (ElasticsearchVersion.Contains("SNAPSHOT") || ElasticsearchVersion.Contains("latest"));
18+
1619
/// <summary> Force a reseed (bootstrap) of the cluster even if checks indicate bootstrap already ran </summary>
1720
public bool ForceReseed { get; protected set; }
1821

src/Tests/Tests.Configuration/tests.default.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ mode: i
99

1010
# the elasticsearch version that should be started
1111
# Can be a snapshot version of sonatype or "latest" to get the latest snapshot of sonatype
12-
elasticsearch_version: 7.0.0
12+
elasticsearch_version: latest-7
1313
# cluster filter allows you to only run the integration tests of a particular cluster (cluster suffix not needed)
1414
# cluster_filter:
1515
# whether we want to forcefully reseed on the node, if you are starting the tests with a node already running

src/Tests/Tests.Core/Tests.Core.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</ItemGroup>
1414
<ItemGroup>
1515
<ProjectReference Include="..\Tests.Domain\Tests.Domain.csproj" />
16-
<PackageReference Include="Elastic.Xunit" Version="0.1.0-ci20190724T022011" />
16+
<PackageReference Include="Elastic.Xunit" Version="0.1.0-ci20190806T115008" />
1717
<PackageReference Include="Proc" Version="0.6.1" />
1818
<PackageReference Include="xunit" Version="2.3.1" />
1919
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.1.1" />

src/Tests/Tests.Core/Xunit/SkipOnTeamCityAttribute.cs renamed to src/Tests/Tests.Core/Xunit/SkipOnCIAttribute.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33

44
namespace Tests.Core.Xunit
55
{
6-
public class SkipOnTeamCityAttribute : SkipTestAttributeBase
6+
public class SkipOnCiAttribute : SkipTestAttributeBase
77
{
88
public override string Reason { get; } = "Skip running this test on TeamCity, this is usually a sign this test is flakey?";
99

1010
public static bool RunningOnTeamCity => !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("TEAMCITY_VERSION"));
11-
public override bool Skip => RunningOnTeamCity;
11+
public static bool RunningOnAzureDevops => !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("TF_BUILD"));
12+
public static bool RunningOnAppVeyor => !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("APPVEYOR_BUILD_VERSION"));
13+
public override bool Skip => RunningOnTeamCity || RunningOnAppVeyor || RunningOnAzureDevops;
1214
}
1315
//
1416

src/Tests/Tests.Domain/Tests.Domain.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</ItemGroup>
1313
<ItemGroup>
1414
<PackageReference Include="Bogus" Version="22.1.2" />
15-
<PackageReference Include="Elastic.Managed" Version="0.1.0-ci20190724T022011" />
15+
<PackageReference Include="Elastic.Managed" Version="0.1.0-ci20190806T115008" />
1616
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
1717
<ProjectReference Include="..\Tests.Configuration\Tests.Configuration.csproj" />
1818
</ItemGroup>

src/Tests/Tests/Cat/CatFielddata/CatFielddataApiTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ protected override void ExpectResponse(CatResponse<CatFielddataRecord> response)
5252
// TODO investigate flakiness
5353
// build seed:64178 integrate 6.3.0 "readonly" "catfielddata"
5454
// fails on TeamCity but not locally, assuming the different PC sizes come into play
55-
if (SkipOnTeamCityAttribute.RunningOnTeamCity || _initialSearchResponse == null || _initialSearchResponse.Total <= 0)
55+
if (SkipOnCiAttribute.RunningOnTeamCity || _initialSearchResponse == null || _initialSearchResponse.Total <= 0)
5656
return;
5757

5858
response.Records.Should().NotBeEmpty();

src/Tests/Tests/Cluster/RootNodeInfo/RootNodeInfoApiTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ protected override void ExpectResponse(RootNodeInfoResponse response)
3737
response.Version.BuildDate.Should().BeAfter(default);
3838
response.Version.BuildFlavor.Should().NotBeNullOrWhiteSpace();
3939
response.Version.BuildHash.Should().NotBeNullOrWhiteSpace();
40-
response.Version.BuildSnapshot.Should().Be(TestConfiguration.Instance.ElasticsearchVersion.Contains("SNAPSHOT"));
40+
response.Version.BuildSnapshot.Should().Be(TestConfiguration.Instance.ElasticsearchVersionIsSnapshot);
4141
response.Version.BuildType.Should().NotBeNullOrWhiteSpace();
4242
response.Version.MinimumIndexCompatibilityVersion.Should().NotBeNullOrWhiteSpace();
4343
response.Version.MinimumWireCompatibilityVersion.Should().NotBeNullOrWhiteSpace();

src/Tests/Tests/Document/Multiple/BulkAll/BulkAllCancellationTokenApiTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class BulkAllCancellationTokenApiTests : BulkAllApiTestsBase
1313
{
1414
public BulkAllCancellationTokenApiTests(IntrusiveOperationCluster cluster) : base(cluster) { }
1515

16-
[I] [SkipOnTeamCity]
16+
[I] [SkipOnCi]
1717
public void CancelBulkAll()
1818
{
1919
var index = CreateIndexName();

0 commit comments

Comments
 (0)