-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TIP] Run e2e pipeline on CI (#144776)
## Summary Last week, our team has dicovered that e2e tests are not executed on CI, this PR is an attempt to fix that. Threat intel pipeline should be run whenever the `threat_intelligence` plugin source or related tests config has changed.
- Loading branch information
Showing
12 changed files
with
133 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
steps: | ||
- command: .buildkite/scripts/steps/functional/threat_intelligence.sh | ||
label: 'Threat Intelligence Tests' | ||
agents: | ||
queue: ci-group-6 | ||
depends_on: build | ||
timeout_in_minutes: 120 | ||
parallelism: 4 | ||
retry: | ||
automatic: | ||
- exit_status: '*' | ||
limit: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
.buildkite/scripts/steps/functional/threat_intelligence.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
source .buildkite/scripts/steps/functional/common.sh | ||
|
||
export JOB=kibana-threat-intelligence-chrome | ||
export CLI_NUMBER=${CLI_NUMBER:-$((BUILDKITE_PARALLEL_JOB+1))} | ||
export CLI_COUNT=${CLI_COUNT:-$BUILDKITE_PARALLEL_JOB_COUNT} | ||
|
||
echo "--- Threat Intelligence tests (Chrome)" | ||
|
||
node scripts/functional_tests \ | ||
--debug --bail \ | ||
--kibana-install-dir "$KIBANA_BUILD_LOCATION" \ | ||
--config x-pack/test/threat_intelligence_cypress/cli_config_parallel.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
x-pack/plugins/threat_intelligence/cypress/reporter_config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"reporterEnabled": "mochawesome, mocha-junit-reporter", | ||
"reporterOptions": { | ||
"html": false, | ||
"json": true, | ||
"mochaFile": "../../../target/kibana-threat-intelligence/cypress/results/TEST-threat-intelligence-cypress-[hash].xml", | ||
"overwrite": false, | ||
"reportDir": "../../../target/kibana-threat-intelligence/cypress/results" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 0 additions & 6 deletions
6
x-pack/plugins/threat_intelligence/cypress/support/commands.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
x-pack/test/threat_intelligence_cypress/cli_config_parallel.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { FtrConfigProviderContext } from '@kbn/test'; | ||
import { FtrProviderContext } from './ftr_provider_context'; | ||
|
||
import { ThreatIntelligenceCypressCliTestRunnerCI } from './runner'; | ||
|
||
const cliNumber = parseInt(process.env.CLI_NUMBER ?? '1', 10); | ||
const cliCount = parseInt(process.env.CLI_COUNT ?? '1', 10); | ||
|
||
// eslint-disable-next-line import/no-default-export | ||
export default async function ({ readConfigFile }: FtrConfigProviderContext) { | ||
const securitySolutionCypressConfig = await readConfigFile(require.resolve('./config.ts')); | ||
return { | ||
...securitySolutionCypressConfig.getAll(), | ||
|
||
testRunner: (context: FtrProviderContext) => | ||
ThreatIntelligenceCypressCliTestRunnerCI(context, cliCount, cliNumber), | ||
}; | ||
} |