Commit graph

12 commits

Author SHA1 Message Date
Dzmitry Lemechko
c48cc24617
[kbn/journeys] fixes to run journeys against ESS cluster (#166923)
## Summary

I had to change `waitForRender` since `page.waitForFunction` tries to
run a script on page and it is not working due to CSP settings on Cloud.
Instead of injecting a script, we use a classical API to find
elements/attributes in the DOM.

Since `PUT /internal/core/_settings` is merged in 8.11.0, journeys run
on Cloud with on-fly labels update is supported starting deployments
8.11.0+. I added error message for 404 code just in case someone runs it
on earlier version.

`many_fields_discover` journey was update since on Cloud the data view
used by scenario is not selected by default.

How it works:

Create a deployment with QAF and re-configure it for journey run:
```
export EC_DEPLOYMENT_NAME=my-run-8.11
qaf elastic-cloud deployments create --stack-version 8.11.0-SNAPSHOT --environment staging --region gcp-us-central1
qaf elastic-cloud deployments configure-for-performance-journeys
```

Run any journey, e.g. many_fields_discover
```
TEST_CLOUD=1 TEST_ES_URL=https://username:pswd@es_url:443 TEST_KIBANA_URL=https://username:pswd@kibana-ur_url node scripts/functional_test_runner --config x-pack/performance/journeys/many_fields_discover.ts
```

You should see a log about labels being updated:

```
Updating telemetry & APM labels: {"testJobId":"local-a3272047-6724-44d1-9a61-5c79781b06a1","testBuildId":"local-d8edbace-f441-4ba9-ac83-5909be3acf2a","journeyName":"many_fields_discover","ftrConfig":"x-pack/performance/journeys/many_fields_discover.ts"}
```

And then able to find APM logs for the journey in
[Ops](https://kibana-ops-e2e-perf.kb.us-central1.gcp.cloud.es.io:9243/app/apm/services?comparisonEnabled=true&environment=ENVIRONMENT_ALL&kuery=labels.testJobId%20%3A%20%22local-d79a878c-cc7a-423b-b884-c9b6b1a8d781%22&latencyAggregationType=avg&offset=1d&rangeFrom=now-24h%2Fh&rangeTo=now&serviceGroup=&transactionType=request)
cluster
2023-09-28 12:06:00 +02:00
Alejandro Fernández Haro
0ea37c1b42
[On-Week] Hot update of APM/EBT labels (#157093) 2023-08-31 14:36:20 +02:00
Dzmitry Lemechko
4dadcbb911
[performance] enable journeys on serverless - part 1 (#162902)
## Summary

This PR is the Step 1 to enable performance journeys run for serverless
projects.
The focus is to re-design journeys to be compatible both for stateful &
serverless Kibana.

I created `KibanaPage` class to have some shared UI actions across
different journeys.
`ProjectPage` extends `KibanaPage` and allows us to override actions,
that are different (or have different locators) in Kibana Project UI
(generic project at the moment)

`kibanaPage` is available in Step context and based on TEST_SERVERLESS
env var appropriate class instance is used.


```typescript
  .step('Go to Discover Page', async ({ page, kbnUrl, kibanaPage }) => {
    await page.goto(kbnUrl.get(`/app/discover`));
    await kibanaPage.waitForHeader();
    await page.waitForSelector('[data-test-subj="discoverDocTable"][data-render-complete="true"]');
    await page.waitForSelector(subj('globalLoadingIndicator-hidden'));
  })
```

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-08-02 12:59:23 +02:00
Walter Rafelsberger
a8e07e8709
[ML] Transforms: Add performance journey for transform wizard source index loading. (#160837)
Add a performance journey for transform wizard source index loading.
2023-06-30 13:03:22 +02:00
Dzmitry Lemechko
e55a92eab0
[performance] enable journey run against cloud deployments (#156720)
## Summary

This PR adds changes and instructions how to run existing performance
journeys against ESS instances.

As previously discussed with @pheyos , there are few manual steps to be
done before running the actual journey:
1. Create cloud deployment and re-configure it the way APM traces are
reported the monitoring cluster
2. Check out the branch matching deployment version (main ->
8.9.0-SNAPSHOT), create user with `superuser` role (we don't test
functional features, only performance metrics)

Then you can run the journey like a regular cloud test suite:
```
export TEST_KIBANA_URL=https://<username>:<password>@<kibana_url>
export TEST_ES_URL=https://<username>:<password>@j<elasticsearch_url>:<port>
export TEST_CLOUD=1
node scripts/functional_test_runner.js --config x-pack/performance/journeys/$YOUR_JOURNEY_NAME.ts
```

<img width="1357" alt="image"
src="https://user-images.githubusercontent.com/10977896/236499836-2738fecb-a5a9-4e58-a10b-915b962af037.png">

---------

Co-authored-by: Jon <jon@budzenski.me>
2023-05-08 23:35:43 -04:00
Dzmitry Lemechko
6c33644b53
[kbn-journeys] add optional beforeSteps hook (#151717)
## Summary

Related to #151613

There might be cases when we need to add extra wait for Kibana plugin to
be ready before starting loading test data with `esArchiver` /
`kbnArchiver`.

Currently journey lifecycle looks like this:

- `onSetup` wrapped with mocha `before` hook
  - in parallel 
    - `setupBrowserAndPage` (including EBT tracker setup)
    - load ES data / Kibana saved objects
  - `setupApm`
- steps execution (each step wrapped with mocha `it` function)
- `onTeardown` wrapped with mocha `after` hook
  - `tearDownBrowserAndPage` (including closing EBT tracker)
  - `teardownApm`
  - load ES data / Kibana saved objects

beforeSteps hook purpose is to make sure Kibana/ES state is ready for
journey execution and not load test data, since it won't be unloaded
during `after` hook:

- `onSetup` wrapped with mocha `before` hook
    - `setupBrowserAndPage` (including EBT tracker setup)
- run beforeSteps hook -> prepare Kibana/ES for data ingestion / steps
execution
    - load ES data / Kibana saved objects
    - `setupApm`

How to use:

```
export const journey = new Journey({
  beforeSteps: async ({ kibanaServer, retry }) => {
    retry.try(async () => {
      const response = await kibanaServer.request({
        path: '/internal/cloud_security_posture/status?check=init',
        method: 'GET',
      });
      return response.status === 200;
    });
  },
  esArchives: [...],
  kbnArchives: [...],
})
  .step({...})
  .step({...})
```
2023-02-22 18:53:00 +01: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
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