Skip to content

Commit 57ea866

Browse files
committed
Skip tests when feature flag is disabled
1 parent a69a7a2 commit 57ea866

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

x-pack/plugin/otel-data/src/internalClusterTest/java/org/elasticsearch/action/otlp/OTLPMetricsIndexingIT.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ public void setUp() throws Exception {
119119
var templates = client().execute(GetComposableIndexTemplateAction.INSTANCE, getReq).actionGet().indexTemplates();
120120
assertThat(templates, not(anEmptyMap()));
121121
});
122+
assumeTrue("Requires otlp_metrics feature flag to be enabled", OTelPlugin.OTLP_METRICS_ENABLED);
122123
}
123124

124125
private int getHttpPort() {

x-pack/plugin/otel-data/src/main/java/org/elasticsearch/xpack/oteldata/OTelPlugin.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636

3737
public class OTelPlugin extends Plugin implements ActionPlugin {
3838

39+
public static final boolean OTLP_METRICS_ENABLED = new FeatureFlag("otlp_metrics").isEnabled();
40+
3941
// OTEL_DATA_REGISTRY_ENABLED controls enabling the index template registry.
4042
//
4143
// This setting will be ignored if the plugin is disabled.
@@ -46,7 +48,6 @@ public class OTelPlugin extends Plugin implements ActionPlugin {
4648
Setting.Property.Dynamic
4749
);
4850

49-
private static final boolean OTLP_METRICS_ENABLED = new FeatureFlag("otlp_metrics").isEnabled();
5051
private static final Logger logger = LogManager.getLogger(OTelPlugin.class);
5152

5253
private final SetOnce<OTelIndexTemplateRegistry> registry = new SetOnce<>();

0 commit comments

Comments
 (0)