Skip to content

Commit

Permalink
Fixes inconsistent plugin installation tests
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 opensearch-project#1316.

Signed-off-by: Tommy Markley <[email protected]>
  • Loading branch information
Tommy Markley committed Mar 17, 2022
1 parent 3c7e8d5 commit 0a4fe56
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 0a4fe56

Please sign in to comment.