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) (#2999)

Signed-off-by: Miki <[email protected]>

Signed-off-by: Miki <[email protected]>
(cherry picked from commit ed92158)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent c039019 commit 96952e7
Showing 1 changed file with 6 additions and 3 deletions.
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 96952e7

Please sign in to comment.