Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds tests to ensure registered SO types aren't removed #207142

Merged
merged 7 commits into from
Jan 22, 2025
Prev Previous commit
Next Next commit
fix name to reflect equality check
TinaHeiligers committed Jan 21, 2025
commit 5dc727a05cc408145efab606ffa7943285769468
2 changes: 1 addition & 1 deletion src/core/packages/saved-objects/server-internal/index.ts
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ export {
MIGRATION_CLIENT_OPTIONS,
SavedObjectsService,
CoreSavedObjectsRouteHandlerContext,
MIN_SAVED_OBJECT_TYPES_COUNT,
SAVED_OBJECT_TYPES_COUNT,
} from './src';
export type {
InternalSavedObjectsServiceStart,
Original file line number Diff line number Diff line change
@@ -18,4 +18,4 @@ export type {
InternalSavedObjectsRequestHandlerContext,
InternalSavedObjectRouter,
} from './internal_types';
export { MIN_SAVED_OBJECT_TYPES_COUNT } from './object_types';
export { SAVED_OBJECT_TYPES_COUNT } from './object_types';
Original file line number Diff line number Diff line change
@@ -11,4 +11,4 @@ export { registerCoreObjectTypes } from './registration';

// set minimum number of registered saved objects to ensure no object types are removed after 8.8
// declared in internal implementation exclicilty to prevent unintended changes.
export const MIN_SAVED_OBJECT_TYPES_COUNT = 127 as const;
export const SAVED_OBJECT_TYPES_COUNT = 127 as const;
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ import {
createRootWithCorePlugins,
type TestElasticsearchUtils,
} from '@kbn/core-test-helpers-kbn-server';
import { MIN_SAVED_OBJECT_TYPES_COUNT } from '@kbn/core-saved-objects-server-internal';
import { SAVED_OBJECT_TYPES_COUNT } from '@kbn/core-saved-objects-server-internal';

describe('checking migration metadata changes on all registered SO types', () => {
let esServer: TestElasticsearchUtils;
@@ -188,6 +188,6 @@ describe('checking migration metadata changes on all registered SO types', () =>
"workplace_search_telemetry": "52b32b47ee576f554ac77cb1d5896dfbcfe9a1fb",
}
`);
expect(Object.keys(hashMap).length).toEqual(MIN_SAVED_OBJECT_TYPES_COUNT);
expect(Object.keys(hashMap).length).toEqual(SAVED_OBJECT_TYPES_COUNT);
});
});