Skip to content

Add ignored_fields to test config#82

Merged
mtojek merged 3 commits intoelastic:masterfrom
mtojek:169-ignored-fields
Nov 12, 2020
Merged

Add ignored_fields to test config#82
mtojek merged 3 commits intoelastic:masterfrom
mtojek:169-ignored-fields

Conversation

@mtojek
Copy link
Copy Markdown
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 requested a review from ycombinator November 10, 2020 15:41
@mtojek mtojek self-assigned this Nov 10, 2020
@elasticmachine
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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.

@mtojek mtojek requested a review from ycombinator November 12, 2020 10:14
Copy link
Copy Markdown
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