-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into cases-files-be
- Loading branch information
Showing
54 changed files
with
523 additions
and
229 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
packages/core/node/core-node-server-internal/src/node_config.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
import { rolesConfig } from './node_config'; | ||
|
||
describe('rolesConfig', () => { | ||
test('default', () => { | ||
expect(rolesConfig.validate(undefined)).toEqual(['*']); | ||
}); | ||
test('empty', () => { | ||
expect(() => rolesConfig.validate([])).toThrow(); | ||
}); | ||
test('"ui" and "background_tasks" roles are allowed and can be combined', () => { | ||
expect(() => rolesConfig.validate(['ui', 'background_tasks'])).not.toThrow(); | ||
expect(() => rolesConfig.validate(['ui'])).not.toThrow(); | ||
expect(() => rolesConfig.validate(['background_tasks'])).not.toThrow(); | ||
}); | ||
test('exlcusive "*"', () => { | ||
const wildcardError = `wildcard ("*") cannot be used with other roles or specified more than once`; | ||
expect(() => rolesConfig.validate(['*'])).not.toThrow(); | ||
|
||
expect(() => rolesConfig.validate(['*', 'ui'])).toThrow(wildcardError); | ||
expect(() => rolesConfig.validate(['*', '*'])).toThrow(wildcardError); | ||
|
||
expect(() => rolesConfig.validate(['*', 'unknown'])).toThrow(); | ||
}); | ||
test('exlcusive "migrator"', () => { | ||
const migratorError = `"migrator" cannot be used with other roles or specified more than once`; | ||
expect(() => rolesConfig.validate(['migrator'])).not.toThrow(); | ||
|
||
expect(() => rolesConfig.validate(['migrator', 'ui'])).toThrow(migratorError); | ||
expect(() => rolesConfig.validate(['migrator', 'migrator'])).toThrow(migratorError); | ||
|
||
expect(() => rolesConfig.validate(['migrator', 'unknown'])).toThrow(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...-migration-server-internal/src/__snapshots__/migrations_state_action_machine.test.ts.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.