Commit graph

233 commits

Author SHA1 Message Date
Patryk Kopyciński
924664fc79
Bump cypress@13.3.0 (#162383)
## Summary

Bump Cypress-related dependencies to the latest versions and update
`renovate.json` to do it automatically in the future

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Gloria Hornero <gloria.hornero@elastic.co>
2023-10-01 10:55:01 +02:00
Patryk Kopyciński
5dedc992a1
[osquery] Setup E2E against Serverless ES, Kibana, Fleet server standalone and Elastic agents in Docker (#165415)
## Summary

Let's automate E2E against Serverless

Changelog:
- updated certs to include additional dns names we are using for testing
locally, `host.docker.internal`, `es01`
- updated certs generation README to include changes related to
`openssl@3`
- added new certs for Fleet server
- added fleet-server service token
- added support for `ca_trusted_fingerprint` in fleet preconfig


![image](64860344-184f-45ef-99d4-dd7a5a8d6d23)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Tomasz Ciecierski <ciecierskitomek@gmail.com>
Co-authored-by: Tomasz Ciecierski <tomasz.ciecierski@elastic.co>
Co-authored-by: Kevin Logan <kevin.logan@elastic.co>
2023-09-29 03:33:06 -07:00
Alex Szabo
8a29a5e2ca
[Ops] Fix outstanding typescript issues / re-enable typecheck (#167392)
## Summary
This is hopefully the last batch of typescript issues to be fixed,
related to https://github.com/elastic/kibana/pull/166813.

It's also re-enabling full typecheck, with this, we should be back in a
clean, typechecked main branch.

Blocked by #167428

---------

Co-authored-by: Brad White <Ikuni17@users.noreply.github.com>
Co-authored-by: Brad White <brad.white@elastic.co>
Co-authored-by: Thomas Watson <watson@elastic.co>
Co-authored-by: Patryk Kopyciński <contact@patrykkopycinski.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-09-28 17:55:17 -06:00
Robert Oskamp
db58f44def
Add serverless FTR tests to staging quality gate (#167294)
## Summary

This PR adds the serverless FTR tests that we already have in the [QA
quality
gate](https://github.com/elastic/kibana/blob/main/.buildkite/pipelines/quality-gates/pipeline.tests-qa.yaml#L18-L24)
to the staging quality gate.

### Details

We intentionally decided run the same set of FTR tests again in staging
for starters. We're accepting the over-testing here until we have enough
confidence and experience with our serverless product stability to
decide which set of tests to run in which environment.

This PR also explicitly sets the `EC_ENV` and `EC_REGION` environment
variables for QA and Staging. It worked fine for QA env so far without
setting the environment variable because it fell back on the QAF default
values. Setting these values explicitly, makes it more robust.
2023-09-28 17:26:34 +02:00
Alex Szabo
d1155f3273
[Ops] Disable check types on_merge completely (#167293)
## Summary
The full typecheck would definitely fail on the on_merge job, and the
selective typecheck doesn't make much sense (if it was already through
that step in the PR.) so we're temporarily disabling this step
completely.
2023-09-26 15:58:16 +02:00
Brad White
307234384d
Switch Check Types to Commit Diff for on merge pipeline (#167206)
## Summary

After merging #167060, `Check Types` is going to fail in the on merge
pipeline until all type errors are triaged. For now, lets use the commit
diff type check.
2023-09-26 09:45:36 +02:00
Alex Szabo
e81728ee96
Fix typecheck foundations (#167060)
## Summary
This PR is the core part of #166813. The original work seems to grow
large, and we'd like to enable a preventive check beforehand to prevent
more errors from entering the codebase.

The idea is to have a selective type check that would only check changed
files' projects.
- [x] when there's no extra label, run the selective type check only on
the diffing files' projects (success:
https://buildkite.com/elastic/kibana-pull-request/builds/161837)
- [x] when the label `ci:hard-typecheck` is present, run the regular
(but now, working) full typecheck (expected to fail: )

cc: @watson

---------

Co-authored-by: Brad White <brad.white@elastic.co>
Co-authored-by: Thomas Watson <w@tson.dk>
Co-authored-by: Thomas Watson <watson@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-09-25 16:28:56 -07:00
Alex Szabo
7f82102d72
[Ops] ES Serverless image verification pipeline (#166054)
## Summary
Prepares the serverless FTR tests to be runnable with a custom ES image.
(`--esServerlessImage` cli arg)
Creates a pipeline for testing and promoting ES Serverless docker
releases.

The job can be triggered here:
https://buildkite.com/elastic/kibana-elasticsearch-serverless-verify-and-promote
The three main env variables it takes:
- BUILDKITE_BRANCH: the kibana branch to test with (maybe not as
important)
 - BUILDKITE_COMMIT: the kibana commit to test with
- ES_SERVERLESS_IMAGE: the elasticsearch serverless image, or tag to use
from this repo:
`docker.elastic.co/elasticsearch-ci/elasticsearch-serverless`

## TODOS:
 - [x] set `latest_verified` with full img path as default
- [x] ~~find other CLIs that might need the `esServerlessImage` argument
(if the docker runner has multiple usages)~~ | I confused the `yarn es
docker` with this, because I thought we only run ES serverless in a
docker container, but `elasticsearch` can also be run in docker.
- [x] set `latest-compatible` or similar flag in a manifest in gcs for
Elastic's use-case
- [ ] ensure we can only verify "forward" (ie.: to avoid a
parameterization on old versions to set our pointers back) [on a second
thought, this might be kept as a feature to roll back (if we should ever
need that)]


There are two confusing things I couldn't sort out just yet:
#### Ambiguity in --esServerlessImage 
We can either have 2 CLI args: one for an image tag, one for an image
repo/image url, or we can have one (like I have it now) and interpret
that in the code, it can be either the image url, or the tag. It's more
flexible, but it's two things in one. Is it ok this way, or is it too
confusing?
e.g.:
```
node scripts/functional_tests --esFrom serverless --esServerlessImage docker.elastic.co/elasticsearch-ci/elasticsearch-serverless:git-8fc8f941bd4d --bail --config x-pack/test_serverless/functional/test_suites/security/config.ts

# or
node scripts/functional_tests  --esFrom serverless --esServerlessImage latest --bail --config x-pack/test_serverless/functional/test_suites/security/config.ts
```

#### Ambiguity in the default image path
The published ES Serverless images will sit on this image path:
`docker.elastic.co/elasticsearch-ci/elasticsearch-serverless`, however,
our one exception is the `latest-verified` which we will be tagging
under a different path, where we have write rights:
`docker.elastic.co/kibana-ci/elasticsearch-serverless:latest-verified`.

Is it okay, that by default, we're searching in the `elasticsearch-ci`
images for any tags as parameters (after all, all the new images will be
published there), however our grand default will ultimately be
`docker.elastic.co/kibana-ci/elasticsearch-serverless:latest-verified`.


## Links
Buildkite:
https://buildkite.com/elastic/kibana-elasticsearch-serverless-verify-and-promote
eg.:
https://buildkite.com/elastic/kibana-elasticsearch-serverless-verify-and-promote/builds/24
Closes: https://github.com/elastic/kibana/issues/162931

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-09-25 09:49:20 -07:00
Paul Tavares
de712c4d64
[Security Solution][Endpoint] Update the agents.queue setting for Defend Workflow buildkite jobs (#166981)
## Summary

- sets the `agents.queue` for Defend Workflows jobs to `n2-4-virt`,
since these jobs need to create and run VMs using Vagrant
- Should address failures seen in:
https://buildkite.com/elastic/kibana-on-merge-unsupported-ftrs
2023-09-21 14:01:55 -07:00
Paul Tavares
81adaa59f1
[Security Solution][Endpoint] Increase buildkite parallelism for defend_workflows on pipeline on_merge_unsupported_ftrs.yml (#166947)
## Summary

- Increase the `parallelism` for `defend_workflows` to match that of PR
pull request (`6`)
- Should ( 🤞 ) fix the failures being seen in buildkite:
https://buildkite.com/elastic/kibana-on-merge-unsupported-ftrs
2023-09-21 08:13:48 -07:00
Alex Szabo
67939c3635
chore(quality-gates): Add slo check to QA stage (#166722)
## Summary
Adds a triggered downstream quality gate check by checking SLO metrics
over time. (now only with soft_fail)

Example runs: https://buildkite.com/elastic/kibana-tests/builds/44
`=triggers=>`
https://buildkite.com/elastic/serverless-quality-gates/builds/1837
Closes: https://github.com/elastic/kibana/issues/166804

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-09-21 16:59:52 +02:00
Paul Tavares
807856abd2
[Security Solution][Endpoint] Combine the Endpoint management cypress test suites into a single configuration/run (#166757)
## Summary

- Combines the `endpoint` and `mocked_data` tests suites so that they
run from the same cypress configuration/run buildkite setup
- Moved test files from the `endpoint/` and `mocked_data/` directories
into new sub-directories that more closely describe the set of tests
they contain
- The `security_solution/package.json` file was updated so that the
following `scripts` will now output a warning indicating that command is
no longer valid:
    - `cypress:dw:endpoint`
    - `cypress:dw:endpoint:run`
    - `cypress:dw:endpoint:open`


The following npm/yarn commands remain available for running tests
locally:

```shell
yarn --cwd=x-pack/plugins/security_solution cypress:dw:open
``` 

```shell
yarn --cwd=x-pack/plugins/security_solution cypress:dw:run
```


New test file struncture:

<img width="415" alt="image"
src="0cb4bc76-b434-4219-b73e-508645201a81">
2023-09-20 14:38:29 -04:00
Maxim Palenov
bd5e15c22c
[Security Solution] Extend Flaky runner 's config to run Serverless Cypress tests (#166783)
## Summary

This PR extends Flaky test runner's config to be able to run Serverless Cypress tests.

[Serverless Security Solution Flaky test run](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3189)
2023-09-20 07:09:32 -07:00
Gergő Ábrahám
aa36fe67ae
[Defend Workflows] Add tags for mocked and real Endpoint Cypress tests for Serverless (#165094)
## Summary

- introduces tags for [Defend Workflows] cypress tests (similarly to
https://github.com/elastic/kibana/pull/162698)
- adds scripts to Security Solution:
  - `cypress:dw:serverless:open` and `:run`
  - `cypress:dw:endpoint:serverless:open` and `:run`
- adds CI jobs to run these scripts
- so far most of the expected tests got both `@serverless` and
`@brokenInServerless` tests, because of other issues to be solved,
- one test is able to run against serverless:
`x-pack/plugins/security_solution/public/management/cypress/e2e/mocked_data/policy_details.cy.ts`
2023-09-20 10:36:11 +02:00
Gloria Hornero
dd4708414a
Upgrading cypress to 12.17.4 (#165869)
Co-authored-by: Yuliia Naumenko <jo.naumenko@gmail.com>
Co-authored-by: Thomas Watson <w@tson.dk>
Co-authored-by: Kyle Pollich <kyle.pollich@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-09-19 10:15:53 -07:00
Tomasz Ciecierski
c7e360bcd9
[EDR Workflows] Bring back artifacts, fix tests (#166341) 2023-09-13 15:36:33 +02:00
Jon
09e8e9a9f2
[ci] Merge test_serverless into ftr configs (#159607)
This moves all FTR and cypress based serverless tests into the default
test pipeline.  By moving these tests, failures will
now fail pull request and on-merge pipelines.
2023-09-13 11:15:55 +02:00
Luke Elmers
23e17ab5dd
Rename changed QA serverless pipeline name. (#166028) 2023-09-08 09:30:10 +02:00
Luke Elmers
2558c7f9b8
Only trigger manual tests phase in QA after all other steps have passed. (#165981)
Co-authored-by: Ramon Butter <ramon.butter@elastic.co>
Co-authored-by: Tiago Costa <tiago.costa@elastic.co>
2023-09-08 09:28:54 +02:00
Tiago Costa
8f22eb15fe
chore(NA): reduce parallelism number on Serverless Security Cypress Tests (#165906)
This PR reduces the parallel number of workers that will run the
Serverless Security Cypress Tests for now. As we have skipped some
serverless tests that were flaky we don't need as much workers as
before. As soon as we see those pipeline times increasing we can restore
the number of workers.
2023-09-07 17:04:25 +01:00
Isaac Karrer
243b1e93a2
notify mission control (#165977)
## Summary

Notify mission control on any releases.
2023-09-07 08:07:05 -07:00
Alex Szabo
015b910de2
[Ops] Run kibana quality gate suites (#165346)
## Summary
Sets up quality gate triggering in Kibana. The tests are mostly
triggering external pipelines and relying on their results. Here's an
example run:
https://buildkite.com/elastic/kibana-tests/builds/28#job-018a69a6-c860-405e-ab2b-bce2aed07df3

According to [this
doc](https://docs.google.com/document/d/15rx2Z-soL20An0nBUcXX0o_HHf1OU_IgrHXgz20NndI/edit)
many of the quality gates are really required for the QA->Staging
promotion step.

Most of the tests are in the QA stage: 
 - [fleet smoke tests](https://buildkite.com/elastic/fleet-smoke-tests)
- ~~[QAF RAC load
tests](https://buildkite.com/elastic/appex-qa-rac-alert-load)~~ Removed,
see https://github.com/elastic/kibana/pull/165346#discussion_r1316822164
- [QAF serverless
tests](https://buildkite.com/elastic/appex-qa-kibana-serverless-ftr-tests)
- [control plane QA smoke
tests](https://buildkite.com/elastic/ess-k8s-qa-e2e-tests-daily)
- [security solution
tests](.buildkite/scripts/pipelines/security_solution_quality_gate/pipeline.sh)
+ manual check for confirming manual tests
 - Manual confirmation 👍

Staging has: 
- [control plane staging smoke
tests](https://buildkite.com/elastic/ess-k8s-staging-e2e-tests)
 - Manual confirmation 👍

Production has:
- [control plane production smoke
tests](https://buildkite.com/elastic/ess-k8s-production-e2e-tests)
 - Manual confirmation 👍

### Quirks
- ~~`SKIP_KIBANA_HOOKS=1` needs to be set from the triggering job~~
Split into https://github.com/elastic/kibana/pull/165597
- The pipeline can only be tested from the non-fork, `elastic/kibana`
repo's branches (because buildkite doesn't see forks' branches)
- Soft fails added, to not block the release pipeline in case we still
need to adjust/work on some unstable tests

Reference:
https://docs.google.com/document/d/15rx2Z-soL20An0nBUcXX0o_HHf1OU_IgrHXgz20NndI/edit
Depends on: #165009 
Closes: https://github.com/elastic/kibana-operations/issues/10

---------

Co-authored-by: Tiago Costa <tiago.costa@elastic.co>
Co-authored-by: Thomas Watson <watson@elastic.co>
2023-09-06 13:22:43 +02:00
Tiago Costa
5a206e2c2e
chore(NA): reduce parallelism number on Serverless Security Cypress Tests (#165681)
This PR reduces the parallel number of workers that will run the
Serverless Security Cypress Tests as at least for now I don't think we
need `16`.
2023-09-05 18:58:43 +01:00
Stavros Kroustouris
5cb092d583
TLS-626 make sure that all the gpctl triggers are running the tests (#165594)
## Summary

After chatting with the team, i realized that
https://github.com/elastic/kibana/pull/165334 did not include the file
this PR is updating.


## Note
Another approach would be to keep the pipeline triggers as they are, but
make sure the e2e tests have been run in parallel with any other tests
during the CI process. This would potentially shorten the CI times since
the e2e tests take around 40 minutes to run.
2023-09-05 07:23:27 -07:00
Ramon Butter
a53e3055c0
change quality gates notifications (#165646) 2023-09-05 11:19:17 +02:00
Maxim Palenov
deed5e4679
[Security Solution] Fix junit report transformation (#165541)
**Fixes:** https://github.com/elastic/kibana/issues/165546

## Summary

This PR fixes junit report transformation for Security Solution build steps (Cypress writes reports in `mochawesome` format and `yarn junit:transform` transforms it to junit format).

## Details

After refactoring it turned out `yarn junit:merge` was moved from `cypress:*` yarn scripts to build step `*.sh` files in `.buildkite/scripts/steps/functional` folder. This way a command to run Cypress tests changed from

```sh
yarn cypress:run:ess
```

to

```sh
yarn cypress:run:ess; status=$?; yarn junit:merge && exit $status
```

In first case any test failure do not lead to early exist and all following commands are executed as yarn runs scripts without preserving shell settings. In the second case failing tests lead to `yarn cypress:run:ess` exit with non-zero exit code so the shell script exits immediately without giving a chance for `yarn junit:merge` to execute.

This problem is solved by disabling early exit on error via `set +e`.

On top of that using of `artifact_paths` config option is redundant as [post command script](https://github.com/elastic/kibana/blob/main/.buildkite/scripts/lifecycle/post_command.sh#L16) upload build artefact via a bildkite agent.

#### [Failed build example](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3049#_)
2023-09-05 07:40:32 +02:00
Alex Szabo
ee986415c8
[Ops] Fix typos in bk pipeline stubs (#165617)
## Summary
In the created stubs, some of the buildkite steps used `agent` instead
of `agents`, this failed the steps.
This PR fixes these typos.

see:
https://buildkite.com/elastic/kibana-tests/builds/20#018a6109-c878-489d-a4e4-ad4db1e75e87
2023-09-04 18:58:26 +01:00
Alex Szabo
0edc23e02a
[Ops] Skip buildkite hooks for non kibana jobs (#165597)
## Summary

Kibana's build jobs work on a different subset of executors than the
buildkite pipelines defined in `catalog-info.yaml`.

The former jobs require a set of `pre_command` / `post_command` steps to
prepare the jobs for building/testing kibana.
The latter don't have access rights to certain vault secrets (and
possibly other missing config from the Kibana world), but for now,
they're also not building Kibana, they just trigger other jobs, so we
can just skip the problematic hooks.

~~A probably good indicator I found for deciding whether we need the
kibana-related `pre_command` is the
`BUILDKITE_AGENT_META_DATA_AGENT_MANAGER` flag, that's set to `"kibana"`
in the case of the kibana executors.~~

We can try to match on the agent names for the CI-systems agents. They
seem to be starting with `bk-agent`.

This should allow for the
[kibana-tests](https://buildkite.com/elastic/kibana-tests) job to run.

Split from: https://github.com/elastic/kibana/pull/165346

---------

Co-authored-by: Tiago Costa <tiago.costa@elastic.co>
2023-09-04 09:29:16 -07:00
Isaac Karrer
bc866a7f96
reverse which config we call to keep locking working (#165351)
## Summary

The config does not propagate to downstream workflow jobs in all cases
so things break if we don't use the default. Therefore we will make dev
the exception.

Update the gpctl config we reference in the gitops repo. The default
config needs to be the promotion workflow and dev needs to be separate
otherwise other promotion infrastructure breaks since it does not know
to look for the overridden config.
https://github.com/elastic/serverless-gitops/pull/688

Slack: https://elastic.slack.com/archives/C9PPG4EJH/p1693480365606699
2023-08-31 15:55:10 -05:00
Davis McPhee
b4bfb2a2dd
[Data Discovery] Run example plugin functional tests in Serverless (#163411)
## Summary

> [!IMPORTANT]  
> These tests currently do not run in "real" Serverless and only run in
"local" Serverless (what we use in CI). Additional work will need to be
done to allow these tests to be run in an actual Serverless environment,
since they required `config.ts` changes which are only loaded when
running locally.

This PR copies the Data Discovery example plugin functional tests to
`test_serverless` and adds support for running them against the Search
project.

It also adds support for running functional tests against example
plugins in general in Serverless ("local" Serverless only currently).

In the future these should run as deployment-agnostic tests, but support
does not yet exist (see #161574), so in the meantime they've been
duplicated and modified in place. I've left `TODO` comments where test
files have been modified so we know what needs to be addressed once they
are converted to deployment-agnostic tests.

Part of #162347.

### Checklist

- [ ] ~Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)~
- [ ]
~[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials~
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] ~Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard
accessibility](https://webaim.org/techniques/keyboard/))~
- [ ] ~Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))~
- [ ] ~If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)~
- [ ] ~This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))~
- [ ] ~This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)~

### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Dzmitry Lemechko <dzmitry.lemechko@elastic.co>
2023-08-31 10:23:05 -03:00
Isaac Karrer
581b7f4327
pipeline for serverless kibana release (#165009)
## Summary

Adds a pipeline that will trigger the promotion and QG for kibana
through qa -> staging -> production whenever the tag which [matches the
regex](https://regex101.com/r/tY52jo/1) is created.

Sibling PR [here](https://github.com/elastic/serverless-gitops/pull/661)
that defines `main/gen/gpctl/kibana/tagged-release.yaml`

The meat of the PR is the regex.

---------

Co-authored-by: Thomas Watson <w@tson.dk>
Co-authored-by: Alex Szabo <delanni.alex@gmail.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-08-31 08:08:01 -05:00
Brad White
06ebc3120c
ESS support for FTR serverless tests. SSL support in kbn/es. kbn/es DX improvements. (#162673)
Closes #162593
Closes #163939 
Closes #162625

The original intention of this PR was to add FTR support for ESS.
However the scope increased as that also required adding SSL support due
to tests failing from disabled `security` and no authentication.
Additionally, after using serverless in `kbn/es` extensively for this,
there was a bit of friction in regards to DX.

## Summary
- Switch `x-pack/test_serverless` FTR to use ES serverless instead of
(stateful) snapshot
- Adds SSL support to Docker and Serverless in `kbn/es`
- Adds `port` option override
- Adds `teardown` option to kill running nodes if the process exits
without shutdown
- Adds `kill` option to kill running nodes on startup if detected
- Adds `--esFrom serverless` to FTR CLI
- Adds `files` option to mount extra files into containers
- For serverless, automatically attach to first node with `docker logs
-f es01` on startup for better DX.
- Added `background` flag to not attach `logs`.
- Adds graceful shutdown for ESS cluster
- Separate `docker pull` from `run` for better logging, ensures latest
image and stops multiple pulls of the same image occurring in parallel
- Align (most) default settings for ES serverless with `gradlew`
[settings](https://github.com/elastic/elasticsearch-serverless/blob/main/serverless-build-tools/src/main/kotlin/elasticsearch.serverless-run.gradle.kts#L8)
- Fixes Docker bind mount permissions in CI
- Fixes issue where `esFrom` would default to `snapshot` and override
FTR config settings.

### Checklist

- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

## Related Issues for Skipped Tests
Security Threat Hunting: #165135
Observability: #165138
Response Ops: #165145

---------

Co-authored-by: Dzmitry Lemechko <dzmitry.lemechko@elastic.co>
Co-authored-by: Tiago Costa <tiago.costa@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Patryk Kopycinski <contact@patrykkopycinski.com>
2023-08-30 13:28:29 -07:00
Patryk Kopyciński
779ef9e901
[security_solution] Improve Cypress burn logic (#165130)
## Summary

Add `burn` scripts to `package.json` to simplify the process of testing
spec files locally
2023-08-30 18:05:51 +02:00
Dmitrii Shevchenko
2171ecc719
[Security Solution] Initial migration of API endpoints to OpenAPI and code generation (#164482)
**Part of: https://github.com/elastic/security-team/issues/6726**

## Summary

Migrates the prebuilt rules and timelines status API route schema to
OpenAPI. This is exploratory work to assess the level of effort required
to migrate API route schemas from `io-ts` to `zod` generated by OpenAPI
codegen.

**Summary of the changes:**

- Added a CI job that runs code generation in Security Solution and
comments change if there are any.
- Migrated the `/api/detection_engine/rules/prepackaged/_status` route
to use generated `zod` schemas
- Updated schema tests
- Adjusted the code generator templates to handle `strict` schemas,
i.e., schemas that do not allow any extra params
- Updated the error transformation code to work with zod errors.
Validation errors are converted to string representations, like the
following:
<img width="627" alt="image"
src="93002573-972f-42e1-901d-01a19937f568">
2023-08-25 20:01:31 +02:00
Patryk Kopyciński
4180a1a105
[security_solution] Fix @grep tags in Cypress (#164644)
## Summary

`@cypress/grep` is just reading the file as text, so it's not capable of
evaluating the variables, because of that, today we are running all the
spec files, and that means that we are setting up a new stack just to
stop it a few seconds later after grep skips the spec file

https://github.com/cypress-io/cypress/blob/develop/npm/grep/src/plugin.js#L117

With variable:
<img width="1219" alt="Zrzut ekranu 2023-08-23 o 23 06 30"
src="97b6fdaa-a03a-4a4f-bbdc-97da8e1788ce">

With string:
<img width="2074" alt="Zrzut ekranu 2023-08-23 o 23 06 04"
src="1f48d20a-3a1a-4ded-aa47-493781a4758b">

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-08-25 13:22:04 +01:00
Isaac Karrer
f10b15afc5
Qx 282 touchup qg (#164643)
## Summary

The wrong file path was being given for the pipeline, this fixes that.  

Also, the [serverless release end to end
workflow](https://docs.google.com/document/d/15rx2Z-soL20An0nBUcXX0o_HHf1OU_IgrHXgz20NndI/edit)
calls out some things that I missed on the first pass. Please refer to
the "Kibana Release required testing" table.
2023-08-24 08:48:31 -05:00
Patryk Kopyciński
05cfa1ad5b
Fix Kibana fail to startup in Cypress (#164480)
## Summary
 
- remove duplicated buildkite pipeline steps
- remove concurrency from parallel that was causing flakiness
- cleanup package.json scripts

---------

Co-authored-by: Tiago Costa <tiago.costa@elastic.co>
2023-08-24 15:36:27 +02:00
Tomasz Ciecierski
054cdbaf1e
[EDR workflows] Osquery serverless tests (#163795) 2023-08-23 11:53:14 +02:00
Isaac Karrer
58334b54ac
Kibana QualityGate Scaffold (#163831)
The main question is here did I get the github team names correct for
fleet and security? Are there any other groups I am missing who will
have quality gates they want to see execute on every kibana release?

- The PR which registered the repo and controls who can write secrets to
vault was merged
[here](https://github.com/elastic/catalog-info/pull/488/files)
- Quality gate registration with argo deploy pipeline
[here](https://github.com/elastic/serverless-gitops/pull/586). Should
merge after this and pipelines are working.
- [this one](https://github.com/elastic/catalog-info/pull/485/files)
merges last and tells terrazzo about the catalog-info.yaml file with our
pipeline. Other pipelines should be migrated over but are not included
here.


Rel: https://github.com/elastic/ingest-dev/issues/2201
Rel: https://elasticco.atlassian.net/browse/QX-282

---------

Co-authored-by: Ramon Butter <ramon.butter@elastic.co>
2023-08-22 14:30:08 +02:00
Patryk Kopyciński
aaedb2d449
[security_solution] Update serverless buildkite pipeline (#164155)
## Summary

Align buildkite pipelines between ess and serverless
2023-08-17 17:41:09 +02:00
Patryk Kopyciński
fd33ed55fd
Fix osquery cypress tests (#163988)
## Summary

Adjust tests to https://github.com/elastic/kibana/pull/161614
Split tests into smaller files to better utilize parallelization and
increase the stability of tests
2023-08-17 00:11:05 +02:00
Patryk Kopyciński
8cf9881605
Fix security solution serverless buildkite config (#164021)
## Summary

Updates buildkite config to make sure Security Solution Serverless are
soft_failing for now
2023-08-16 12:59:15 -05:00
Gloria Hornero
bfd7c7f8d8
[Security Solution] Reenabling Cypress burn (#163965)
Co-authored-by: Patryk Kopyciński <contact@patrykkopycinski.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-08-16 13:33:23 +02:00
Gloria Hornero
f9c9722c6f
[Security Solution][Serverless] Reusing Cypress tests for Serverless infrastructure (#162698)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Patryk Kopycinski <contact@patrykkopycinski.com>
Co-authored-by: Georgii Gorbachev <georgii.gorbachev@elastic.co>
2023-08-15 19:50:54 +02:00
Jon
b59c2756b7
[ci] Support ARM artifacts when using label ci:build-serverless-image (#163355)
Previously the `ci:build-serverless-image` label was hooked into the
default `Build distribution` step, which only builds the x64 linux
distribution. This limited build is in support of starting functional
tests as quickly as possible.

In order to support ARM artifacts, this starts a non-blocking parallel
build that cross compiles.

There's tradeoffs to this approach. CI time will be kept near our hour
target, at the cost of building x64 artifacts twice. Adding cross
compilation to the primary build step will extend CI time by ~30
minutes.
2023-08-10 11:27:48 -05:00
Patryk Kopyciński
09aaecb59d
[security_solution] Cypress flaky tests catcher (#162376)
## Summary

Inspired by https://glebbahmutov.com/blog/burning-tests/

Implements the idea presented here
https://glebbahmutov.com/blog/burning-tests/#bonus-3-burning-new-or-changed-specs

In short, on PR that is changing/adding new Cypress spec files we will
try to "burn" them, it means we will try to run each `it` `2` times to
make sure tests are written in a way that gives Cypress a chance to
recover from the failed test.
Also adding a command that allows to "burn" tests locally
```
yarn cypress:burn --spec "<>"
```

Right now the job is set to `soft_fail`, so it is not going to block the
PR from merging, but hopefully will help the Team to recognize potential
flakiness before it is merged to `main`
2023-08-09 14:58:04 -07:00
Patryk Kopyciński
02a43a1dd0
Adjust cypress jobs config (#162729)
## Summary

Adjust cypress buildkite job configs

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-07-31 15:42:45 +02:00
Gloria Hornero
621401ed6a
[Security Solution][Serverless] Integrating Cypress with the parallel script (#162160) 2023-07-20 09:03:58 -05:00
Tiago Costa
dde020e611
chore(NA): use a n2-8-spot instance to build storybooks (#162200)
Lately the build storybooks ci step is getting closer to 60 minutes
running time. For now, instead of splitting the job into multiple ones,
I think we can go with a bigger machine.
2023-07-20 09:45:56 +02:00
Patryk Kopyciński
ba539d7a39
[Defend Workflows] Use Vagrant for real agent Cypress e2e (#160050)
## Summary

Run Real Endpoint Cypress E2E on CI using Vagrant

---------

Co-authored-by: Tomasz Ciecierski <ciecierskitomek@gmail.com>
Co-authored-by: Ashokaditya <am.struktr@gmail.com>
2023-07-11 03:02:51 -07:00