-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Enterprise Search] Added a test helper for Kea tests #100134
Closed
Closed
Conversation
This file contains 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
JasonStoltz
force-pushed
the
test-helper-3
branch
from
May 14, 2021 16:14
77b4441
to
ce7b2b1
Compare
JasonStoltz
changed the title
Test helper 3
[Enterprise Search] Added a test helper for Kea tests
May 14, 2021
JasonStoltz
force-pushed
the
test-helper-3
branch
from
May 14, 2021 17:15
c4e3006
to
c346668
Compare
JasonStoltz
added
v7.14.0
auto-backport
Deprecated - use backport:version if exact versions are needed
release_note:skip
Skip the PR/issue when compiling release notes
labels
May 14, 2021
@elasticmachine merge upstream |
@elasticmachine merge upstream |
💛 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 Out
Stack Trace
Metrics [docs]Unknown metric groupsReferences to deprecated APIs
History
To update your PR or re-run it, just comment with: |
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
auto-backport
Deprecated - use backport:version if exact versions are needed
release_note:skip
Skip the PR/issue when compiling release notes
v7.14.0
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.
expectAction
will automaticallymount
the logic file for you with the values specified infrom
as the default values. It will assert that the values into
have 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
expectAction
is 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
schema
to 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