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

Signed-off-by: Miki <[email protected]>
  • Loading branch information
AMoo-Miki committed Dec 1, 2022
1 parent f44ec7c commit 7dc8047
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 7dc8047

Please sign in to comment.