Skip to content

Commit

Permalink
Plugin test readme’s (#26632)
Browse files Browse the repository at this point in the history
* Plugin test readme’s

* clarify

* Update scripts/README.md

Co-Authored-By: Stacey-Gammon <[email protected]>
  • Loading branch information
stacey-gammon authored Dec 4, 2018
1 parent ef77982 commit 8a2f8bc
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
26 changes: 26 additions & 0 deletions scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,29 @@ node scripts/functional_test_runner --config path/to/config
```

For details on how the internal methods work, [read this readme](../packages/kbn-test/README.md).

### ES archiver

#### Loading data

If you wish to load up specific es archived data for your test, you can do so via:

```
node scripts/es_archiver.js load <archive> [--es-url=http://username:password@localhost:9200] [--kibana-url=http://username:password@localhost:5601/{basepath?}]
```

That will load the specified archive located in the archive directory specified by the default functional config file, located in `test/functional/config.js`. To load archives from other function config files you can pass `--config path/to/config.js`.

*Note:* The `--es-url` and `--kibana-url` options may or may not be neccessary depending on your current Kibana configuration settings, and their values
may also change based on those settings (for example if you are not running with security you will not need the `username:password` portion).

#### Saving data

You can save existing data into an archive by using the `save` command:

```
node scripts/es_archiver.js save <archive name for kibana data> [space separated list of index patterns to include]
```

You may want to store the .kibana index separate from data. Since adding a lot of data will bloat our repo size, we have many tests that reuse the same
data indices but use their own `.kibana` index.
18 changes: 17 additions & 1 deletion test/plugin_functional/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,20 @@ test plugin), you can just run:

```
yarn start --plugin-path=test/plugin_functional/plugins/<plugin_folder>
```
```

If you wish to start Kibana with multiple test plugins, you can run:

```
yarn start --plugin-path=test/plugin_functional/plugins/<plugin_folder1> --plugin-path=test/plugin_functional/plugins/<plugin_folder2> ...
```

If you wish to load up specific es archived data for your test, you can do so via the `es_archiver` script detailed in the [Scripts README.md](../../scripts/README.md#es-archiver)

Another option, which will automatically use any specific settings the test environment may rely on, is to boot up the functional test server pointing to the plugin configuration file.

```
node scripts/functional_tests_server --config test/plugin_functional/config.js
```

*Note:* you may still need to use the es_archiver script to boot up any required data.

0 comments on commit 8a2f8bc

Please sign in to comment.