Skip to content

Commit

Permalink
Fixes inconsistent plugin installation tests (#1346) (#1508)
Browse files Browse the repository at this point in the history
* The tests assumed that the platform/architecture combo the tests were
  run from was always linux/x64.
* Introduced in #1316.

Signed-off-by: Tommy Markley <markleyt@amazon.com>
(cherry picked from commit 7aba935)

Co-authored-by: Tommy Markley <markleyt@amazon.com>
  • Loading branch information
opensearch-trigger-bot[bot] and Tommy Markley authored Apr 28, 2022
1 parent 7422ad6 commit 49ef208
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/cli_plugin/install/settings.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ describe('parse function', function () {
});

it('produces expected defaults', function () {
Object.defineProperties(process, {
platform: {
value: 'linux',
},
arch: {
value: 'x64',
},
});
expect(parse(command, { ...defaultOptions }, osdPackage)).toMatchInlineSnapshot(`
Object {
"config": "",
Expand All @@ -97,6 +105,14 @@ describe('parse function', function () {
});

it('consumes overrides', function () {
Object.defineProperties(process, {
platform: {
value: 'linux',
},
arch: {
value: 'x64',
},
});
const options = {
quiet: true,
silent: true,
Expand Down Expand Up @@ -129,7 +145,7 @@ describe('parse function', function () {
value: 'win32',
},
arch: {
value: ORIGINAL_ARCHITECTURE,
value: 'x64',
},
});
expect(() => parse(command, { ...defaultOptions }, osdPackage)).toThrow(
Expand All @@ -140,7 +156,7 @@ describe('parse function', function () {
it('should not throw when on a non-x64 arch', function () {
Object.defineProperties(process, {
platform: {
value: ORIGINAL_PLATFORM,
value: 'linux',
},
arch: {
value: 'arm64',
Expand Down

0 comments on commit 49ef208

Please sign in to comment.