From 1c3d145fa043e4e4dc7794c172c043bb5fd9059f Mon Sep 17 00:00:00 2001 From: Adam Kolodziejczyk Date: Wed, 9 Oct 2024 14:32:08 +0200 Subject: [PATCH] remove support for node 14 and 16 --- .github/workflows/build-test.yml | 4 +- ci/container/test_component.sh | 7 --- ci/test_windows.bat | 8 --- .../json_credential_manager_test.js | 54 ++++++++----------- 4 files changed, 25 insertions(+), 48 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index b24051f95..003b44cbf 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -49,7 +49,7 @@ jobs: fail-fast: false matrix: cloud: [ 'AWS', 'AZURE', 'GCP' ] - nodeVersion: [ '14.x', '16.x', '18.x', '20.x'] + nodeVersion: ['18.x', '20.x'] steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v3 @@ -87,7 +87,7 @@ jobs: fail-fast: false matrix: cloud: [ 'AWS', 'AZURE', 'GCP' ] - nodeVersion: [ '14.x', '16.x', '18.x', '20.x'] + nodeVersion: ['18.x', '20.x'] steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v3 diff --git a/ci/container/test_component.sh b/ci/container/test_component.sh index d52a56b79..28c62832e 100755 --- a/ci/container/test_component.sh +++ b/ci/container/test_component.sh @@ -30,13 +30,6 @@ npm install PACKAGE_NAME=$(cd $WORKSPACE && ls snowflake-sdk*.tgz) npm install $WORKSPACE/${PACKAGE_NAME} -# Since @azure lib has lost compatibility with node14 -#some dependencies have to be replaced by an older version -nodeVersion=$(node -v) -if [[ "$nodeVersion" == 'v14.'* ]]; then - npm install @azure/core-lro@2.6.0 -fi - echo "[INFO] Setting test parameters" if [[ "$LOCAL_USER_NAME" == "jenkins" ]]; then echo "[INFO] Use the default test parameters.json" diff --git a/ci/test_windows.bat b/ci/test_windows.bat index c6764a8ca..14265c3e6 100644 --- a/ci/test_windows.bat +++ b/ci/test_windows.bat @@ -55,14 +55,6 @@ echo [INFO] Installing Snowflake NodeJS Driver copy %GITHUB_WORKSPACE%\artifacts\* . for %%f in (snowflake-sdk*.tgz) do cmd /c npm install %%f -REM Since @azure lib has lost compatibility with node14 -REM some dependencies have to be replaced by an older version -FOR /F "tokens=* USEBACKQ" %%F IN (`node -v`) DO ( -SET nodeVersion=%%F -) -ECHO %nodeVersion% -if not x%nodeVersion:v14.=%==x%str1% cmd /c npm install @azure/core-lro@2.6.0 - if %ERRORLEVEL% NEQ 0 ( echo [ERROR] failed to install the Snowflake NodeJS Driver exit /b 1 diff --git a/test/unit/authentication/json_credential_manager_test.js b/test/unit/authentication/json_credential_manager_test.js index c0a882e98..0ffd353eb 100644 --- a/test/unit/authentication/json_credential_manager_test.js +++ b/test/unit/authentication/json_credential_manager_test.js @@ -13,37 +13,29 @@ const credType = 'mock_cred'; const key = Util.buildCredentialCacheKey(host, user, credType); const randomPassword = randomUUID(); const os = require('os'); -const currentNodeVersion = parseInt(process.version.slice(1), 10); -if (!(currentNodeVersion <= 14 && (os.platform() === 'win32'))) { - describe('Json credential manager test', function () { - const credentialManager = new JsonCredentialManager(); - - it('test - initiate credential manager', async function () { - if (await credentialManager.read(key) !== null) { - await credentialManager.remove(key); - } - const savedPassword = await credentialManager.read(key); - - assert.strictEqual(await credentialManager.getTokenDir(), path.join(os.homedir(), 'temporary_credential.json')); - assert.strictEqual(savedPassword, null); - }); - - it('test - write the mock credential with the credential manager', async function () { - await credentialManager.write(key, randomPassword); - const result = await credentialManager.read(key); - assert.strictEqual(randomPassword, result); - }); - - it('test - delete the mock credential with the credential manager', async function () { +describe('Json credential manager test', function () { + const credentialManager = new JsonCredentialManager(); + it('test - initiate credential manager', async function () { + if (await credentialManager.read(key) !== null) { await credentialManager.remove(key); - const result = await credentialManager.read(key); - assert.ok(result === null); - }); - - it('test - token saving location when the user sets credentialCacheDir value', async function () { - const credManager = new JsonCredentialManager(os.tmpdir()); - assert.strictEqual(await credManager.getTokenDir(), path.join(os.tmpdir(), 'temporary_credential.json')); - }); + } + const savedPassword = await credentialManager.read(key); + assert.strictEqual(await credentialManager.getTokenDir(), path.join(os.homedir(), 'temporary_credential.json')); + assert.strictEqual(savedPassword, null); + }); + it('test - write the mock credential with the credential manager', async function () { + await credentialManager.write(key, randomPassword); + const result = await credentialManager.read(key); + assert.strictEqual(randomPassword, result); + }); + it('test - delete the mock credential with the credential manager', async function () { + await credentialManager.remove(key); + const result = await credentialManager.read(key); + assert.ok(result === null); + }); + it('test - token saving location when the user sets credentialCacheDir value', async function () { + const credManager = new JsonCredentialManager(os.tmpdir()); + assert.strictEqual(await credManager.getTokenDir(), path.join(os.tmpdir(), 'temporary_credential.json')); }); -} \ No newline at end of file +});