|
| 1 | +# Documentation for Transforms UI developers |
| 2 | + |
| 3 | +This plugin provides access to the transforms features provided by Elastic. |
| 4 | + |
| 5 | +## Requirements |
| 6 | + |
| 7 | +To use the transforms feature, you must have at least a Basic license. For more |
| 8 | +info, refer to |
| 9 | +[Set up transforms](https://www.elastic.co/guide/en/elasticsearch/reference/current/transform-setup.html). |
| 10 | + |
| 11 | + |
| 12 | +## Setup local environment |
| 13 | + |
| 14 | +### Kibana |
| 15 | + |
| 16 | +1. Fork and clone the [Kibana repo](https://github.com/elastic/kibana). |
| 17 | + |
| 18 | +1. Install `nvm`, `node`, `yarn` (for example, by using Homebrew). See |
| 19 | + [Install dependencies](https://www.elastic.co/guide/en/kibana/master/development-getting-started.html#_install_dependencies). |
| 20 | + |
| 21 | +1. Make sure that Elasticsearch is deployed and running on `localhost:9200`. |
| 22 | + |
| 23 | +1. Navigate to the directory of the `kibana` repository on your machine. |
| 24 | + |
| 25 | +1. Fetch the latest changes from the repository. |
| 26 | + |
| 27 | +1. Checkout the branch of the version you want to use. For example, if you want |
| 28 | + to use a 7.9 version, run `git checkout 7.9`. (Your Elasticsearch and Kibana |
| 29 | + instances need to be the same version.) |
| 30 | + |
| 31 | +1. Run `nvm use`. The response shows the Node version that the environment uses. |
| 32 | + If you need to update your Node version, the response message contains the |
| 33 | + command you need to run to do it. |
| 34 | + |
| 35 | +1. Run `yarn kbn bootstrap`. It takes all the dependencies in the code and |
| 36 | + installs/checks them. It is recommended to use it every time when you switch |
| 37 | + between branches. |
| 38 | + |
| 39 | +1. Make a copy of `kibana.yml` and save as `kibana.dev.yml`. (Git will not track |
| 40 | + the changes in `kibana.dev.yml` but yarn will use it.) |
| 41 | + |
| 42 | +1. Provide the appropriate password and user name in `kibana.dev.yml`. |
| 43 | + |
| 44 | +1. Run `yarn start` to start Kibana. |
| 45 | + |
| 46 | +1. Go to http://localhost:560x/xxx (check the terminal message for the exact |
| 47 | + path). |
| 48 | + |
| 49 | +For more details, refer to this [getting started](https://www.elastic.co/guide/en/kibana/master/development-getting-started.html) page. |
| 50 | + |
| 51 | +### Adding sample data to Kibana |
| 52 | + |
| 53 | +Kibana has sample data sets that you can add to your setup so that you can test |
| 54 | +different configurations on sample data. |
| 55 | + |
| 56 | +1. Click the Elastic logo in the upper left hand corner of your browser to |
| 57 | + navigate to the Kibana home page. |
| 58 | + |
| 59 | +1. Click *Load a data set and a Kibana dashboard*. |
| 60 | + |
| 61 | +1. Pick a data set or feel free to click *Add* on all of the available sample |
| 62 | + data sets. |
| 63 | + |
| 64 | +These data sets are now ready to be used for creating transforms in Kibana. |
| 65 | + |
| 66 | +## Running tests |
| 67 | + |
| 68 | +### Jest tests |
| 69 | + |
| 70 | +Run the test following jest tests from `kibana/x-pack`. |
| 71 | + |
| 72 | +New snapshots, all plugins: |
| 73 | + |
| 74 | +``` |
| 75 | +node scripts/jest |
| 76 | +``` |
| 77 | + |
| 78 | +Update snapshots for the transform plugin: |
| 79 | + |
| 80 | +``` |
| 81 | +node scripts/jest plugins/transform -u |
| 82 | +``` |
| 83 | + |
| 84 | +Update snapshots for a specific directory only: |
| 85 | + |
| 86 | +``` |
| 87 | +node scripts/jest x-pack/plugins/transform/public/app/sections |
| 88 | +``` |
| 89 | + |
| 90 | +Run tests with verbose output: |
| 91 | + |
| 92 | +``` |
| 93 | +node scripts/jest plugins/transform --verbose |
| 94 | +``` |
| 95 | + |
| 96 | +### Functional tests |
| 97 | + |
| 98 | +Before running the test server, make sure to quit all other instances of |
| 99 | +Elasticsearch. |
| 100 | + |
| 101 | +1. From one terminal, in the x-pack directory, run: |
| 102 | + |
| 103 | + node scripts/functional_tests_server.js --config test/functional/config.js |
| 104 | + |
| 105 | + This command starts an Elasticsearch and Kibana instance that the tests will be run against. |
| 106 | + |
| 107 | +1. In another tab, run the following command to perform API integration tests (from the x-pack directory): |
| 108 | + |
| 109 | + node scripts/functional_test_runner.js --include-tag transform --config test/api_integration/config |
| 110 | + |
| 111 | + The transform API integration tests are located in `x-pack/test/api_integration/apis/transform`. |
| 112 | + |
| 113 | +1. In another tab, run the following command to perform UI functional tests (from the x-pack directory): |
| 114 | + |
| 115 | + node scripts/functional_test_runner.js --include-tag transform |
| 116 | + |
| 117 | + The transform functional tests are located in `x-pack/test/functional/apps/transform`. |
0 commit comments