Skip to content

Commit

Permalink
Makes tests covering plugin installation on cluster snapshots work ac…
Browse files Browse the repository at this point in the history
…ross platforms (#2994)

Signed-off-by: Miki <amoo_miki@yahoo.com>

Signed-off-by: Miki <amoo_miki@yahoo.com>
  • Loading branch information
AMoo-Miki authored Dec 1, 2022
1 parent f44ec7c commit ed92158
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- [Multi DataSource] Add unit test coverage for Update Data source management stack ([#2567](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2567))
- [BWC Tests] Add BWC tests for 2.5.0 ([#2890](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2890))
- Fix incorrect validation of time values in JUnit Reporter ([#2965](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2965))
- Make tests covering plugin installation on cluster snapshots work across platforms ([#2994](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2994))

## [2.x]

Expand Down
9 changes: 6 additions & 3 deletions packages/osd-opensearch/src/integration_tests/cluster.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,22 +293,25 @@ describe('#start(installPath)', () => {
});

describe('#installOpenSearchPlugins()', () => {
const pluginHelperCLI =
process.platform === 'win32' ? './bin/opensearch-plugin.bat' : './bin/opensearch-plugin';

it('install array of plugins on cluster snapshot', async () => {
const cluster = new Cluster({ log });
await cluster.installOpenSearchPlugins('foo', ['foo1', 'foo2']);
expect(execa).toHaveBeenCalledTimes(2);
expect(execa).toHaveBeenCalledWith('./bin/opensearch-plugin', ['install', '--batch', 'foo1'], {
expect(execa).toHaveBeenCalledWith(pluginHelperCLI, ['install', '--batch', 'foo1'], {
cwd: 'foo',
});
expect(execa).toHaveBeenCalledWith('./bin/opensearch-plugin', ['install', '--batch', 'foo2'], {
expect(execa).toHaveBeenCalledWith(pluginHelperCLI, ['install', '--batch', 'foo2'], {
cwd: 'foo',
});
});
it('installs single plugin on cluster snapshot', async () => {
const cluster = new Cluster({ log });
await cluster.installOpenSearchPlugins('foo', 'foo1');
expect(execa).toHaveBeenCalledTimes(1);
expect(execa).toHaveBeenCalledWith('./bin/opensearch-plugin', ['install', '--batch', 'foo1'], {
expect(execa).toHaveBeenCalledWith(pluginHelperCLI, ['install', '--batch', 'foo1'], {
cwd: 'foo',
});
});
Expand Down

0 comments on commit ed92158

Please sign in to comment.