Commit graph

726 commits

Author SHA1 Message Date
Jon
fafec28398
[ci/on-merge] Adjust check types queue (#170026)
n2-2-spot preemption are frequent enough that this is causing pipeline
instability. This moves the instance size up to n2-4

This also removes the max-old-space-size definition I previously set.
delanni helped me understand that we're spawning a tsc process with a
memory limit already defined.
2023-10-27 08:08:48 -05:00
Jon
134532384e
[ci] Remove --fix from precommit_hook (#169978)
Currently on CI, the precommit_hook will fix lint warnings against the
most recent commit. When multiple commits are pushed up at once, lint
warnings on earlier commits may go unnoticed until they are squashed and
merged. The on-merge pipeline will fail due to changed files, and pull
requests based on the squashed commit will see unrelated changes
auto-fixed.

This removes the --fix flag from the precommit hook check.

Closes https://github.com/elastic/kibana/issues/169966
2023-10-27 07:39:44 -05:00
Alex Szabo
227d7acae7
[Ops] Create SO migration snapshot comparion script (#168623)
## Summary
Continuation on: #167980 

Now that we have the snapshots created for merges, we can compare the
existing snapshots.
This PR creates a CLI for grabbing and comparing these snapshots.

The CLI looks like this: 
```
  node scripts/snapshot_plugin_types compare --from <rev|filename|url> --to <rev|filename|url> [--outputPath <outputPath>]

  Compares two Saved Object snapshot files based on hashes, filenames or urls.

  Options:
    --from            The source snapshot to compare from. Can be a revision, filename or url.
    --to              The target snapshot to compare to. Can be a revision, filename or url.
    --outputPath      The path to write the comparison report to. If omitted, raw JSON will be output to stdout.
    --verbose, -v      Log verbosely
```
2023-10-27 11:29:24 +02:00
Jon
14e9c82454
[ci] Remove duplicate scripts/type_check (#169982) 2023-10-26 17:53:36 -05:00
Jon
2677561625
[ci/checks] Remove bootstrap from security_solution_codegen.sh (#169943)
This was originally running with its own step but was recently moved to
`Checks`. The checks step already runs bootstrap.

Fixes
https://buildkite.com/elastic/kibana-on-merge/builds/37406#018b6c1f-13a8-4ec7-9300-3c6ef0deb0fc/8195
2023-10-26 08:37:37 -07:00
Jon
a7b6064f82
[ci] Increase parallelism for defend workflows tests (#169902)
These tests are timing out

https://buildkite.com/elastic/kibana-on-merge/builds/37377
https://buildkite.com/elastic/kibana-on-merge/builds/37374
https://buildkite.com/elastic/kibana-on-merge/builds/37373


@patrykkopycinski @MadameSheema when you get a chance can you help
operations understand how the cypress parallelism balancing works?
There's enough compute prior to this change (although it's close), and
some groups are running quicker. Does it help to split suites up so they
run quicker?
2023-10-25 20:06:37 -05:00
Kevin Logan
886203bdef
Add junit reports to Defend Workflows Serverless cypress tests (#169717)
## Summary

Add junit reports to Defend Workflows cypress tests. We had the reports
configured, but were missing a required change in the buildkite script

Here's an example test failure that I forced with an earlier commit to
show the reports being generated now:
https://buildkite.com/elastic/kibana-pull-request/builds/170777#018b66ec-013a-4430-ba98-26ab911ae653

Resolves: https://github.com/elastic/kibana/issues/169711

### Checklist

- [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

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-10-25 16:59:26 -04:00
Konrad Szwarc
1fdcb41f29
[EDR Workflows][E2E] Recreate agent on createEndpointHost task fail (#169092)
Restart vagrant vm on error during `beforeAll` task `createEndpointHost`

Defend Workflows Cypress suite ran 300 times through flaky test runner:
1. 100x
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3699
2. 50x
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3707
3. 50x
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3708
4. 50x
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3709
5. 50x
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3710


Flaky test runner runs with `createEndpointHost` task failure with
successful recovery:
1.
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3710#018b62fd-9ae9-4988-b1e0-ab0f04d8efdc
2.
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3710#018b62fd-9ae6-4340-992b-1474ee0f114b
3.
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3708#018b62fd-578e-4817-ae1c-8c58e8774eec
4.
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3708#018b62fd-5787-4245-85a6-cb446e42bc73
5.
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3707#018b62fc-fc17-407e-88de-d0b43b6b1d44
(failed due to unrelated issue)
6.
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3699#018b61d9-d2c3-430c-b3e3-72b9fbb22d24
7.
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3699#018b61d9-d2c6-4315-b828-b3218a70f209
8.
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3699#018b61d9-d2c7-4ff7-9a70-7354f90179e0
9.
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3699#018b61d9-d2d7-418f-b043-049e5effb26f
10.
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3699#018b61d9-d2da-47cc-b4ea-a4d4de3ba0a0

New errors not spotted before that got to do with env set up:

1. `vagrant up` failed:
1.1
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3708#018b62fd-5787-4245-85a6-cb446e42bc73
1.2
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3699#018b61d9-d2d0-4a52-87d9-34caa8927465

2. `CypressError: `cy.task('indexFleetEndpointPolicy')` timed out after
waiting `60000ms`.:
2.1
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3707#018b62fc-fc04-40d4-b155-46f094681edb
2.2
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3699#018b61d9-d2c9-4ebb-9174-eb9d79d04d02
2.3
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3699#018b61d9-d2dc-438f-94b0-9f94ae95701c
    

Closes:
https://github.com/elastic/kibana/issues/168284
https://github.com/elastic/kibana/issues/169343
https://github.com/elastic/kibana/issues/169468
https://github.com/elastic/kibana/issues/169469
https://github.com/elastic/kibana/issues/169467
https://github.com/elastic/kibana/issues/169465
https://github.com/elastic/kibana/issues/169466
https://github.com/elastic/kibana/issues/169157
https://github.com/elastic/kibana/issues/168719
https://github.com/elastic/kibana/issues/168427
https://github.com/elastic/kibana/issues/168359
https://github.com/elastic/kibana/issues/168340
https://github.com/elastic/kibana/issues/169689

---------

Co-authored-by: Patryk Kopyciński <contact@patrykkopycinski.com>
2023-10-25 05:13:41 -07:00
Pierre Gayvallet
c303263344
[CI] automatically commit SO def change snapshot (#169610)
Fix https://github.com/elastic/kibana/issues/147935

Automatically run the SO def integration test, and commit the changes if
any, as a new CI check script.

As explained in the issue, this is just some DX improvement, avoiding
for the developer the inconvenience of doing it manually every time they
change or add a SO in any PR.
2023-10-25 01:09:28 -07:00
Thomas Watson
e275b6bf66
[serverless] Make Fleet smoke tests hard-fail during QA quality gate (#169492) 2023-10-24 09:10:58 -07:00
Jon
a33821cda6
[ci/cypress] Sync pipelines and increase parallelism (#169576) 2023-10-24 09:05:42 -05:00
Gloria Hornero
6db8f5fe69
[Security Solution] Unskipping x-pack/test/security_solution_cypress/cypress/e2e/explore/pagination/ working tests on serverless (#169474) 2023-10-24 03:48:55 -07:00
Ramon Butter
fac9a99d3d
add timeout value for baking period (#169617)
We run into a timeout problem where the agent was called in our current
definition of the baking period.
This adds the cap explicitly above the 24h
2023-10-24 03:43:48 -07:00
Jon
ccf07deb87
[ci] Move cypress burn tests out of base pull request pipeline (#169326)
Currently operations does not have a good mechanism for communicating
soft failures, leading to confusion on pull requests. We're tracking
support for soft failures at
https://github.com/elastic/kibana/issues/169244.

For example, in https://github.com/elastic/kibana/pull/169309, it
doesn't makes sense for the author to be responsible for fixing
flakiness here, so we need to make it clear it can be ignored or find a
way to skip this step in similar situations.

This moves the cypress burn out of the base pull request pipeline,
behind the `ci:all-cypress-suites` and `ci:cypress-burn` labels. I'm
open to all improvements here, not sure this quite finds the right
balance between stability and noise.
2023-10-23 14:32:47 -05:00
Jon
b66c5c9ca5
[ci] Remove async from gpctl-promote trigger (#169464)
This removes async so we can catch and route failure notifications.
2023-10-23 13:49:58 -05:00
Jon
0ec93317c1
[ci/pull_requests] Disable kibana-kme-test (#169238)
Introduced in https://github.com/elastic/kibana/pull/157334

This pipeline was/(is?) used for testing the new buildkite system. We're
running into an issue where `trigger_comment_regex` matches on both the
legacy and new systems, triggering builds in both. GitHub checks can end
up conflicting making it difficult to find the correct build link.

This disables the pr integration for kibana-kme-test. If we're done with
the testing pipeline we can remove it, if not we can change the trigger
word. I'm not sure what the current status is, ping @elastic/ci-systems
.
2023-10-23 13:47:15 -05:00
Gloria Hornero
0eb5925228
[Security Solution] Adds more cypress tests on serverless for investigations team (#169379) 2023-10-23 10:44:21 -07:00
Jon
b95fcf00e2
[ci] Add node scripts/yarn_deduplicate check (#169165)
- Adds an entrypoint, `node scripts/yarn_deduplicate` for fixing
duplicated packages via npm package `yarn-deduplicate`
- Fixes existing duplicated packages
- Adds a CI check verifying no duplicated packages have been added.  

There are currently two exclusions - all types packages which causes
other checks to break, and axe-core, which does not follow semver.

Closes https://github.com/elastic/kibana/issues/125712
2023-10-19 18:13:48 -05:00
Jon
d6f237a3e6
[ci/on-merge] Remove parallelism from profiling and apm tests (#169405)
These tests are not sharded across agents, and historical data is not
captured for flaky tests. I'm leaving the pull request parallelism flags
as is in case the goal is to prevent flakiness, but in both cases
operations strongly prefers integration with the flaky test runner
instead.
2023-10-19 16:02:42 -05:00
Jon
6f8f0b696b
[ci] Add image for kibana-serverless:latest (#169144)
After creating a new serverless image off the main branch, in addition
to pushing an image tagged with `git-<sha>` this also pushes
`docker.elastic.co/kibana-ci/kibana-serverless:latest`.
2023-10-19 08:31:51 -05:00
Jon
8bd62dda2c
Revert "[ci] Temporarily move osquery tests back to on_merge_unsuppor… (#169278)
…ted pipeline (#169189)"

This reverts commit 267fdb1ace.
2023-10-18 14:51:23 -05:00
Tomasz Ciecierski
69cfe3ac49
[EDR Workflows] Add junit config to osquery cypress tests (#169060)
Co-authored-by: Patryk Kopyciński <contact@patrykkopycinski.com>
2023-10-18 17:15:22 +02:00
Wafaa Nasr
e536a0a795
[Security Solution][Exceptions][API testing] Move and restructures exception groups in the new api integration test folder (#168700)
## Summary

- Following the initial work in this
[PR](https://github.com/elastic/kibana/pull/166755)
- Addresses part of https://github.com/elastic/kibana/issues/151902 for
exceptions
-
https://docs.google.com/document/d/1CRFfDWMzw3ob03euWIvT4-IoiLXjoiPWI8mTBqP4Zks/edit
first two rows in the new groups
- Relocated the tests promptly without focusing on refactoring, as our
priority was to obtain coverage as well as grouping them
- Transferred the relevant utilities and updated 'signal' to 'alert.'
- Temporarily marked security role-related tests as 'brokenInServerless'
until resolution.
- Moved tests linked to exceptions requiring a `trail` in ESS and
`complete` in Serverless under a new folder called `default` license.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-10-18 14:20:24 +02:00
Jon
267fdb1ace
[ci] Temporarily move osquery tests back to on_merge_unsupported pipeline (#169189)
These tests are currently failing - 
https://buildkite.com/elastic/kibana-on-merge/builds/36968
https://buildkite.com/elastic/kibana-on-merge/builds/36969

We can move these back to the main pipeline after tests are working and
[junit reports are
available](https://github.com/elastic/kibana/issues/169018).
2023-10-17 20:31:15 -05:00
Robert Austin
bc36c699d4
Move Security's codegen step into the checks command as it has a short runtime (#168260)
## Summary

Security runs a code generator script on PRs. It only takes a few
seconds. This change moves it to the 'checks' command. This will save on
build agents.


### 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: Jon <jon@elastic.co>
2023-10-17 14:52:30 -05:00
Ramon Butter
7914414cab
Improve the production quality gate definitions (#169103)
Slice QGs specification are further defined in the environment scoped QG
pipeline file.
2023-10-17 09:35:23 -07:00
Alex Szabo
b61f570979
[Ops] Fix missing endquote in ES Serverless generated json (#169024)
## Summary
chore: fix missing end quote on generated json for ES Serverless snaphot
manifests
2023-10-16 15:17:11 -05:00
dkirchan
d7028ca9e0
Commented out the security quality gate - Not ready for integration (#168979)
## Summary

Security quality gate is not ready to be integrated yet. 
In case of questions reach out to : @charlie-pichette @dkirchan

### Checklist

Delete any items that are not applicable to this PR.

- [ ] 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
- [ ] [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)


### Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to
identify risks that should be tested prior to the change/feature
release.

When forming the risk matrix, consider some of the following examples
and how they may potentially impact the change:

| Risk | Probability | Severity | Mitigation/Notes |

|---------------------------|-------------|----------|-------------------------|
| Multiple Spaces&mdash;unexpected behavior in non-default Kibana Space.
| Low | High | Integration tests will verify that all features are still
supported in non-default Kibana Space and when user switches between
spaces. |
| Multiple nodes&mdash;Elasticsearch polling might have race conditions
when multiple Kibana nodes are polling for the same tasks. | High | Low
| Tasks are idempotent, so executing them multiple times will not result
in logical error, but will degrade performance. To test for this case we
add plenty of unit tests around this logic and document manual testing
procedure. |
| Code should gracefully handle cases when feature X or plugin Y are
disabled. | Medium | High | Unit tests will verify that any feature flag
or plugin combination still results in our service operational. |
| [See more potential risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) |


### 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)
2023-10-16 18:34:29 +02:00
Gloria Hornero
40751c02c9
[Security Solution] Increasing parallelism for Serverless Security specific executions (#168928) 2023-10-16 08:07:12 -07:00
Alex Szabo
ef32c997b2
[Ops] Trigger Security Solution quality gate job instead of running it (#168921)
## Summary
Now that the security solution tests are moved to their own pipeline, we
can trigger it. It's also required because the job relies on the
Kibana-buildkite environment.

See: https://elastic.slack.com/archives/C05NJL80DB8/p1697233389455979
2023-10-16 15:15:34 +02:00
Luke Elmers
14a6e8928b
Relocate security solution QG soft fail to the correct place. (#168901)
In https://github.com/elastic/kibana/pull/168898, the `soft_fail` for
the security solution quality gate was accidentally added to the wrong
spot in the pipeline config. This fixes it per the [buildkite
docs](https://buildkite.com/docs/pipelines/command-step#soft-fail-attributes).
2023-10-13 15:42:07 -07:00
Luke Elmers
492a0746af
Allow security solution QA QGs to soft fail. (#168898)
Security solution's serverless QA quality gates which were added in
https://github.com/elastic/kibana/pull/167494 are failing when trying to
run cypress tests. I've marked them to soft fail here so we can unblock
the serverless release pipeline.

cc @watson @elastic/kibana-operations @MadameSheema @charlie-pichette
@YulNaumenko
2023-10-13 15:17:22 -07:00
Yara Tercero
6d3449162d
[Detection Engine][Cypress] Reenable and reorganize some detection_alerts and data_sources tests (#168426)
## Summary

#### Code update:
`/detection_engine/routes/signals/set_alert_tags_route.ts`
- When enabling the alert tags cypress test, noticed it was failing as
the tag updates did not show in the UI until a few seconds later upon a
second refresh. I was able to recreate this locally on serverless, not
on ESS. I updated the alerts tag route to include `refresh: true` and
that seemed to fix this issue.
- `/detection_engine/routes/signals/open_close_signals_route.ts`
- When testing on serverless, alert status was stale after update.
Confirmed this with tests that were failing for ESS. Upon updating route
to use `refresh: true`, tests began passing and could see expected
behavior. This may make the call a bit heavier so we will want to see if
there are any performance impacts.
2023-10-13 12:34:58 -07:00
Gloria Hornero
aa270794ae
[Security Solution] Adding serverlessQA tag (#167494)
## Summary

Currently, we have our cypress tests properly integrated with the first
quality gate. 


In this quality gate, our tests are executed as part of the PR process
using the serverless FTR environment. This environment uses the latest
elasticsearch snapshot and the kibana source code, but it is not a real
serverless environment because is not a deployed project on the cloud.

In order to continue assuring that we don’t introduce new issues, we
want to execute automated tests in the second quality gate as well. The
second quality gate is a deployed serverless project in the QA
environment.

We want to start moving slowly in that direction and at the same time
make sure we don't introduce flakiness, and the tests perform well.

In this PR we are creating the `@serverlessQA` tag. Tests including that
label will be executed on the second quality gate. 
We are also adding
the label to one of the tests we know that is stable in serverless to
test the full integration.

Note that currently, we have some known limitations in this gate pending
to be solved and we are working on it:
- Execution of the tests is sequential
- No differentiation between teams during the execution is done over the
AET umbrella
- The environment is set in `complete` so tests that exercise the
`essential` behaviour should not be added.
- Please ping me in case you want to add more tests into that gate to
asses the risk before we have the gate tested and all the serverless
tests stabilized.

---------

Co-authored-by: Georgii Gorbachev <banderror@gmail.com>
Co-authored-by: dkirchan <diamantis.kirchantzoglou@elastic.co>
2023-10-13 18:38:47 +03:00
Kevin Delemme
194f130b60
chore(slo): remove composite slo code (#168481) 2023-10-13 10:41:29 -04:00
Thomas Watson
5fc8429065
[serverless] Remove manual gate in Prod quality gate (#168474) 2023-10-13 15:39:56 +02:00
Thomas Watson
594705aef1
[serverless] move SLO quality gate check to Prod (#168471) 2023-10-13 15:39:15 +02:00
Thomas Watson
6220ee2dcc
[serverless] Don't run e2e tests before promoting to QA (#168596) 2023-10-13 15:36:56 +02:00
Kevin Logan
adc9d43c84
[EDR Workflows] Add defend workflows cypress tests to flaky test runner (#168723)
## Summary

Adds defend workflows tests to the flaky test runner, see example runs
below from https://ci-stats.kibana.dev/trigger_flaky_test_runner/1

Select defend tests:
<img width="1728" alt="image"
src="20558897-8683-4f8f-bef0-b34d66a7ca22">

Regular:
<img width="1725" alt="image"
src="29708f46-2ff3-4eca-ac4b-e21e5f9a0bb4">

Serverless:
<img width="1728" alt="image"
src="b8a274d5-4a7e-4b3f-bc59-92c421f2207c">

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-10-12 13:07:49 -07:00
Thomas Watson
b26f58292c
[serverless] Split prod quality gate env into prod-canary/noncanary (#168462) 2023-10-12 13:41:22 +02:00
Wafaa Nasr
650c156b76
[Security Solution][Detection Engine] Running API tests in Serverless using Mocha Tagging (#166755)
# Summary

- Addresses https://github.com/elastic/kibana/issues/161537

## Description 

- This PR follows the second option defined in this
[document](https://docs.google.com/document/d/1mqkpjDdFQRFvx_RPvNmjstVj8SXYMr2mrETMv3esda8/edit#heading=h.rpv1zyeb04ay)
the [Mocha tagging ](https://github.com/mochajs/mocha/wiki/Tagging)
- It introduces a new folder
`x-pack/test/security_solution_api_integration` which will serve as a
centralized location to meet all the requirements related to renaming
tests appropriately and grouping similar tests together. It will
facilitate the management of tests that must be run in Serverless and
ESS environments.

- Within this folder, there is a "config" subdirectory that stores base
configurations specific to both the
[Serverless](https://github.com/elastic/kibana/pull/166755/files#diff-afe1f42d5ac2006de8dc09069448b9e8734a6a950586376cd6e8eeb9110ab5f1R1)
and
[ESS](https://github.com/elastic/kibana/pull/166755/files#diff-4a60bd8c91da08a3f7ec14bf3bfef8449af155611374c32579b0318da03e292cR1)
environments, These configurations build upon the base configuration
provided by test_serverless and api_integrations, incorporating
additional settings such as environment variables and tagging options.

- It demonstrates scenarios involving `@ess`, `@serverless`, and
`@brokenInServerless`.


- The file`
x-pack/test/security_solution_api_integration/test_suites/detections_response/rule_creation/create_rules.ts`
is functional in both **Serverless** and **ESS**. However, some tests
related to roles are currently skipped for Serverless until they are
resolved, and these tests are tagged with `@brokenInServerless`

![image](93ad5698-8776-40c4-875d-3308fedd11cb)


## CI 

- It includes a new entry in the ftr_configs.yml to execute the newly
added tests in the pipeline.


- It involves the addition of mochaOptions in both
serverless/config.base.ts and ess/config.base.ts. In the case of
serverless, it includes **@serverless** while excluding
@brokenInServerless. Similarly, for **ess**, it includes @ess and
excludes **@brokenInEss**.

from `x-pack/test/security_solution_api_integration/config/serverless` 

![image](9413ba0f-0384-4125-a1a9-7108211f4848)


## Update in x-pack/test/detection_engine_api_integration

- The `create_rules.ts` and `create_rule_exceptions` files have been
relocated from
`x-pack/test/detection_engine_api_integration/security_and_spaces/group1`
to their respective domains within the
`x-pack/test/security_solution_api_integration` folder.

- The util files now are copied over from the old folder
`x-pack/test/detection_engine_api_integration` to the new folder and
will be removed once all tests are moved to the new folder to don't
break the existing tests

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-10-11 12:38:14 +02:00
Alex Szabo
3a48bc9289
[Ops] ES Serverless verification: tag based filtering (#168374)
## Summary
Allows for env-var controlled filtering of executed test suites in the
ES Serverless verification job, and adjusts existing flags and behaviour
to better-fit future usage.

We're changing the job to not publish the `latest-verified` tag by
default. This is to prevent external calls to the job from accidentally
promoting random tags to `latest-verified`, see changes below.

Flag changes: 
- `PUBLISH_DOCKER_TAG`: if set to 1/true, passing runs will promote the
tested ES Serverless tag to `latest-verified`.
   - (used to be default, now it requires this flag)
- `PUBLISH_MANIFEST`: if set to 1/true, passing runs will upload the
manifest attesting what (kibana + es) combination was used in the test
   - (used to be called `UPLOAD_MANIFEST`)
- `SKIP_CYPRESS`: if set to 1/true, it will skip running the cypress
tests
   - new flag
- `FTR_EXTRA_ARGS`: a string argument, if passed, it will be forwarded
verbatim to the FTR run script
- new flag, can be used to control the filtering required for #167611
(eg.: `FTR_EXTRA_ARGS="--include-tag=ml"`)

Example run:

https://buildkite.com/elastic/kibana-elasticsearch-serverless-verify-and-promote/builds/64#018b1a30-3360-4995-874a-864f18e104d5

Closes: #168376
2023-10-11 09:49:46 +02:00
Alex Szabo
ec0379848a
[Ops] Snapshot saved object migrations (#167983)
## Goal
We'd like to increase visibility to when Saved Object migrations and
schema changes are added to serverless releases.

## Plan
- add post-build step to export Saved Object schema snapshot, upload it
to google storage, by commit hash.
- build comparison logic, that when given 2 hashes (e.g.: #current ->
#to-be-released) it can highlight schema changes
- display the output from the comparison where it would make most sense,
ideas:
- prior to release, as a script that can be ran (or a browser-based
inspector)
- prior to release, as a buildkite step, that displays the output, and
waits for a confirmation on it
- during the quality-gating, as an output during the quality-gate run,
to be confirmed by the RM

## Summary
The PR intends to satisfy the first step of the plan, to add a
post-merge step to snapshot SO schema/migration states for later use.
 

Example run:
https://buildkite.com/elastic/kibana-pull-request/builds/165992#018b0583-c575-47f4-bade-7b45f6cf3f4d
The files are not public, they require google cloud access, but could be
accessed by scripts we create.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-10-11 09:47:15 +02:00
Maxim Kholod
ae075848e8
[Cloud Security] add first cloud security e2e test for serverless (#167309) 2023-10-10 09:45:10 -07:00
Julia Rechkunova
570963b07b
[Discover] Unskip flaky field token tests (#168130)
- Closes https://github.com/elastic/kibana/issues/168115

This PR unskips the flaky test and also extracts other tests from
`discover/group2` into a new `discover/group4`.

100x group2
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3390
100x group4
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3386
2023-10-10 11:25:12 +02:00
Tiago Costa
e29f72f021
fix(NA): security solution storybook build (#168043) 2023-10-09 17:05:38 -05:00
Konrad Szwarc
be26b7d7bc
[EDR Workflows] Flaky CY e2e tests (#167870)
This pull request tackles flaky `artifacts.cy.ts` e2e test. Ran 7+ times
without flakiness in CI.

Added Test Burning to Defend Workflows pipeline.

Changed:
1. Removed `.first()` selectors in favour of explicit element getters
2. Removed method chain
3. Moved url change from `before` to test body.
4. In `beforeAll` now we first fetch current revision number, then run
`Promise.all` on `removeAllArtifacts` which resolves with `true/false`
based on whether they actually removed an artifact. Its being counted
then and with this number we know what next revision should be (revision
fetched before removal + times removal was successful). We query API
recursively until revisions match and only then we can be sure that
displayed in the UI revision is up to date. This fixes the main reason
of the flakiness of this test and makes it a pure test that should
always yield the same result no matter the number of runs.

---------

Co-authored-by: Patryk Kopyciński <contact@patrykkopycinski.com>
2023-10-09 02:21:02 -07:00
Dzmitry Lemechko
d05349bf5f
[ftr] split serverless config to speedup test run on CI (#168195)
## Summary

After [164798](https://github.com/elastic/kibana/pull/164798) was merged
CI singnificantly slowed down because f these FTR groups:

```
x-pack/test_serverless/functional/test_suites/security/common_configs/config.group2.ts: 75.6 minutes
x-pack/test_serverless/functional/test_suites/search/common_configs/config.group2.ts: 75 minutes
x-pack/test_serverless/functional/test_suites/observability/common_configs/config.group2.ts: 74.7 minutes
```

This PR splits each group into 3.
2023-10-06 13:23:11 -07:00
Robert Austin
ea0a1a073e
Enable Security's Cypress tests on all PRs (#167516)
## Summary

Security Solution writes e2e and other tests using Cypress. In the past,
these tests, if they failed on a tracked branch, couldn't be easily
skipped. They also weren't run in parallelized jobs. For primarily these
reasons, they didn't run on most Kibana PRs.

This PR moves these Cypress tests back to the main PR pipeline. Tests
that fail on tracked branches create (or update) Github issues which can
be used with the skip-test github workflow script to easily skip the
failing tests. The pipeline steps are parallelized and run in under 40
minutes.

### Open Questions

- [ ] Should this PR enable Serverless Security Defend Workflows Cypress
Tests @patrykkopycinski

### Some buildkite pipelines that used to run only on Security PRs now
run on all PRs:

These steps run on all PRs with these changes

- Security Solution Cypress Tests (general tests that haven't been
organized into an area team)
- Explore tests
- Investigations Tests
- Defend Workflows Tests
- Defend Workflows Serverless
- Threat Intel Tests
- OS Query Tests
- Security Solution Burning Changed Specs (these run only recently
changed specs a few extra times)
- Security Solution OpenAPI codegen
- OSQuery burning
- OSQuery Serverless

<details>
  <summary><b>And these already run on all PRs</b></summary>

  - Serverless Security Cypress Tests
  - Serverless Explore tests
  - Serverless Investigations Tests
</details>

### Security Cypress tests run in the main `on merge` pipeline instead
of the `on merge unsupported ftrs` pipeline:

These steps run in the `on merge` pipeline with these changes:

- Security Solution Cypress Tests
- Explore Cypress Tests
- Investigations Cypress Tests
- Defend Workflows Cypress Tests
- Defend Workflows Serverless Cypress Tests
- Threat Intelligence Cypress Tests
- Osquery Cypress Tests

<details>
<summary><b>and these already run on the `on merge`
pipeline</b></summary>

- Serverless Security Cypress Tests
- Serverless Explore - Security Solution Cypress Tests
- Serverless Investigations - Security Solution Cypress Tests

</details>

### Additional work to be done:

We need to consolidate build steps, enhance test skipping to support
Cypress-grep flags, avoid out-of-memory errors in cypress, enhance
parallelization, improve Cypress reporting, and probably other things.
These are tracked separately. Reach out to me if you need details.

### 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)
2023-10-06 17:58:31 +02:00
Tiago Costa
7bb722862b
chore(NA): use a n2-8-spot instance to build storybooks on prs as well (#168154)
This PR makes sure we use the more capable machine to build storybooks
on PRs as well.
2023-10-06 13:49:24 +01:00