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

[Uptime] Add client-side unit tests for remaining synthetics code #79366

Conversation

justinkambic
Copy link
Contributor

Summary

Related to #77960, adds additional unit tests to cover all new components.

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@justinkambic justinkambic added v8.0.0 Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability release_note:skip Skip the PR/issue when compiling release notes v7.10.0 Feature:Unit Testing labels Oct 2, 2020
@justinkambic justinkambic requested a review from a team as a code owner October 2, 2020 20:57
@justinkambic justinkambic self-assigned this Oct 2, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/uptime (Team:uptime)

igoristic and others added 22 commits October 5, 2020 11:22
* Memory usage first draft

* Fixed tests

* CR feedback

* Feedback and tests

* Added size to optimize query

* Removed scheduled check

* Removed globalstate date

Co-authored-by: Kibana Machine <[email protected]>
* add kibanaVersion context and hook, add upgrade available indications

* add agent upgrade modals and action buttons

* fix import

* add bulk actions api and remove source_uri as required

* add upgrading to AgentHealth status

* buildKueryForUpgradingAgents

* bulk actions UI

* remove source_uri

* add release type to agent details

* don't allow upgrade of unenrolled/unenrolling agent

* hide upgradeable button when not upgradeable

* fix test

* add udpating agent status

* remove upgrade available filter button for now

* update isUpgradeAvailable to use local_metadata upgradeable

* add UPDATING to agent event subtype

* use saved object for updating agent status

* add updating badge type label

* add upgrade available button and update agent list endpoint to accept showUpgradeable

* add schema and type for UPDATING

* fix type

* dont try to upgrade local_metadata

* exclude from AAD upgrade_started_at and upgraded_at

Co-authored-by: Kibana Machine <[email protected]>
Co-authored-by: Patryk Kopycinski <[email protected]>
Co-authored-by: Elastic Machine <[email protected]>
Co-authored-by: Kibana Machine <[email protected]>
* Add EQL search strategy

Since EQL is an x-pack feature, this strategy will live in the
x-pack plugin data_enhanced.

* Refactor our test setup to minimize shared state

* Ensures that the same variable is not used for both test setup and
  test assertions
* Ensures that mocks are reinstantiated on every test

* Use explicit top-level exports

* Move async search options to a helper function

* Move our workaround to a helper function

This was repeated in five places, time to consolidate.

* Commit documentation changes

We export a few new helper functions.

* Mark our internal methods as such

Updates documentation accordingly.

Co-authored-by: Kibana Machine <[email protected]>
…ph Type (elastic#78536)

* Fixed useEffect in metric_axes. Update type in params instead of type of vis

* Fixed tests

* Fixed tests

* Update current chart type definition

Co-authored-by: sulemanof <[email protected]>
Co-authored-by: Kibana Machine <[email protected]>
* Refactor: installPackage -> installPackageFromRegistry

* Refactor: factor out source-agnostic installation steps

* Unpack and cache uploaded zip and tgz files.

* Add basic archive verification and parse manifest.

* Catch error when zip archive is uploaded as gzip.

* Add API integration tests.

* Remove unnecessary use of "package key" concept.

* Add 'install_source' property to saved object epm-packages.

* Adjust tests.

* Add API integration test for manifest missing fields.

* Refactor loadArchive -> loadArchivePackage.

* Refactor caching of package archive content

* Get datasets and config templates from manifest files.

* Use file paths from archive instead of asset paths from registry.

* Correctly load registry packages into cache

* Use InstallablePackage instead of RegistryPackage where possible.

* Actually install uploaded package.

* Add missing field to saved objects in tests.

* Adjust unit test to pick buffer extractor.

* Adjust unit test.

* Fix and re-enable getAsset() test.

* Adjust integration tests.

* Make error message match test.

* Pick data_stream.dataset from manifest if set.

* dataset -> data_stream also in comments

* Remove unused variable.

* Use pkgToPkgKey() where appropriate.

* More dataset -> data stream renaming.

Co-authored-by: Kibana Machine <[email protected]>
…ed breadcrumbs (elastic#79231)

* [Setup] Add new stripLeadingSlash util

- will be used by upcoming breadcrumb/path logic
- rename folder + update references
+ clean up tests

* Update breadcrumb helpers with new useGenerateBreadcrumbs
- responsible for generating an array of IBreadcrumb objs with correct react router paths, given an array of breadcrumb text

+ rename previous generic useBreadcrumbs helper to a more specific useEuiBreadcrumbs (indicates the type of transforming happening)

+ misc typing updates/improvements

* Update SetChrome helpers
- to use new useGenerateBreadcrumbs() helper

+ simplify props - remove `isRoot` and `text` (now just accepts a single `trail` array - an empty trail creates the same effect as isRoot
+ simplify/improve typing as a result (yay!)
- improve docs

+ useEffect update - update breadcrumbs/titles if `trail` ever changes. This will primarily be most helpful for pages that fetch dynamic data on page load (e.g. a dynamic engineName, groupName, etc.)
- note that in the above case trail arrays should probably be wrapped in useMemo() to reduce unnecessary rerenders

* Update all instances of SetPageChrome to new props

Co-authored-by: Kibana Machine <[email protected]>
This PR makes the `savedObjectId` parameter optional in the Jira, ServiceNow and IBM Resilient Connectors.
This allows them to execute without this field outside of Alerts, as it is currently populated using the `alertId` which isn't available in other places.
Additionally this adds an optional field in the `Params` Components for all three of the connectors, which allows users to provide a value for the `savedObjectId` field if the so wish.
… regression (elastic#79414)

Applies the expandable section based layout to the results pages of classification and regression analytics jobs.
* rendering optimisation of text fields

* fix description disappearing bug

* refactor fix to get value from form serializer
… argument (elastic#79369)

* Disable datasource UI when expression contains an expression argument

* Removing unnecessary type coercion
Co-authored-by: Elastic Machine <[email protected]>
Co-authored-by: Kibana Machine <[email protected]>
resolves elastic#79249

The tests that were flaky were capturing a date while the test was running,
and then comparing to a lastExecutionDate field.  Most of the time this
worked, but were sometimes out of order because of the way the searches
are done and status changing dynamically.  The only current dates we can test
against are really at the very beginning and very end of the tests.
@justinkambic justinkambic requested a review from a team October 12, 2020 19:37
@justinkambic justinkambic requested a review from a team as a code owner October 12, 2020 19:37
@justinkambic justinkambic requested a review from a team October 12, 2020 19:37
@justinkambic justinkambic requested review from a team as code owners October 12, 2020 19:37
@justinkambic justinkambic requested a review from a team October 12, 2020 19:37
@justinkambic justinkambic requested review from a team as code owners October 12, 2020 19:37
@justinkambic justinkambic requested a review from a team October 12, 2020 19:37
@justinkambic
Copy link
Contributor Author

Sorry about the mass ping, git error on my part, closing this.

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

async chunks size

id before after diff
uptime 1.7MB 1.7MB +399.0B

History

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Unit Testing release_note:skip Skip the PR/issue when compiling release notes Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability v7.10.0 v7.11.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.