Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@
import org.elasticsearch.common.geo.GeoPoint;
import org.elasticsearch.common.unit.DistanceUnit;
import org.elasticsearch.script.ScoreScriptUtils;
import org.elasticsearch.xpack.esql.action.EsqlCapabilities;
import org.elasticsearch.xpack.esql.core.expression.Expression;
import org.elasticsearch.xpack.esql.core.expression.Literal;
import org.elasticsearch.xpack.esql.core.expression.MapExpression;
import org.elasticsearch.xpack.esql.core.tree.Source;
import org.elasticsearch.xpack.esql.core.type.DataType;
import org.elasticsearch.xpack.esql.expression.function.AbstractScalarFunctionTestCase;
import org.elasticsearch.xpack.esql.expression.function.TestCaseSupplier;
import org.junit.BeforeClass;

import java.time.Duration;
import java.time.Instant;
Expand All @@ -44,6 +46,11 @@ public DecayTests(@Name("TestCase") Supplier<TestCaseSupplier.TestCase> testCase
this.testCase = testCaseSupplier.get();
}

@BeforeClass
public static void checkCapability() {
assumeTrue("Decay function tests require the DECAY_FUNCTION capability", EsqlCapabilities.Cap.DECAY_FUNCTION.isEnabled());
}

@ParametersFactory
public static Iterable<Object[]> parameters() {
List<TestCaseSupplier> testCaseSuppliers = new ArrayList<>();
Expand Down