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

Add ignored_fields to test config #82

Merged
merged 3 commits into from
Nov 12, 2020
Merged

Conversation

mtojek
Copy link
Contributor

@mtojek mtojek commented Nov 10, 2020

Issue: elastic/elastic-package#169

This PR adds ignored_fields property definition to the test config.

@mtojek mtojek self-assigned this Nov 10, 2020
@elasticmachine
Copy link

elasticmachine commented Nov 10, 2020

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #82 updated]

  • Start Time: 2020-11-12T10:14:43.729+0000

  • Duration: 2 min 3 sec

Comment on lines 14 to 18
"ignored_fields": [
"foobar",
"world",
"hello"
]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I read through the use case for this PR: elastic/elastic-package#169. My understanding is that there will be some fields in the indexed documents that will have dynamic values - values whose value will be different each time the test is executed. However, these fields' values should still conform to a specific data type and shape.

So I would not recommend that we completely allow certain fields to be ignored. Instead, perhaps we can allow users to specify certain fields in the test config and specify a valid pattern for that field's value. So something like:

Suggested change
"ignored_fields": [
"foobar",
"world",
"hello"
]
"dynamic_fields": {
"foobar": ".*",
"a_numeric_field": "\\d+"
}

I'm not married to the name of this setting; just using dynamic_fields as a suggestion above.

This way we can allow for dynamic values for specific fields without completely ignoring them. WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

However, these fields' values should still conform to a specific data type and shape.

This is a good argument for dynamic fields.

Instead, perhaps we can allow users to specify certain fields in the test config and specify a valid pattern for that field's value.

We'll need to update the pipeline test runner to make the diff more smarter (consider regular expressions), but I think it's possible.

Copy link
Contributor

@ycombinator ycombinator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@mtojek mtojek merged commit 52a4b43 into elastic:master Nov 12, 2020
rw-access pushed a commit to rw-access/package-spec that referenced this pull request Mar 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants