Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNOW-952788 remove support for node 14 and 16 #934

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
7 changes: 0 additions & 7 deletions ci/container/test_component.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
fi

echo "[INFO] Setting test parameters"
if [[ "$LOCAL_USER_NAME" == "jenkins" ]]; then
echo "[INFO] Use the default test parameters.json"
Expand Down
8 changes: 0 additions & 8 deletions ci/test_windows.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]

if %ERRORLEVEL% NEQ 0 (
echo [ERROR] failed to install the Snowflake NodeJS Driver
exit /b 1
Expand Down
54 changes: 23 additions & 31 deletions test/unit/authentication/json_credential_manager_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
});
}
});
Loading