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

Verify feature usage in REST tests #106800

Merged
merged 10 commits into from
Mar 28, 2024

Conversation

mosche
Copy link
Contributor

@mosche mosche commented Mar 27, 2024

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.

ldematte and others added 6 commits January 11, 2024 12:47
@mosche mosche added >test Issues or PRs that are addressing/adding tests :Core/Infra/Core Core issues without another label Team:Core/Infra Meta label for core/infra team labels Mar 27, 2024
@mosche mosche requested review from ldematte and a team March 27, 2024 08:45
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

@mosche
Copy link
Contributor Author

mosche commented Mar 27, 2024

@elasticmachine test this please

Copy link
Contributor

@ldematte ldematte left a 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

@mosche
Copy link
Contributor Author

mosche commented Mar 27, 2024

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());
Copy link
Contributor Author

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?

Copy link
Contributor

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)

@mosche
Copy link
Contributor Author

mosche commented Mar 28, 2024

@elasticmachine update branch

Copy link
Contributor

@ldematte ldematte left a 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)

@mosche mosche merged commit c7a35a4 into elastic:main Mar 28, 2024
14 checks passed
@mosche mosche deleted the feature-names-metadata-extractor branch March 28, 2024 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Core Core issues without another label Team:Core/Infra Meta label for core/infra team >test Issues or PRs that are addressing/adding tests v8.14.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants