From 49ef2081f4b603f6b3519cd55360b2acfab6b951 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Thu, 28 Apr 2022 15:40:45 -0700 Subject: [PATCH] Fixes inconsistent plugin installation tests (#1346) (#1508) * 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 (cherry picked from commit 7aba935e8a503fbc1270d2128fbde4ea1c62cd46) Co-authored-by: Tommy Markley --- src/cli_plugin/install/settings.test.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/cli_plugin/install/settings.test.js b/src/cli_plugin/install/settings.test.js index 0808ddf03cdc..63375dd18723 100644 --- a/src/cli_plugin/install/settings.test.js +++ b/src/cli_plugin/install/settings.test.js @@ -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": "", @@ -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, @@ -129,7 +145,7 @@ describe('parse function', function () { value: 'win32', }, arch: { - value: ORIGINAL_ARCHITECTURE, + value: 'x64', }, }); expect(() => parse(command, { ...defaultOptions }, osdPackage)).toThrow( @@ -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',