kibana/x-pack/plugins/security_solution
Vadim Dalecky 15d47ec2c1
ML locator (#103652)
* fix: 🐛 cast type

* chore: 🤖 remove unused parameter

* feat: 🎸 implement ML locator

* test: 💍 add locator tests

* feat: 🎸 expose ML locator form plugin contract

* feat: 🎸 deprecate ml url generator

* feat: 🎸 use locator in useMlHref() React hook

* fix: 🐛 remove non-existing property

* fix: 🐛 remove unused parameter

* feat: 🎸 replace url generator by locator

* refactor: 💡 remove ML url generator and replace by locator

* fix: 🐛 correct type check error

* test: 💍 add share plugin mock and use it

* test: 💍 update mock

* Remove usage of excludeBasePath

* Fix recently accessed url for create job to data visualizer

* refactor: 💡 rename interface

* test: 💍 move locator mock into the share plugin

* test: 💍 update Jest snapshot

* test: 💍 use shared URL service mock

* refactor: 💡 update usage after merging latest

* refactor: 💡 use locator instead of generator

* chore: 🤖 remove unused import

Co-authored-by: Quynh Nguyen <quynh.nguyen@elastic.co>
2021-07-08 16:24:12 +02:00
..
.storybook
common [Security Solutions] Navigation minor code issues fixed (#103938) 2021-07-05 14:02:21 +02:00
cypress [Security Solution] Test automation for upgrade, phase 2 and 3 (#104424) 2021-07-08 10:55:42 +02:00
public ML locator (#103652) 2021-07-08 16:24:12 +02:00
scripts Fixing the generator to use bulk api to install endpoint package (#103094) 2021-06-23 12:30:12 -04:00
server [RAC] Add mapping update logic to RuleDataClient (#102586) 2021-07-07 22:43:31 -04:00
jest.config.js [jest/securitySolution] Switch to jest-environment-jsdom (#96255) 2021-04-06 12:06:14 -04:00
kibana.json [Security Solutions] Side Navigation phase 2 (#103275) 2021-06-29 15:00:05 +02:00
package.json [Security Solution] Test automation for upgrade, phase 2 and 3 (#104424) 2021-07-08 10:55:42 +02:00
README.md [Fleet] Rename ingest_manager_api_integration tests fleet_api_integration (#83011) 2020-11-12 13:50:59 -05:00
tsconfig.json [RAC] T-Grid is moving to a new home (#100265) 2021-06-22 18:56:33 -04:00

Security Solution

Welcome to the Kibana Security Solution plugin! This README will go over getting started with development and testing.

Development

Tests

The endpoint specific tests leverage the ingest manager to install the endpoint package. Before the api integration and functional tests are run the ingest manager is initialized. This initialization process includes reaching out to a package registry service to install the endpoint package. The endpoint tests support three different ways to run the tests given the constraint on an available package registry.

  1. Using Docker
  2. Running your own local package registry
  3. Using the default external package registry

These scenarios will be outlined the sections below.

Endpoint API Integration Tests Location

The endpoint api integration tests are located here

Endpoint Functional Tests Location

The endpoint functional tests are located here

Using Docker

To run the tests using the recommended docker image version you must have docker installed. The testing infrastructure will stand up a docker container using the image defined here

Make sure you're in the Kibana root directory.

Endpoint API Integration Tests

In one terminal, run:

FLEET_PACKAGE_REGISTRY_PORT=12345 yarn test:ftr:server --config x-pack/test/security_solution_endpoint_api_int/config.ts

In another terminal, run:

FLEET_PACKAGE_REGISTRY_PORT=12345 yarn test:ftr:runner --config x-pack/test/security_solution_endpoint_api_int/config.ts

Endpoint Functional Tests

In one terminal, run:

FLEET_PACKAGE_REGISTRY_PORT=12345 yarn test:ftr:server --config x-pack/test/security_solution_endpoint/config.ts

In another terminal, run:

FLEET_PACKAGE_REGISTRY_PORT=12345 yarn test:ftr:runner --config x-pack/test/security_solution_endpoint/config.ts

Running your own package registry

If you are doing endpoint package development it will be useful to run your own package registry to serve the latest package you're building. To do this use the following commands:

Make sure you're in the Kibana root directory.

Endpoint API Integration Tests

In one terminal, run:

PACKAGE_REGISTRY_URL_OVERRIDE=<url to your package registry like http://localhost:8080> yarn test:ftr:server --config x-pack/test/security_solution_endpoint_api_int/config.ts

In another terminal, run:

PACKAGE_REGISTRY_URL_OVERRIDE=<url to your package registry like http://localhost:8080>  yarn test:ftr:runner --config x-pack/test/security_solution_endpoint_api_int/config.ts

Endpoint Functional Tests

In one terminal, run:

PACKAGE_REGISTRY_URL_OVERRIDE=<url to your package registry like http://localhost:8080> yarn test:ftr:server --config x-pack/test/security_solution_endpoint/config.ts

In another terminal, run:

PACKAGE_REGISTRY_URL_OVERRIDE=<url to your package registry like http://localhost:8080>  yarn test:ftr:runner --config x-pack/test/security_solution_endpoint/config.ts

Using the default public registry

If you don't have docker installed and don't want to run your own registry, you can run the tests using the ingest manager's default public package registry. The actual package registry used is here

Make sure you're in the Kibana root directory.

Endpoint API Integration Tests

In one terminal, run:

yarn test:ftr:server --config x-pack/test/security_solution_endpoint_api_int/config.ts

In another terminal, run:

yarn test:ftr:runner --config x-pack/test/security_solution_endpoint_api_int/config.ts

Endpoint Functional Tests

In one terminal, run:

yarn test:ftr:server --config x-pack/test/security_solution_endpoint/config.ts

In another terminal, run:

yarn test:ftr:runner --config x-pack/test/security_solution_endpoint/config.ts