-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Verify feature usage in REST tests #106800
Verify feature usage in REST tests #106800
Conversation
Plus, fix logic to detect if a feature is "off" or "non-existing" (wrong, non-existing id). This works only for non-legacy tests, otherwise we log a warning and skip the check.
Pinging @elastic/es-core-infra (Team:Core/Infra) |
@elasticmachine test this please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments, mostly nit but one that should be addressed
test/framework/src/main/java/org/elasticsearch/test/rest/ESRestTestFeatureService.java
Show resolved
Hide resolved
test/framework/src/main/java/org/elasticsearch/test/rest/ESRestTestFeatureService.java
Show resolved
Hide resolved
test/framework/src/main/java/org/elasticsearch/test/rest/ESRestTestFeatureService.java
Outdated
Show resolved
Hide resolved
test/framework/src/main/java/org/elasticsearch/test/rest/ESRestTestFeatureService.java
Show resolved
Hide resolved
...test/java/org/elasticsearch/extractor/features/HistoricalFeaturesMetadataExtractorTests.java
Outdated
Show resolved
Hide resolved
Still looking into the ESQL test failures, but this is already proving valuable. First case of a misspelled feature: - cluster_features: esql.value_agg
+ cluster_features: esql.agg_values
reason: "values is available in 8.14+" |
@@ -364,22 +361,16 @@ protected final TestFeatureService createTestFeatureService( | |||
Map<String, Set<String>> clusterStateFeatures, | |||
Set<Version> semanticNodeVersions | |||
) { | |||
// Historical features information is unavailable when using legacy test plugins | |||
boolean hasHistoricalFeaturesInformation = System.getProperty("tests.features.metadata.path") != null; | |||
|
|||
final List<FeatureSpecification> featureSpecifications = new ArrayList<>(createAdditionalFeatureSpecifications()); | |||
featureSpecifications.add(new RestTestLegacyFeatures()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ldematte Do you know if there's a reason why RestTestLegacyFeatures
aren't provided via createAdditionalFeatureSpecifications
as done for YamlTestLegacyFeatures
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very simple: RestTestLegacyFeatures predates createAdditionalFeatureSpecifications.
If you feel like it, you can refactor it (but it's very minor IMO)
@elasticmachine update branch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. The only minor comment still open can be addressed or not, up to you.
(provided CI passes, but the current failure seems unrelated)
Particularly in YAML Rest tests it's easy to misspell feature names causing a test to never run and actually look healthy.
This change picks up earlier work (#104257) of @ldematte to fail if a feature is unknown based on the very latest features extracted from code.