Skip to content

Commit

Permalink
[CI] automatically commit SO def change snapshot (elastic#169610)
Browse files Browse the repository at this point in the history
Fix elastic#147935

Automatically run the SO def integration test, and commit the changes if
any, as a new CI check script.

As explained in the issue, this is just some DX improvement, avoiding
for the developer the inconvenience of doing it manually every time they
change or add a SO in any PR.
  • Loading branch information
pgayvallet authored Oct 25, 2023
1 parent 9816126 commit c303263
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions .buildkite/scripts/steps/checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 11 additions & 0 deletions .buildkite/scripts/steps/checks/saved_objects_definition_change.sh
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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: ['<rootDir>/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}'],
};

0 comments on commit c303263

Please sign in to comment.