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

[Enterprise Search] Test coverage pass #103406

Merged
merged 5 commits into from Jun 28, 2021
Merged

Conversation

cee-chen
Copy link
Member

@cee-chen cee-chen commented Jun 25, 2021

Summary

Addresses a few remaining uncovered lines when running sh jest.sh on our plugin. Follow along by commit and read the full commit messages - I should have explained the rationale for every change there.

(Note to self: I think this will need a manual backport since Crawler domain stuff isn't yet on the 7.x branch)

Before

After

BTW - here's our total tests stats plugin-wide! WOW, y'all.

Checklist

Note:  some test helpers are no longer being used but might be some day - e.g., shallowWithIntl will be used on the beta badge
- since we're not iterating over productNames, no need for it to be an array - it can be written more clearly in string union format
@cee-chen cee-chen added release_note:skip Skip the PR/issue when compiling release notes v7.14.0 auto-backport Deprecated: Automatically backport this PR after it's merged labels Jun 25, 2021
@cee-chen cee-chen requested review from a team as code owners June 25, 2021 19:50
- Since KibanaLogic is setting `|| {}` fallbacks in any case, I've opted to remove them in this file and let fallbacks be handled there

- Fixed typing to make it clear plugins can be undefined (i.e., disabled/optional, etc) in props + reorganize w/ comments

- KibanaValues requires an Omit to override props types
- Fix test failing locally due to timezones by increasing the timezone offset

- Cover missing branch line by adding a domain with no `lastCrawl`

- Remove unnecessary extra beforeEach with dupe re-shallow/mounts

- move getTable helper to its most relevant block (it's not being used in the generic column content checks, only in the actions column suite)
Copy link
Contributor

@byronhulcher byronhulcher left a comment

Choose a reason for hiding this comment

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

lgtm

@cee-chen
Copy link
Member Author

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
enterpriseSearch 2.1MB 2.1MB -8.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@cee-chen cee-chen merged commit 45dfaac into elastic:master Jun 28, 2021
@cee-chen cee-chen deleted the test-coverage branch June 28, 2021 04:45
@kibanamachine
Copy link
Contributor

💔 Backport failed

Status Branch Result
7.x Commit could not be cherrypicked due to conflicts

To backport manually run:
node scripts/backport --pr 103406

cee-chen pushed a commit to cee-chen/kibana that referenced this pull request Jun 28, 2021
* Do not collect code coverage on test_helpers

Note:  some test helpers are no longer being used but might be some day - e.g., shallowWithIntl will be used on the beta badge

* Fix uncovered type line

- since we're not iterating over productNames, no need for it to be an array - it can be written more clearly in string union format

* Fix branch coverage on index.tsx

- Since KibanaLogic is setting `|| {}` fallbacks in any case, I've opted to remove them in this file and let fallbacks be handled there

- Fixed typing to make it clear plugins can be undefined (i.e., disabled/optional, etc) in props + reorganize w/ comments

- KibanaValues requires an Omit to override props types

* Crawler DomainsTable test coverage/improvements

- Fix test failing locally due to timezones by increasing the timezone offset

- Cover missing branch line by adding a domain with no `lastCrawl`

- Remove unnecessary extra beforeEach with dupe re-shallow/mounts

- move getTable helper to its most relevant block (it's not being used in the generic column content checks, only in the actions column suite)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
# Conflicts:
#	x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/domains_table.test.tsx
cee-chen pushed a commit that referenced this pull request Jun 28, 2021
* Do not collect code coverage on test_helpers

Note:  some test helpers are no longer being used but might be some day - e.g., shallowWithIntl will be used on the beta badge

* Fix uncovered type line

- since we're not iterating over productNames, no need for it to be an array - it can be written more clearly in string union format

* Fix branch coverage on index.tsx

- Since KibanaLogic is setting `|| {}` fallbacks in any case, I've opted to remove them in this file and let fallbacks be handled there

- Fixed typing to make it clear plugins can be undefined (i.e., disabled/optional, etc) in props + reorganize w/ comments

- KibanaValues requires an Omit to override props types

* Crawler DomainsTable test coverage/improvements

- Fix test failing locally due to timezones by increasing the timezone offset

- Cover missing branch line by adding a domain with no `lastCrawl`

- Remove unnecessary extra beforeEach with dupe re-shallow/mounts

- move getTable helper to its most relevant block (it's not being used in the generic column content checks, only in the actions column suite)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
# Conflicts:
#	x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/domains_table.test.tsx
jloleysens added a commit to jloleysens/kibana that referenced this pull request Jun 28, 2021
…-png-pdf-report-type

* 'master' of github.com:elastic/kibana: (253 commits)
  [Enterprise Search] Test coverage pass (elastic#103406)
  [App Search] Success toast polish pass  (elastic#103410)
  Role mappings: remove deprecated reset copy (elastic#103411)
  [Fleet] Add a message when log collection is disabled on the log details page (elastic#103166)
  [Query]  Remove es query dependency on format.convert (elastic#103174)
  Home & Kibana Overview Page Template Update (elastic#103003)
  [ML] Converts management app jobs list pages to new layout (elastic#103117)
  Allow additive csp configuration (elastic#102059)
  [Lens] Document common formulas in product and add formula tutorial (elastic#103154)
  [Lens] Enable actions on Lens Embeddable (elastic#102038)
  [Osquery] Return proper indices permissions for osquery_manager package (elastic#103363)
  Dashboard locator (elastic#102854)
  Maps locators (elastic#102810)
  [Fleet] Add support for constant_keyword "value" in package field definitions (elastic#103000)
  [Maps] Add capability to delete features from layer & index (elastic#103145)
  [Security Solution] Correct linux OS lookup for Endpoint Exceptions (elastic#103038)
  [Enterprise Search] Add notices for deactivated users and SMTP callout (elastic#103285)
  [canvas] Reduce bundle size by combining SCSS imports (elastic#102822)
  [Enterprise Search] Final KibanaPageTemplate cleanup (elastic#103355)
  [docs][migrations v2] Update SO migration docs to include removal of index write block when handling corrupt SOs. (elastic#103014)
  ...
jloleysens added a commit to jloleysens/kibana that referenced this pull request Jun 28, 2021
…-policy-2

* 'master' of github.com:elastic/kibana: (190 commits)
  [Enterprise Search] Test coverage pass (elastic#103406)
  [App Search] Success toast polish pass  (elastic#103410)
  Role mappings: remove deprecated reset copy (elastic#103411)
  [Fleet] Add a message when log collection is disabled on the log details page (elastic#103166)
  [Query]  Remove es query dependency on format.convert (elastic#103174)
  Home & Kibana Overview Page Template Update (elastic#103003)
  [ML] Converts management app jobs list pages to new layout (elastic#103117)
  Allow additive csp configuration (elastic#102059)
  [Lens] Document common formulas in product and add formula tutorial (elastic#103154)
  [Lens] Enable actions on Lens Embeddable (elastic#102038)
  [Osquery] Return proper indices permissions for osquery_manager package (elastic#103363)
  Dashboard locator (elastic#102854)
  Maps locators (elastic#102810)
  [Fleet] Add support for constant_keyword "value" in package field definitions (elastic#103000)
  [Maps] Add capability to delete features from layer & index (elastic#103145)
  [Security Solution] Correct linux OS lookup for Endpoint Exceptions (elastic#103038)
  [Enterprise Search] Add notices for deactivated users and SMTP callout (elastic#103285)
  [canvas] Reduce bundle size by combining SCSS imports (elastic#102822)
  [Enterprise Search] Final KibanaPageTemplate cleanup (elastic#103355)
  [docs][migrations v2] Update SO migration docs to include removal of index write block when handling corrupt SOs. (elastic#103014)
  ...

# Conflicts:
#	x-pack/plugins/reporting/server/lib/store/store.test.ts
#	x-pack/plugins/reporting/server/lib/store/store.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated: Automatically backport this PR after it's merged release_note:skip Skip the PR/issue when compiling release notes v7.14.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants