[EDR Workflows] Add junit config to osquery cypress tests (#169060)

Co-authored-by: Patryk Kopyciński <contact@patrykkopycinski.com>
This commit is contained in:
Tomasz Ciecierski 2023-10-18 17:15:22 +02:00 committed by GitHub
parent 9a9c21bfa5
commit 69cfe3ac49
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 32 additions and 10 deletions

View file

@ -10,8 +10,6 @@ steps:
automatic:
- exit_status: '*'
limit: 1
artifact_paths:
- "target/kibana-osquery/**/*"
- command: .buildkite/scripts/steps/functional/security_serverless_osquery.sh
label: 'Serverless Osquery Cypress Tests'
@ -24,8 +22,6 @@ steps:
automatic:
- exit_status: '*'
limit: 1
artifact_paths:
- 'target/kibana-osquery/**/*'
- command: .buildkite/scripts/steps/functional/osquery_cypress_burn.sh
label: 'Osquery Cypress Tests, burning changed specs'
@ -36,5 +32,3 @@ steps:
soft_fail: true
retry:
automatic: false
artifact_paths:
- 'target/kibana-osquery/**/*'

View file

@ -14,6 +14,7 @@ if [[ "$IS_TEST_EXECUTION_STEP" == "true" ]]; then
buildkite-agent artifact upload 'target/kibana-coverage/functional/**/*'
buildkite-agent artifact upload 'target/kibana-*'
buildkite-agent artifact upload 'target/kibana-security-solution/**/*.png'
buildkite-agent artifact upload 'target/kibana-osquery/**/*.png'
buildkite-agent artifact upload 'target/kibana-fleet/**/*.png'
buildkite-agent artifact upload 'target/test-metrics/*'
buildkite-agent artifact upload 'target/test-suites-ci-plan.json'

View file

@ -2,10 +2,13 @@
set -euo pipefail
source .buildkite/scripts/common/util.sh
source .buildkite/scripts/steps/functional/common.sh
source .buildkite/scripts/steps/functional/common_cypress.sh
.buildkite/scripts/bootstrap.sh
# TODO: remove the line below to use build artifacts for tests.
# in addition to remove the line, we will have to expose the kibana install dir into the downloaded build location
# by exporting a var like:
# export KIBANA_INSTALL_DIR=${KIBANA_BUILD_LOCATION}
node scripts/build_kibana_platform_plugins.js
export JOB=kibana-osquery-cypress
@ -14,4 +17,5 @@ echo "--- Osquery Cypress tests"
cd x-pack/plugins/osquery
yarn --cwd x-pack/plugins/osquery cypress:run
set +e
yarn cypress:run; status=$?; yarn junit:merge || :; exit $status

View file

@ -15,4 +15,7 @@ export JOB=kibana-osquery-cypress-serverless
echo "--- Security Osquery Serverless Cypress"
yarn --cwd x-pack/plugins/osquery cypress:serverless:run
cd x-pack/plugins/osquery
set +e
yarn cypress:serverless:run; status=$?; yarn junit:merge || :; exit $status

View file

@ -20,6 +20,11 @@ const ROLES_YAML_FILE_PATH = path.join(
const roleDefinitions = loadYaml(readFileSync(ROLES_YAML_FILE_PATH, 'utf8')) as YamlRoleDefinitions;
export default defineCypressConfig({
reporter: '../../../node_modules/cypress-multi-reporters',
reporterOptions: {
configFile: './cypress/reporter_config.json',
},
defaultCommandTimeout: 60000,
execTimeout: 120000,
pageLoadTimeout: 12000,

View file

@ -0,0 +1,10 @@
{
"reporterEnabled": "mochawesome, mocha-junit-reporter",
"reporterOptions": {
"html": false,
"json": true,
"mochaFile": "../../../target/kibana-osquery/cypress/results/TEST-osquery-cypress-[hash].xml",
"overwrite": false,
"reportDir": "../../../target/kibana-osquery/cypress/results"
}
}

View file

@ -10,6 +10,11 @@ import { setupUserDataLoader } from '../../../test_serverless/functional/test_su
// eslint-disable-next-line import/no-default-export
export default defineCypressConfig({
reporter: '../../../node_modules/cypress-multi-reporters',
reporterOptions: {
configFile: './cypress/reporter_config.json',
},
defaultCommandTimeout: 60000,
execTimeout: 60000,
pageLoadTimeout: 60000,