Skip to content

Commit

Permalink
[Security Solution] Adds serverlessQA tag to the Cypress tests (#17…
Browse files Browse the repository at this point in the history
…9737)

## Summary

We want to start integrating our Cypress tests with the serverless
Kibana quality gate. However, not all the teams feel comfortable
enabling all the tests, to facilitate the effort of enabling tests in
the quality gate we are adding the `@serverlessQA` tag.

Once this PR is merged, the behavior will be the following:

**Regular PR flow**

All the tests tagged as `@serverless` will be executed as part of the PR
validation process using the serverless FTR environment (not a real
one).

If you want to skip a test to be executed in this flow use
`@brokenInServerless` or `@skipInServerless`.

**Periodic pipeline**

All the tests tagged as `@serverless` will be executed as part of the
periodic pipeline using a real serverless project. QA environment is
used to do so using the latest available commit in main at the time of
the execution.

If you want to skip a test to be executed in this flow use
`@brokenInServerlessQA`.

**Kibana second quality gate**

All the tests tagged as `@serverlessQA` will be executed as part of the
kibana release process using a real serverless project with the latest
image available in the QA environment.

If you want to skip a test to be executed in this flow use
`@brokenInServerlessQA`.
  • Loading branch information
MadameSheema authored Apr 8, 2024
1 parent 0527f48 commit 07a83d6
Show file tree
Hide file tree
Showing 43 changed files with 259 additions and 261 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -459,10 +459,16 @@ ${JSON.stringify(argv, null, 2)}
`);

const isOpen = argv._.includes('open');

const cypressConfigFilePath = require.resolve(`../../${argv.configFile}`) as string;
const cypressConfigFile = await import(cypressConfigFilePath);

// KIBANA_MKI_USE_LATEST_COMMIT === 1 means that we are overriding the image for the periodic pipeline execution.
// We don't override the image when executing the tests on the second quality gate.
if (
!process.env.KIBANA_MKI_USE_LATEST_COMMIT ||
process.env.KIBANA_MKI_USE_LATEST_COMMIT !== '1'
) {
cypressConfigFile.env.grepTags = '@serverlessQA --@skipInServerless';
}
const tier: string = argv.tier;
const endpointAddon: boolean = argv.endpointAddon;
const cloudAddon: boolean = argv.cloudAddon;
Expand Down
8 changes: 4 additions & 4 deletions x-pack/test/security_solution_cypress/cypress/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ Please, before opening a PR with the new test, please make sure that the test fa

Note that we use tags in order to select which tests we want to execute:

- `@serverless` includes a test in the Serverless test suite for PRs (the so-called first quality gate) and QA environemnt (the so-called second quality gate). You need to explicitly add this tag to any test you want to run in CI for serverless.
- `@serverless` includes a test in the Serverless test suite for PRs (the so-called first quality gate) and QA environment for the periodic pipeline. You need to explicitly add this tag to any test you want to run in CI for serverless.
- `@serverlessQA` includes a test in the Serverless test suite for the Kibana release process of serverless. You need to explicitly add this tag to any test you want yo run in CI for the second quality gate. These tests should be stable, otherviswe they will be blocking the release pipeline. They should be alsy critical enough, so that when they fail, there's a high chance of an SDH or blocker issue to be reported.
- `@ess` includes a test in the normal, non-Serverless test suite. You need to explicitly add this tag to any test you want to run against a non-Serverless environment.
- `@brokenInServerless` excludes a test from the Serverless test suite (even if it's tagged as `@serverless`). Indicates that a test should run in Serverless, but currently is broken.
- `@brokenInServerlessQA` excludes a test form the Serverless QA enviornment (second quality gate). Indicates that a test should run on it, but currently is broken.
- `@skipInServerless` excludes a test from the Serverless test suite (even if it's tagged as `@serverless`). Could indicate many things, e.g. "the test is flaky in Serverless", "the test is Flaky in any type of environemnt", "the test has been temporarily excluded, see the comment above why".
- `@skipInEss` excludes a test from the non-Serverless test suite. The test will not be executed as part for the PR process. All the skipped tests should have a link to a ticket describing the reason why the test got skipped.
- `@skipInServerless` excludes a test from the Serverless test suite and Serverless QA environment for both, periodic pipeline and second quality gate (even if it's tagged as `@serverless`). Could indicate many things, e.g. "the test is flaky in Serverless", "the test is Flaky in any type of environment", "the test has been temporarily excluded, see the comment above why". All the skipped tests should have a link to a ticket describing the reason why the test got skipped.

Please, before opening a PR with a new test, make sure that the test fails. If you never see your test fail you don’t know if your test is actually testing the right thing, or testing anything at all.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default defineCypressConfig({
defaultCommandTimeout: 60000,
env: {
grepFilterSpecs: true,
grepTags: '@ess',
grepTags: '@ess --@skipInEss',
},
execTimeout: 60000,
pageLoadTimeout: 60000,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default defineCypressConfig({
env: {
grepFilterSpecs: true,
grepOmitFiltered: true,
grepTags: '@ess',
grepTags: '@ess --@skipInEss',
},
execTimeout: 150000,
pageLoadTimeout: 150000,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default defineCypressConfig({
env: {
grepFilterSpecs: true,
grepOmitFiltered: true,
grepTags: '@serverless --@brokenInServerless --@skipInServerless',
grepTags: '@serverless --@skipInServerless',
},
execTimeout: 150000,
pageLoadTimeout: 150000,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default defineCypressConfig({
env: {
grepFilterSpecs: true,
grepOmitFiltered: true,
grepTags: '@serverless --@brokenInServerless --@skipInServerless --@brokenInServerlessQA',
grepTags: '@serverless --@skipInServerless',
},
execTimeout: 300000,
pageLoadTimeout: 300000,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default defineCypressConfig({
numTestsKeptInMemory: 10,
env: {
grepFilterSpecs: true,
grepTags: '@serverless --@brokenInServerless --@skipInServerless',
grepTags: '@serverless --@skipInServerless',
},
e2e: {
experimentalCspAllowList: ['default-src', 'script-src', 'script-src-elem'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const waitForPageTitleToBeShown = () => {
// FLAKY: https://github.com/elastic/kibana/issues/178176
describe.skip(
'Detections > Callouts',
{ tags: ['@ess', '@serverless', '@brokenInServerlessQA'] },
{ tags: ['@ess', '@serverless', '@skipInServerless'] },
() => {
before(() => {
// First, we have to open the app on behalf of a privileged user in order to initialize it.
Expand Down
Loading

0 comments on commit 07a83d6

Please sign in to comment.