-
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.
fixed bug with comparing upgrade version with snapshot kibana version (…
…#139007) Co-authored-by: Kibana Machine <[email protected]>
- Loading branch information
1 parent
3f58b47
commit 2fab204
Showing
2 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
x-pack/plugins/fleet/server/routes/agent/upgrade_handler.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,26 @@ | ||
/* | ||
* 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; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { checkKibanaVersion } from './upgrade_handler'; | ||
|
||
describe('upgrade handler', () => { | ||
describe('checkKibanaVersion', () => { | ||
it('should not throw if upgrade version is equal to kibana version', () => { | ||
expect(() => checkKibanaVersion('8.4.0', '8.4.0')).not.toThrowError(); | ||
}); | ||
|
||
it('should throw if upgrade version is higher than kibana version', () => { | ||
expect(() => checkKibanaVersion('8.5.0', '8.4.0')).toThrowError( | ||
'cannot upgrade agent to 8.5.0 because it is higher than the installed kibana version 8.4.0' | ||
); | ||
}); | ||
|
||
it('should not throw if upgrade version is equal to kibana version with snapshot', () => { | ||
expect(() => checkKibanaVersion('8.4.0', '8.4.0-SNAPSHOT')).not.toThrowError(); | ||
}); | ||
}); | ||
}); |
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