Commit graph

12 commits

Author SHA1 Message Date
Kibana Machine
fd4ef5f2fb
[8.6] [kbn-journeys] add optional beforeSteps hook (#151717) (#151917)
# Backport

This will backport the following commits from `main` to `8.6`:
- [[kbn-journeys] add optional beforeSteps hook
(#151717)](https://github.com/elastic/kibana/pull/151717)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Dzmitry
Lemechko","email":"dzmitry.lemechko@elastic.co"},"sourceCommit":{"committedDate":"2023-02-22T17:53:00Z","message":"[kbn-journeys]
add optional beforeSteps hook (#151717)\n\n## Summary\r\n\r\nRelated to
#151613\r\n\r\nThere might be cases when we need to add extra wait for
Kibana plugin to\r\nbe ready before starting loading test data with
`esArchiver` /\r\n`kbnArchiver`.\r\n\r\nCurrently journey lifecycle
looks like this:\r\n\r\n- `onSetup` wrapped with mocha `before` hook\r\n
- in parallel \r\n - `setupBrowserAndPage` (including EBT tracker
setup)\r\n - load ES data / Kibana saved objects\r\n - `setupApm`\r\n-
steps execution (each step wrapped with mocha `it` function)\r\n-
`onTeardown` wrapped with mocha `after` hook\r\n -
`tearDownBrowserAndPage` (including closing EBT tracker)\r\n -
`teardownApm`\r\n - load ES data / Kibana saved
objects\r\n\r\nbeforeSteps hook purpose is to make sure Kibana/ES state
is ready for\r\njourney execution and not load test data, since it won't
be unloaded\r\nduring `after` hook:\r\n\r\n- `onSetup` wrapped with
mocha `before` hook\r\n - `setupBrowserAndPage` (including EBT tracker
setup)\r\n- run beforeSteps hook -> prepare Kibana/ES for data ingestion
/ steps\r\nexecution\r\n - load ES data / Kibana saved objects\r\n -
`setupApm`\r\n\r\nHow to use:\r\n\r\n```\r\nexport const journey = new
Journey({\r\n beforeSteps: async ({ kibanaServer, retry }) => {\r\n
retry.try(async () => {\r\n const response = await
kibanaServer.request({\r\n path:
'/internal/cloud_security_posture/status?check=init',\r\n method:
'GET',\r\n });\r\n return response.status === 200;\r\n });\r\n },\r\n
esArchives: [...],\r\n kbnArchives: [...],\r\n})\r\n .step({...})\r\n
.step({...})\r\n```","sha":"6c33644b5324df412acd71d2a6433e93c6e17904","branchLabelMapping":{"^v8.8.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","wg:performance","v8.7.0","v8.8.0","v8.6.3"],"number":151717,"url":"https://github.com/elastic/kibana/pull/151717","mergeCommit":{"message":"[kbn-journeys]
add optional beforeSteps hook (#151717)\n\n## Summary\r\n\r\nRelated to
#151613\r\n\r\nThere might be cases when we need to add extra wait for
Kibana plugin to\r\nbe ready before starting loading test data with
`esArchiver` /\r\n`kbnArchiver`.\r\n\r\nCurrently journey lifecycle
looks like this:\r\n\r\n- `onSetup` wrapped with mocha `before` hook\r\n
- in parallel \r\n - `setupBrowserAndPage` (including EBT tracker
setup)\r\n - load ES data / Kibana saved objects\r\n - `setupApm`\r\n-
steps execution (each step wrapped with mocha `it` function)\r\n-
`onTeardown` wrapped with mocha `after` hook\r\n -
`tearDownBrowserAndPage` (including closing EBT tracker)\r\n -
`teardownApm`\r\n - load ES data / Kibana saved
objects\r\n\r\nbeforeSteps hook purpose is to make sure Kibana/ES state
is ready for\r\njourney execution and not load test data, since it won't
be unloaded\r\nduring `after` hook:\r\n\r\n- `onSetup` wrapped with
mocha `before` hook\r\n - `setupBrowserAndPage` (including EBT tracker
setup)\r\n- run beforeSteps hook -> prepare Kibana/ES for data ingestion
/ steps\r\nexecution\r\n - load ES data / Kibana saved objects\r\n -
`setupApm`\r\n\r\nHow to use:\r\n\r\n```\r\nexport const journey = new
Journey({\r\n beforeSteps: async ({ kibanaServer, retry }) => {\r\n
retry.try(async () => {\r\n const response = await
kibanaServer.request({\r\n path:
'/internal/cloud_security_posture/status?check=init',\r\n method:
'GET',\r\n });\r\n return response.status === 200;\r\n });\r\n },\r\n
esArchives: [...],\r\n kbnArchives: [...],\r\n})\r\n .step({...})\r\n
.step({...})\r\n```","sha":"6c33644b5324df412acd71d2a6433e93c6e17904"}},"sourceBranch":"main","suggestedTargetBranches":["8.7","8.6"],"targetPullRequestStates":[{"branch":"8.7","label":"v8.7.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.8.0","labelRegex":"^v8.8.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/151717","number":151717,"mergeCommit":{"message":"[kbn-journeys]
add optional beforeSteps hook (#151717)\n\n## Summary\r\n\r\nRelated to
#151613\r\n\r\nThere might be cases when we need to add extra wait for
Kibana plugin to\r\nbe ready before starting loading test data with
`esArchiver` /\r\n`kbnArchiver`.\r\n\r\nCurrently journey lifecycle
looks like this:\r\n\r\n- `onSetup` wrapped with mocha `before` hook\r\n
- in parallel \r\n - `setupBrowserAndPage` (including EBT tracker
setup)\r\n - load ES data / Kibana saved objects\r\n - `setupApm`\r\n-
steps execution (each step wrapped with mocha `it` function)\r\n-
`onTeardown` wrapped with mocha `after` hook\r\n -
`tearDownBrowserAndPage` (including closing EBT tracker)\r\n -
`teardownApm`\r\n - load ES data / Kibana saved
objects\r\n\r\nbeforeSteps hook purpose is to make sure Kibana/ES state
is ready for\r\njourney execution and not load test data, since it won't
be unloaded\r\nduring `after` hook:\r\n\r\n- `onSetup` wrapped with
mocha `before` hook\r\n - `setupBrowserAndPage` (including EBT tracker
setup)\r\n- run beforeSteps hook -> prepare Kibana/ES for data ingestion
/ steps\r\nexecution\r\n - load ES data / Kibana saved objects\r\n -
`setupApm`\r\n\r\nHow to use:\r\n\r\n```\r\nexport const journey = new
Journey({\r\n beforeSteps: async ({ kibanaServer, retry }) => {\r\n
retry.try(async () => {\r\n const response = await
kibanaServer.request({\r\n path:
'/internal/cloud_security_posture/status?check=init',\r\n method:
'GET',\r\n });\r\n return response.status === 200;\r\n });\r\n },\r\n
esArchives: [...],\r\n kbnArchives: [...],\r\n})\r\n .step({...})\r\n
.step({...})\r\n```","sha":"6c33644b5324df412acd71d2a6433e93c6e17904"}},{"branch":"8.6","label":"v8.6.3","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Dzmitry Lemechko <dzmitry.lemechko@elastic.co>
2023-02-22 12:01:29 -07:00
Kibana Machine
13ff138fcb
[8.6] [ftr/journeys] allow override ftr base config in journey (#151277) (#151400)
# Backport

This will backport the following commits from `main` to `8.6`:
- [[ftr/journeys] allow override ftr base config in journey
(#151277)](https://github.com/elastic/kibana/pull/151277)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Dzmitry
Lemechko","email":"dzmitry.lemechko@elastic.co"},"sourceCommit":{"committedDate":"2023-02-16T07:52:05Z","message":"[ftr/journeys]
allow override ftr base config in journey (#151277)\n\n##
Summary\r\n\r\nCurrently journeys use pre-defined base FTR config and
there is no way\r\nto re-configure Kibana to be loaded with extras, e.g.
Fleet
plugin\r\nconfiguration.\r\n\r\nf443109eea/packages/kbn-journeys/journey/journey_ftr_config.ts (L32-L34)\r\n\r\nProbably
the easiest way to address it is to path custom FTR config\r\ndirectly
in the journey.\r\n\r\n```\r\nexport const journey = new Journey({\r\n
ftrConfigPath: 'x-pack/test/cloud_security_posture_api/config.ts',\r\n
...\r\n})\r\n```\r\n\r\n\r\nIt can be also considered as a step towards
using journeys as future\r\nalternative to Webdriver functional
tests.","sha":"b46d25a7ca700b7e4e01970c55dbc25357acf27a","branchLabelMapping":{"^v8.8.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","wg:performance","v8.7.0","v8.6.2","v8.8.0"],"number":151277,"url":"https://github.com/elastic/kibana/pull/151277","mergeCommit":{"message":"[ftr/journeys]
allow override ftr base config in journey (#151277)\n\n##
Summary\r\n\r\nCurrently journeys use pre-defined base FTR config and
there is no way\r\nto re-configure Kibana to be loaded with extras, e.g.
Fleet
plugin\r\nconfiguration.\r\n\r\nf443109eea/packages/kbn-journeys/journey/journey_ftr_config.ts (L32-L34)\r\n\r\nProbably
the easiest way to address it is to path custom FTR config\r\ndirectly
in the journey.\r\n\r\n```\r\nexport const journey = new Journey({\r\n
ftrConfigPath: 'x-pack/test/cloud_security_posture_api/config.ts',\r\n
...\r\n})\r\n```\r\n\r\n\r\nIt can be also considered as a step towards
using journeys as future\r\nalternative to Webdriver functional
tests.","sha":"b46d25a7ca700b7e4e01970c55dbc25357acf27a"}},"sourceBranch":"main","suggestedTargetBranches":["8.7","8.6"],"targetPullRequestStates":[{"branch":"8.7","label":"v8.7.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.6","label":"v8.6.2","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.8.0","labelRegex":"^v8.8.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/151277","number":151277,"mergeCommit":{"message":"[ftr/journeys]
allow override ftr base config in journey (#151277)\n\n##
Summary\r\n\r\nCurrently journeys use pre-defined base FTR config and
there is no way\r\nto re-configure Kibana to be loaded with extras, e.g.
Fleet
plugin\r\nconfiguration.\r\n\r\nf443109eea/packages/kbn-journeys/journey/journey_ftr_config.ts (L32-L34)\r\n\r\nProbably
the easiest way to address it is to path custom FTR config\r\ndirectly
in the journey.\r\n\r\n```\r\nexport const journey = new Journey({\r\n
ftrConfigPath: 'x-pack/test/cloud_security_posture_api/config.ts',\r\n
...\r\n})\r\n```\r\n\r\n\r\nIt can be also considered as a step towards
using journeys as future\r\nalternative to Webdriver functional
tests.","sha":"b46d25a7ca700b7e4e01970c55dbc25357acf27a"}}]}]
BACKPORT-->

Co-authored-by: Dzmitry Lemechko <dzmitry.lemechko@elastic.co>
2023-02-16 01:57:23 -07:00
Dzmitry Lemechko
6bc74ae155
[kbn-journeys] extend apm labels with branch, gitRev, ciBuildName (#144521)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-11-04 23:11:45 +01:00
Dzmitry Lemechko
1505c0688d
attach-screenshots-from-journey-steps (#144447) 2022-11-03 16:17:55 +01:00
Tiago Costa
e41569b4a6
fix(NA): wrongly spread stripInternal and rootDir configs across packages (#144463)
* chore(NA): remove overrides for rootDir on packages

* chore(NA): replace './target_types' with 'target_types' on packages

* chore(NA): removes stripInternal false configs

* chore(NA): remove unused strip internals
2022-11-03 01:04:55 +00:00
Dzmitry Lemechko
f8efa76e6e
[packages/kbn-journeys] start apm after browser start and stop after browser is closed (#144267) 2022-11-01 09:22:34 +01:00
spalger
52f2b33a07
[auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
Joe Reuter
02c1912e51
restore old baseline (#143512) 2022-10-19 16:54:33 +02:00
Spencer
249b596465
[journeys] restart ES for each journey, fix flakiness (#141530) 2022-09-26 08:56:31 -07:00
spalger
da8eb44f92 revert #141437 and switch back to fixed journey ordering 2022-09-22 10:57:56 -05:00
Spencer
37d6b9d38a
[journeys] add a short delay after loading data (#141437) 2022-09-22 07:58:01 -07:00
Spencer
50b3b57d9e
[ftr] add first-class support for playwrite journeys (#140680)
* [ftr] add first-class support for playwrite journeys

* [CI] Auto-commit changed files from 'node scripts/generate codeowners'

* fix jest test

* remove ability to customize kibana server args, if we need it we can add it back

* remove dev dir that doesn't exist

* fix typo

* prevent duplicated array converstion logic by sharing flag reader

* remove destructuring of option

* fix scalability config and config_path import

* fix start_servers args and tests

* include simple readme

* fix jest tests and support build re-use when changes are just to jest tests

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-09-22 01:06:46 -07:00