diff --git a/.buildkite/scripts/steps/checks.sh b/.buildkite/scripts/steps/checks.sh index 92ae1f5eadca3..639e3f02ef1df 100755 --- a/.buildkite/scripts/steps/checks.sh +++ b/.buildkite/scripts/steps/checks.sh @@ -22,5 +22,6 @@ export DISABLE_BOOTSTRAP_VALIDATION=false .buildkite/scripts/steps/checks/test_hardening.sh .buildkite/scripts/steps/checks/ftr_configs.sh .buildkite/scripts/steps/checks/saved_objects_compat_changes.sh +.buildkite/scripts/steps/checks/saved_objects_definition_change.sh .buildkite/scripts/steps/code_generation/security_solution_codegen.sh .buildkite/scripts/steps/checks/yarn_deduplicate.sh diff --git a/.buildkite/scripts/steps/checks/saved_objects_definition_change.sh b/.buildkite/scripts/steps/checks/saved_objects_definition_change.sh new file mode 100755 index 0000000000000..175128d536fd5 --- /dev/null +++ b/.buildkite/scripts/steps/checks/saved_objects_definition_change.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +set -euo pipefail + +source .buildkite/scripts/common/util.sh + +echo --- Check SO definition changes +cmd="node scripts/jest_integration -u src/core/server/integration_tests/ci_checks" + +eval "$cmd" +check_for_changed_files "$cmd" true diff --git a/src/core/server/integration_tests/ci_checks/jest.integration.config.js b/src/core/server/integration_tests/ci_checks/jest.integration.config.js new file mode 100644 index 0000000000000..cca8ea704bb8d --- /dev/null +++ b/src/core/server/integration_tests/ci_checks/jest.integration.config.js @@ -0,0 +1,20 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + bail: true, // only report 1 issue + // TODO replace the line below with + // preset: '@kbn/test/jest_integration_node + // to do so, we must fix all integration tests first + // see https://github.com/elastic/kibana/pull/130255/ + preset: '@kbn/test/jest_integration', + rootDir: '../../../../..', + roots: ['/src/core/server/integration_tests/ci_checks'], + // must override to match all test given there is no `integration_tests` subfolder + testMatch: ['**/*.test.{js,mjs,ts,tsx}'], +}; diff --git a/src/core/server/integration_tests/saved_objects/migrations/group2/check_registered_types.test.ts b/src/core/server/integration_tests/ci_checks/saved_objects/check_registered_types.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/group2/check_registered_types.test.ts rename to src/core/server/integration_tests/ci_checks/saved_objects/check_registered_types.test.ts