[Enterprise Search] Added a test helper for Kea tests#100134
Closed
JasonStoltz wants to merge 8 commits intoelastic:masterfrom
Closed
[Enterprise Search] Added a test helper for Kea tests#100134JasonStoltz wants to merge 8 commits intoelastic:masterfrom
JasonStoltz wants to merge 8 commits intoelastic:masterfrom
Conversation
77b4441 to
ce7b2b1
Compare
c4e3006 to
c346668
Compare
Member
Author
|
@elasticmachine merge upstream |
Member
Author
|
@elasticmachine merge upstream |
Contributor
💛 Build succeeded, but was flaky
Test FailuresKibana Pipeline / general / X-Pack Accessibility Tests.x-pack/test/accessibility/apps/ml·ts.ml for user with full ML access with data loaded anomaly detection create single metric job pick fields stepStandard OutStack TraceMetrics [docs]Unknown metric groupsReferences to deprecated APIs
History
To update your PR or re-run it, just comment with: |
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a test helper to help with test assertions in Kea.
I think I've covered just about every edge case we'd have to consider. I could have missed something though, I only applied this to a subset of tests. If we like this, I'll go through and convert the rest of our tests.
In my opinion, this establishes a clear, repeatable pattern for testing Kea actions.
Pros:
Cons:
Examples
Typical
A regular action test assertion.
expectActionwill automaticallymountthe logic file for you with the values specified infromas the default values. It will assert that the values intohave changed.It will assert that ONLY those values have changed, so if values other than that have changed, then you will have an assertion error.
Ignore
By specifying a field name in
ignore, we can effectively say "We know this value may change, but it's not relevant to this test so just ignore it". Mostly useful for selectors.Keyed logic
The second param of
expectActionis props which will be used to mount the logic, which is required for keyed logics.You can also get reference to the logic instance as it is passed in the callback as the first and only param to the expectAction callback.
Connected logic values
In a situation where a logic uses a connected logic, and you want to default some values...
In the example above, we couldn't previously pass
schemato mount to default value. I've added support for that in this PR. It is actually an independent change from the test helper.Checklist
Delete any items that are not applicable to this PR.
For maintainers