kibana/x-pack/plugins/uptime
Justin Kambic e9d0f1b58d
[Uptime] Port unit tests to master (#29876)
* Uptime unit tests6.x (#29280)

* Add API functional tests for uptime graphQL.

* Remove obsolete code.

* Add CI group for UI functional tests.

* Delete obsolete code, rename heartbeat es archive.

* Refactor adapter methods.

* Refactor adapter methods.

* Attempt to fix ci-group tag error.

* Skip functional app tests until later PR.

* Remove unused code.

* Add unit tests for ping list and snapshot components.

* Add additional unit tests.

* Remove unused variable.

* Update tests for EmptyState component.

* Update ErrorList component tests.

* Update monitor list unit test.

* Add tests for EmptyStatusBar component.

* Write test for FilterBar component.

* Update PingList test to work with 7.x data.

* Delete obsolete snapshot.

* Add test for Snapshot component.

* Update types.

* Add snapshot histogram test.

* Write tests and improve histogram data formatting function.

* Fix bug and add test to data format function.

* Remove unused localization value.

* Resolve localization conflict.

* Clean up guaranteed truthy property reference.

* Remove expression from localization default message.
2019-02-04 17:05:04 -05:00
..
common [Uptime] Port unit tests to master (#29876) 2019-02-04 17:05:04 -05:00
public [Uptime] Port unit tests to master (#29876) 2019-02-04 17:05:04 -05:00
scripts
server [Uptime] Port unit tests to master (#29876) 2019-02-04 17:05:04 -05:00
index.ts [7.0] Adds new K7 side navigation (#28940) 2019-01-31 10:13:40 -06:00
README.md Add README.md. (#28948) 2019-01-17 16:10:59 -05:00
tsconfig.json

Uptime Monitoring

Purpose

The purpose of this plugin is to provide users of Heartbeat more visibility of what's happening in their infrasturcture. It's primarily built using React and Apollo's GraphQL tools.

Layout

There are three sections to the app, common, public, and server.

common

Contains GraphQL types, constants and a few other files.

public

Components come in two main types, queries and functional. Queries are extended from Apollo's queries type which abstracts a lot of the GraphQL connectivity away. Functional are dumb components that don't store any state.

The lib directory controls bootstrapping code and adapter types.

There is a pages directory; each view gets its own page component.

The principal structure of the app is stored in uptime_app.tsx.

server

There is a graphql directory which contains the resolvers, schema files, and constants.

The lib directory contains adapters, which are connections to external resources like Kibana Server, Elasticsearch, etc. In addition, it contains domains, which are libraries that provide functionality via adapters.

There's also a rest_api folder that defines the structure of the RESTful API endpoints.

Testing

Unit tests

From ~/kibana/x-pack, run node scripts/jest.js.

Functional tests

In one shell, from ~/kibana/x-pack: node scripts/functional_tests-server.js

In another shell, from ~kibana/x-pack: node ../scripts/functional_test_runner.js --grep="{TEST_NAME}".

API tests

In one shell, from ~/kibana/x-pack: node scripts/functional_tests-server.js

In another shell, from ~kibana/x-pack: node ../scripts/functional_test_runner.js --config test/api_integration/config.js --grep="{TEST_NAME}".