Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update tests to ES 7.16.x, fix most warnings #332

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 2 additions & 15 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import com.github.mgk.gradle.*

buildscript {
ext {
es_version = version.replaceAll(/\.[0-9]+(|-.+)$/, "")
Expand Down Expand Up @@ -28,6 +26,7 @@ plugins {
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'elasticsearch.esplugin'
apply plugin: 'elasticsearch.yaml-rest-test'
apply plugin: 'elasticsearch.testclusters'

// Uncomment if you want to use: System.out.println("Emergency!");
Expand Down Expand Up @@ -72,7 +71,7 @@ dependencies {
implementation "org.elasticsearch:elasticsearch:${versions.elasticsearch}"
implementation "io.prometheus:simpleclient:${versions.prometheus}"
implementation "io.prometheus:simpleclient_common:${versions.prometheus}"
implementation "org.apache.logging.log4j:log4j-api:${versions.log4j}"
yamlRestTestRuntimeOnly "org.apache.logging.log4j:log4j-core:${versions.log4j}"
testImplementation (group: 'junit', name: 'junit', version: "${versions.junit}") {
exclude group:'org.hamcrest' //also included in ES test framework
}
Expand All @@ -93,18 +92,6 @@ esplugin {

testClusters.all {
numberOfNodes = 2

// There does not seem to be any easy way how to setup custom cluster name.

// This worked in ES 7.4.x, but now results in:
// A problem occurred evaluating root project 'prometheus-exporter'.
// > Cannot set the property 'clusterName' because the backing field is final.
// clusterName = "PrometheusExporterITCluster"

// This does not work in ES 7.5.x too:
// Execution failed for task ':integTestRunner'.
// > Testclusters does not allow the following settings to be changed:[cluster.name] for node{::integTest-0}
// setting 'cluster.name', 'PrometheusExporterITCluster'
}

checkstyle {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
import org.elasticsearch.ElasticsearchParseException;
import org.elasticsearch.action.admin.cluster.state.ClusterStateResponse;
import org.elasticsearch.cluster.metadata.Metadata;
import org.elasticsearch.core.Nullable;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.settings.ClusterSettings;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.SettingsException;
import org.elasticsearch.common.unit.RatioValue;
import org.elasticsearch.core.Nullable;

import java.io.IOException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
import org.elasticsearch.action.admin.cluster.state.ClusterStateResponse;
import org.elasticsearch.action.admin.indices.stats.IndicesStatsResponse;
import org.elasticsearch.action.admin.indices.stats.PackageAccessHelper;
import org.elasticsearch.core.Nullable;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.settings.ClusterSettings;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.core.Nullable;

import java.io.IOException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
import org.elasticsearch.action.support.HandledTransportAction;
import org.elasticsearch.client.Client;
import org.elasticsearch.client.Requests;
import org.elasticsearch.core.Nullable;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.ClusterSettings;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.core.Nullable;
import org.elasticsearch.tasks.Task;
import org.elasticsearch.transport.TransportService;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@
import org.elasticsearch.rest.*;
import org.elasticsearch.rest.action.RestResponseListener;

import java.util.List;
import java.util.Locale;

import static java.util.Arrays.asList;
import static java.util.Collections.unmodifiableList;

import java.util.List;
import java.util.Locale;

/**
* REST action class for Prometheus Exporter plugin.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"url":"https://github.com/vvanholl/elasticsearch-prometheus-exporter/"
},
"stability": "stable",
"visibility" : "public",
"url":{
"paths":[
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
\# \s HELP \s es_cluster_routing_allocation_disk_threshold_enabled (\s|\w|\d)+ \n
\# \s TYPE \s es_cluster_routing_allocation_disk_threshold_enabled \s gauge \n
es_cluster_routing_allocation_disk_threshold_enabled\{
cluster="integTest"
cluster="yamlRestTest"
\,} \s 1\.0 \n?
.*/

Expand Down Expand Up @@ -153,6 +153,6 @@
\# \s HELP \s es_cluster_routing_allocation_disk_threshold_enabled (\s|\w|\d)+ \n
\# \s TYPE \s es_cluster_routing_allocation_disk_threshold_enabled \s gauge \n
es_cluster_routing_allocation_disk_threshold_enabled\{
cluster="integTest"
cluster="yamlRestTest"
\,} \s 1\.0 \n?
.*/
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
- do:
index:
index: twitter
type: foo
id: 1
body: { foo: bar }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
- do:
index:
index: twitter
type: foo
id: 1
body: { foo: bar }

Expand All @@ -34,8 +33,8 @@
\# \s TYPE \s es_index_shards_number \s gauge \n
(
es_index_shards_number\{
cluster="integTest",
type="(active_primary|initializing|relocating|shards|active|unassigned)",
cluster="yamlRestTest",
type="(active_primary|delayed_unassigned|initializing|relocating|shards|active|unassigned)",
index="twitter"
,\} \s+ \d+\.\d+ \n?
){6}
Expand All @@ -47,7 +46,7 @@
\# \s HELP \s es_index_status (\s|\w|\d)+ \n
\# \s TYPE \s es_index_status \s gauge \n
es_index_status\{
cluster="integTest",index="twitter"
cluster="yamlRestTest",index="twitter"
\,} \s \d+\.\d+ \n?
.*/

Expand All @@ -57,7 +56,7 @@
\# \s HELP \s es_index_replicas_number (\s|\w|\d)+ \n
\# \s TYPE \s es_index_replicas_number \s gauge \n
es_index_replicas_number\{
cluster="integTest",index="twitter"
cluster="yamlRestTest",index="twitter"
,\} \s+ \d+\.\d+ \n?
.*/

Expand All @@ -77,7 +76,6 @@
- do:
index:
index: twitter
type: foo
id: 1
body: { foo: bar }

Expand All @@ -97,7 +95,7 @@
\# \s TYPE \s es_index_doc_number \s gauge \n
(
es_index_doc_number\{
cluster="integTest",index="twitter",context="(primaries|total)"
cluster="yamlRestTest",index="twitter",context="(primaries|total)"
,\} \s+ \d+\.\d+ \n?
){2}
.*/
Expand All @@ -109,7 +107,7 @@
\# \s TYPE \s es_index_doc_deleted_number \s gauge \n
(
es_index_doc_deleted_number\{
cluster="integTest",index="twitter",context="(primaries|total)"
cluster="yamlRestTest",index="twitter",context="(primaries|total)"
,\} \s+ \d+\.\d+ \n?
){2}
.*/
Expand All @@ -121,7 +119,7 @@
\# \s TYPE \s es_index_store_size_bytes \s gauge \n
(
es_index_store_size_bytes\{
cluster="integTest",index="twitter",context="(primaries|total)"
cluster="yamlRestTest",index="twitter",context="(primaries|total)"
,\} \s+ \d+\.\d+ \n?
){2}
.*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
- do:
index:
index: twitter
type: foo
id: 1
body: { foo: bar }

Expand All @@ -34,7 +33,7 @@
\# \s TYPE \s es_index_indexing_delete_count \s gauge \n
(
es_index_indexing_delete_count\{
cluster="integTest",index="twitter",context="(primaries|total)"
cluster="yamlRestTest",index="twitter",context="(primaries|total)"
,\} \s+ \d+\.\d+ \n?
){2}
.*/
Expand All @@ -46,7 +45,7 @@
\# \s TYPE \s es_index_indexing_delete_current_number \s gauge \n
(
es_index_indexing_delete_current_number\{
cluster="integTest",index="twitter",context="(primaries|total)"
cluster="yamlRestTest",index="twitter",context="(primaries|total)"
,\} \s+ \d+\.\d+ \n?
){2}
.*/
Expand All @@ -58,7 +57,7 @@
\# \s TYPE \s es_index_indexing_delete_time_seconds \s gauge \n
(
es_index_indexing_delete_time_seconds\{
cluster="integTest",index="twitter",context="(primaries|total)"
cluster="yamlRestTest",index="twitter",context="(primaries|total)"
,\} \s+ \d+\.\d+ \n?
){2}
.*/
Expand All @@ -70,7 +69,7 @@
\# \s TYPE \s es_index_indexing_index_count \s gauge \n
(
es_index_indexing_index_count\{
cluster="integTest",index="twitter",context="(primaries|total)"
cluster="yamlRestTest",index="twitter",context="(primaries|total)"
,\} \s+ \d+\.\d+ \n?
){2}
.*/
Expand All @@ -82,7 +81,7 @@
\# \s TYPE \s es_index_indexing_index_current_number \s gauge \n
(
es_index_indexing_index_current_number\{
cluster="integTest",index="twitter",context="(primaries|total)"
cluster="yamlRestTest",index="twitter",context="(primaries|total)"
,\} \s+ \d+\.\d+ \n?
){2}
.*/
Expand All @@ -94,7 +93,7 @@
\# \s TYPE \s es_index_indexing_index_failed_count \s gauge \n
(
es_index_indexing_index_failed_count\{
cluster="integTest",index="twitter",context="(primaries|total)"
cluster="yamlRestTest",index="twitter",context="(primaries|total)"
,\} \s+ \d+\.\d+ \n?
){2}
.*/
Expand All @@ -106,7 +105,7 @@
\# \s TYPE \s es_index_indexing_index_time_seconds \s gauge \n
(
es_index_indexing_index_time_seconds\{
cluster="integTest",index="twitter",context="(primaries|total)"
cluster="yamlRestTest",index="twitter",context="(primaries|total)"
,\} \s+ \d+\.\d+ \n?
){2}
.*/
Expand All @@ -118,7 +117,7 @@
\# \s TYPE \s es_index_indexing_noop_update_count \s gauge \n
(
es_index_indexing_noop_update_count\{
cluster="integTest",index="twitter",context="(primaries|total)"
cluster="yamlRestTest",index="twitter",context="(primaries|total)"
,\} \s+ \d+\.\d+ \n?
){2}
.*/
Expand All @@ -130,7 +129,7 @@
\# \s TYPE \s es_index_indexing_is_throttled_bool \s gauge \n
(
es_index_indexing_is_throttled_bool\{
cluster="integTest",index="twitter",context="(primaries|total)"
cluster="yamlRestTest",index="twitter",context="(primaries|total)"
,\} \s+ \d+\.\d+ \n?
){2}
.*/
Expand All @@ -142,7 +141,7 @@
\# \s TYPE \s es_index_indexing_throttle_time_seconds \s gauge \n
(
es_index_indexing_throttle_time_seconds\{
cluster="integTest",index="twitter",context="(primaries|total)"
cluster="yamlRestTest",index="twitter",context="(primaries|total)"
,\} \s+ \d+\.\d+ \n?
){2}
.*/
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
- do:
index:
index: twitter
type: foo
id: 1
body: { foo: bar }

Expand All @@ -34,7 +33,7 @@
\# \s TYPE \s es_index_get_count \s gauge \n
(
es_index_get_count\{
cluster="integTest",index="twitter",context="(primaries|total)"
cluster="yamlRestTest",index="twitter",context="(primaries|total)"
,\} \s+ \d+\.\d+ \n?
){2}
.*/
Expand All @@ -46,7 +45,7 @@
\# \s TYPE \s es_index_get_time_seconds \s gauge \n
(
es_index_get_time_seconds\{
cluster="integTest",index="twitter",context="(primaries|total)"
cluster="yamlRestTest",index="twitter",context="(primaries|total)"
,\} \s+ \d+\.\d+ \n?
){2}
.*/
Expand All @@ -58,7 +57,7 @@
\# \s TYPE \s es_index_get_exists_count \s gauge \n
(
es_index_get_exists_count\{
cluster="integTest",index="twitter",context="(primaries|total)"
cluster="yamlRestTest",index="twitter",context="(primaries|total)"
,\} \s+ \d+\.\d+ \n?
){2}
.*/
Expand All @@ -70,7 +69,7 @@
\# \s TYPE \s es_index_get_exists_time_seconds \s gauge \n
(
es_index_get_exists_time_seconds\{
cluster="integTest",index="twitter",context="(primaries|total)"
cluster="yamlRestTest",index="twitter",context="(primaries|total)"
,\} \s+ \d+\.\d+ \n?
){2}
.*/
Expand All @@ -82,7 +81,7 @@
\# \s TYPE \s es_index_get_missing_count \s gauge \n
(
es_index_get_missing_count\{
cluster="integTest",index="twitter",context="(primaries|total)"
cluster="yamlRestTest",index="twitter",context="(primaries|total)"
,\} \s+ \d+\.\d+ \n?
){2}
.*/
Expand All @@ -94,7 +93,7 @@
\# \s TYPE \s es_index_get_missing_time_seconds \s gauge \n
(
es_index_get_missing_time_seconds\{
cluster="integTest",index="twitter",context="(primaries|total)"
cluster="yamlRestTest",index="twitter",context="(primaries|total)"
,\} \s+ \d+\.\d+ \n?
){2}
.*/
Expand All @@ -106,7 +105,7 @@
\# \s TYPE \s es_index_get_current_number \s gauge \n
(
es_index_get_current_number\{
cluster="integTest",index="twitter",context="(primaries|total)"
cluster="yamlRestTest",index="twitter",context="(primaries|total)"
,\} \s+ \d+\.\d+ \n?
){2}
.*/
Loading