ES|QL: Fix generative tests (#129717)

This commit is contained in:
Luigi Dell'Aquila 2025-06-19 18:13:26 +02:00 committed by GitHub
parent eeca493860
commit 0dba16384e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 13 deletions

View file

@ -562,9 +562,6 @@ tests:
- class: org.elasticsearch.search.query.VectorIT
method: testFilteredQueryStrategy
issue: https://github.com/elastic/elasticsearch/issues/129517
- class: org.elasticsearch.xpack.esql.qa.single_node.GenerativeIT
method: test
issue: https://github.com/elastic/elasticsearch/issues/129453
- class: org.elasticsearch.test.apmintegration.TracesApmIT
method: testApmIntegration
issue: https://github.com/elastic/elasticsearch/issues/129651

View file

@ -13,7 +13,6 @@ import org.elasticsearch.xpack.esql.qa.rest.generative.command.pipe.DissectGener
import org.elasticsearch.xpack.esql.qa.rest.generative.command.pipe.DropGenerator;
import org.elasticsearch.xpack.esql.qa.rest.generative.command.pipe.EnrichGenerator;
import org.elasticsearch.xpack.esql.qa.rest.generative.command.pipe.EvalGenerator;
import org.elasticsearch.xpack.esql.qa.rest.generative.command.pipe.ForkGenerator;
import org.elasticsearch.xpack.esql.qa.rest.generative.command.pipe.GrokGenerator;
import org.elasticsearch.xpack.esql.qa.rest.generative.command.pipe.KeepGenerator;
import org.elasticsearch.xpack.esql.qa.rest.generative.command.pipe.LimitGenerator;
@ -54,7 +53,8 @@ public class EsqlQueryGenerator {
DropGenerator.INSTANCE,
EnrichGenerator.INSTANCE,
EvalGenerator.INSTANCE,
ForkGenerator.INSTANCE,
// Awaits fix: https://github.com/elastic/elasticsearch/issues/129715
// ForkGenerator.INSTANCE,
GrokGenerator.INSTANCE,
KeepGenerator.INSTANCE,
LimitGenerator.INSTANCE,

View file

@ -42,15 +42,9 @@ public class LimitGenerator implements CommandGenerator {
List<List<Object>> output
) {
int limit = (int) commandDescription.context().get(LIMIT);
boolean defaultLimit = false;
for (CommandDescription previousCommand : previousCommands) {
if (previousCommand.commandName().equals(LIMIT)) {
defaultLimit = true;
}
}
if (previousOutput.size() > limit && output.size() != limit || defaultLimit && previousOutput.size() < output.size()) {
return new ValidationResult(false, "Expecting [" + limit + "] records, got [" + output.size() + "]");
if (output.size() > limit) {
return new ValidationResult(false, "Expecting at most [" + limit + "] records, got [" + output.size() + "]");
}
return CommandGenerator.expectSameColumns(previousColumns, columns);
}