-
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
[APM] Convert unit tests using mockApmEventClient
to API tests
#152557
Comments
Pinging @elastic/apm-ui (Team:APM) |
We can simply remove the Unit Test for
The API tests for these were added as part of this PR |
@achyutjhunjhunwala Sounds good! Will you remove and update this issue? Thanks! |
After further analysing, i can confirm that we can remove the Unit Tests for
PR can be found here. Regarding the Units Test for |
## Summary Removes redundant Unit Tests and Snapshots. As part of the list mentioned here #152557 (comment), the getEnvironment logic now has its own API tests and hence we can remove these unit tests. API tests were added as part of this [PR](https://github.com/elastic/kibana/pull/150175/files#diff-00aefdb700a89f09360583a1a951083746eb2243e0607de9ab6bc81826a7adaf) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
## Summary Removes redundant Unit Tests and Snapshots. As part of the list mentioned here elastic#152557 (comment), the getEnvironment logic now has its own API tests and hence we can remove these unit tests. API tests were added as part of this [PR](https://github.com/elastic/kibana/pull/150175/files#diff-00aefdb700a89f09360583a1a951083746eb2243e0607de9ab6bc81826a7adaf) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
In the past we didn't have API test so on the server we'd mock out Elasticsearch using
mockApmEventClient
. This way we could at test the data transformation happening after the ES call. The downside of this is of course that any changes to the actual ES query will go completely unnoticed.Today we have a solid API test suite so we should convert unit tests that mocks out the ES request. This is easy to find. Simply search for
mockApmEventClient
. The only exception I found waslib/helpers/transactions/get_is_using_transaction_events.test.ts
which might be a valid use case to keep as a unit testThe following unit tests could be converted to API tests:
server/routes/environments/get_environments.test.tsThe text was updated successfully, but these errors were encountered: