Skip to content

Commit

Permalink
Fix osquery cypress tests (#163988)
Browse files Browse the repository at this point in the history
## Summary

Adjust tests to #161614
Split tests into smaller files to better utilize parallelization and
increase the stability of tests

(cherry picked from commit fd33ed5)
  • Loading branch information
patrykkopycinski committed Aug 18, 2023
1 parent 2b5b603 commit 972fb20
Show file tree
Hide file tree
Showing 20 changed files with 1,628 additions and 1,662 deletions.
10 changes: 10 additions & 0 deletions .buildkite/pipelines/pull_request/osquery_cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,13 @@ steps:
limit: 1
artifact_paths:
- "target/kibana-osquery/**/*"

- command: .buildkite/scripts/steps/functional/osquery_cypress_burn.sh
label: 'Osquery Cypress Tests, burning changed specs'
agents:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 50
soft_fail: true
artifact_paths:
- "target/kibana-osquery/**/*"
4 changes: 3 additions & 1 deletion .buildkite/scripts/pipelines/pull_request/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ const uploadPipeline = (pipelineContent: string | object) => {
getPipeline('.buildkite/pipelines/pull_request/security_solution_explore.yml')
);
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/defend_workflows.yml'));
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/osquery_cypress.yml'));
}

if (
Expand Down Expand Up @@ -200,7 +201,8 @@ const uploadPipeline = (pipelineContent: string | object) => {

pipeline.push(getPipeline('.buildkite/pipelines/pull_request/post_build.yml'));

uploadPipeline(pipeline.join('\n'));
// remove duplicated steps
uploadPipeline([...new Set(pipeline)].join('\n'));
} catch (ex) {
console.error('PR pipeline generation error', ex.message);
process.exit(1);
Expand Down
17 changes: 17 additions & 0 deletions .buildkite/scripts/steps/functional/osquery_cypress_burn.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

set -euo pipefail

source .buildkite/scripts/common/util.sh
source .buildkite/scripts/steps/functional/common_cypress.sh

.buildkite/scripts/bootstrap.sh
node scripts/build_kibana_platform_plugins.js

export JOB=kibana-osquery-cypress

buildkite-agent meta-data set "${BUILDKITE_JOB_ID}_is_test_execution_step" 'false'

echo "--- Osquery Cypress tests, burning changed specs (Chrome)"

yarn --cwd x-pack/plugins/osquery cypress:changed-specs-only
2 changes: 1 addition & 1 deletion x-pack/plugins/osquery/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ export default defineCypressConfig({
baseUrl: 'http://localhost:5601',
experimentalRunAllSpecs: true,
experimentalMemoryManagement: true,
numTestsKeptInMemory: 10,
numTestsKeptInMemory: 3,
},
});
Loading

0 comments on commit 972fb20

Please sign in to comment.