kibana/x-pack
Kibana Machine 1212a095b9
[Workplace Search] Add read views for Source Sync Scheduling (#113199) (#113889)
* Add constants

Placeholders in place whle content is being written

* Update mock to match API and add types

The weird typing around `DaysOfWeek` was taken from this SO answer to get an array from a union type:

https://stackoverflow.com/a/45486495/1949235

* Add routes and stubbed docs urls

* Add components for list items

These components are the repeatable components in each of the frequency tabs.

- FrequencyItem
- BlockedWindowItem

Form changes methods are stubbed for now.

* Add tab components for Frequency page

* Add Frequency page component

* Add synchronization logic

This is just the basics. More will be added in a future PR

* Add Synchronization op-level page

* Add Synchronization router and subnav

* Add `Objects and assets` page stub

This is merely a placeholder page so the routes could be built out. Section will be moved from settings in a future PR

* Add name and new nav item to source sub nav

* Add SynchronizationRouter nav to Source router

* Fix a couple of typos

* Add callout and disable subnav for disabled sync

This was added to the API after the rest of the work was done, so adding it here.

https://github.com/elastic/workplace-search-team/issues/2043

* Update frequency item to account for edge case

There was a very long discussion about the edge case that is covered here.

https://github.com/elastic/ent-search/pull/4715

Basically here is what we landed on:

In most cases, the user will use the form to set the sync frequency, in which case the duration will be in the format of "PT3D" (ISO 8601). However, if an operator has set the sync frequency via the API, the duration could be a complex format, such as "P1DT2H3M4S". It was decided that in this case, we should omit seconds and go with the least common denominator from minutes.

Example: "P1DT2H3M4S" -> "1563 Minutes"

* Fix failing tests and add key

* Update constants with note for translators

* Fix typo

Co-authored-by: Vadim Yakhin <yakhin.v@gmail.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Vadim Yakhin <yakhin.v@gmail.com>

Co-authored-by: Scotty Bollinger <scotty.bollinger@elastic.co>
Co-authored-by: Vadim Yakhin <yakhin.v@gmail.com>
2021-10-05 15:03:57 +00:00
..
build_chromium
dev-tools
examples
plugins [Workplace Search] Add read views for Source Sync Scheduling (#113199) (#113889) 2021-10-05 15:03:57 +00:00
scripts
tasks
test [Security Solution] Minimizes the number of environment variables used in Cypress (#113854) (#113917) 2021-10-05 10:08:20 -04:00
.gitignore
.i18nrc.json
.telemetryrc.json
gulpfile.js
package.json
README.md

Elastic License Functionality

This directory tree contains files subject to the Elastic License 2.0. The files subject to the Elastic License 2.0 are grouped in this directory to clearly separate them from files dual-licensed under the Server Side Public License and the Elastic License 2.0.

Development

By default, Kibana will run with X-Pack installed as mentioned in the contributing guide.

Elasticsearch will run with a basic license. To run with a trial license, including security, you can specifying that with the yarn es command.

Example: yarn es snapshot --license trial --password changeme

By default, this will also set the password for native realm accounts to the password provided (changeme by default). This includes that of the kibana_system user which elasticsearch.username defaults to in development. If you wish to specify a password for a given native realm account, you can do that like so: --password.kibana_system=notsecure

Testing

For information on testing, see the Elastic functional test development guide.

Running functional tests

The functional UI tests, the API integration tests, and the SAML API integration tests are all run against a live browser, Kibana, and Elasticsearch install. Each set of tests is specified with a unique config that describes how to start the Elasticsearch server, the Kibana server, and what tests to run against them. The sets of tests that exist today are functional UI tests (specified by this config), API integration tests (specified by this config), and SAML API integration tests (specified by this config).

The script runs all sets of tests sequentially like so:

  • builds Elasticsearch and X-Pack
  • runs Elasticsearch with X-Pack
  • starts up the Kibana server with X-Pack
  • runs the functional UI tests against those servers
  • tears down the servers
  • repeats the same process for the API and SAML API integration test configs.

To do all of this in a single command run:

node scripts/functional_tests

Developing functional UI tests

If you are developing functional tests then you probably don't want to rebuild Elasticsearch and wait for all that setup on every test run, so instead use this command to build and start just the Elasticsearch and Kibana servers:

node scripts/functional_tests_server

After the servers are started, open a new terminal and run this command to run just the tests (without tearing down Elasticsearch or Kibana):

node scripts/functional_test_runner

For both of the above commands, it's crucial that you pass in --config to specify the same config file to both commands. This makes sure that the right tests will run against the right servers. Typically a set of tests and server configuration go together.

Read more about how the scripts work here.

For a deeper dive, read more about the way functional tests and servers work here.

Running API integration tests

API integration tests are run with a unique setup usually without UI assets built for the Kibana server.

API integration tests are intended to test only programmatic API exposed by Kibana. There is no need to run browser and simulate user actions, which significantly reduces execution time. In addition, the configuration for API integration tests typically sets optimize.enabled=false for Kibana because UI assets are usually not needed for these tests.

To run only the API integration tests:

node scripts/functional_tests --config test/api_integration/config

Running SAML API integration tests

We also have SAML API integration tests which set up Elasticsearch and Kibana with SAML support. Run only API integration tests with SAML enabled like so:

node scripts/functional_tests --config test/security_api_integration/saml.config

Running Jest integration tests

Jest integration tests can be used to test behavior with Elasticsearch and the Kibana server.

yarn test:jest_integration

Running Reporting functional tests

See here for more information on running reporting tests.

Running Security Solution Cypress E2E/integration tests

See here for information on running this test suite.