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

Update node version to 22 in tests.yaml and package.json and update dependencies #269

Open
wants to merge 5 commits into
base: development/8.1
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
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: '16'
node-version: '22'
cache: yarn

- name: install dependencies
Expand Down
13 changes: 13 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});
export default [...compat.extends("scality")];
18 changes: 9 additions & 9 deletions lib/RESTClient.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use strict'; // eslint-disable-line strict
'use strict';

const assert = require('assert');
const http = require('http');
Expand Down Expand Up @@ -351,9 +351,9 @@ class RESTClient {
ret.push(data);
retLen += data.length;
}).on('error', callback)
.on('end', () => {
callback(null, Buffer.concat(ret, retLen).toString());
});
.on('end', () => {
callback(null, Buffer.concat(ret, retLen).toString());
});
return undefined;
});
}
Expand Down Expand Up @@ -421,11 +421,11 @@ class RESTClient {
}

req.on('response', res => this.endRespond(res, res, log, callback))
.on('error', error => {
// covers system errors like ECONNREFUSED, ECONNRESET etc.
log.error('error sending request to metadata', { error });
callback(errors.InternalError);
}).end();
.on('error', error => {
// covers system errors like ECONNREFUSED, ECONNRESET etc.
log.error('error sending request to metadata', { error });
callback(errors.InternalError);
}).end();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/shell.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use strict'; // eslint-disable-line strict
'use strict';

const readline = require('readline');

Expand Down
33 changes: 17 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"name": "bucketclient",
"engines": {
"node": ">=16"
"node": ">=20"
},
"version": "8.1.10",
"version": "8.1.11",
"description": "Bucket Client",
"main": "index.js",
"files": [
"CONTRIBUTING.md",
"config.json",
"index.d.ts",
"lib/*",
"licenses/*",
"yarn.lock"
"CONTRIBUTING.md",
"config.json",
"index.d.ts",
"lib/*",
"licenses/*",
"yarn.lock"
],
"scripts": {
"ft_test": "mocha tests/functional",
Expand All @@ -34,15 +34,16 @@
},
"homepage": "https://github.com/scality/bucketclient#readme",
"devDependencies": {
"eslint": "^2.4.0",
"eslint-config-airbnb": "^6.0.0",
"eslint-config-scality": "scality/Guidelines#ec33dfb",
"eslint-plugin-react": "4.2.3",
"mocha": ""
"eslint": "^9.14.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-scality": "scality/Guidelines#8.3.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-react": "7.37.2",
"mocha": "10.8.2"
},
"dependencies": {
"arsenal": "git+https://github.com/scality/Arsenal#8.1.87",
"httpagent": "git+https://github.com/scality/httpagent#1.0.5",
"werelogs": "scality/werelogs#8.1.2"
"arsenal": "git+https://github.com/scality/Arsenal#7e142a1bfca7f516c107d2072baeae54cbbe379c",
"httpagent": "git+https://github.com/scality/httpagent#1.0.6",
"werelogs": "scality/werelogs#8.1.5"
}
}
54 changes: 27 additions & 27 deletions tests/functional/client.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use strict'; // eslint-disable-line strict
'use strict';

const assert = require('assert');

Expand All @@ -18,7 +18,7 @@ describe('Bucket Client tests', function testClient() {

it('should create a new bucket', done => {
client.createBucket(bucketName, reqUids,
JSON.stringify(bucketAttributes), done);
JSON.stringify(bucketAttributes), done);
});

it('should try to create the same bucket and fail', done => {
Expand Down Expand Up @@ -90,31 +90,31 @@ describe('Bucket Client tests', function testClient() {
dataBufs.push(data);
dataLen += data.length;
}).on('error', done)
.on('end', () => {
const data = Buffer.concat(dataBufs, dataLen).toString();
const obj = JSON.parse(data);
assert.strictEqual(Object.prototype.hasOwnProperty.call(
obj, 'info'), true);
const info = obj.info;
assert.strictEqual(['start', 'end', 'cseq', 'prune']
.every(key => Object.prototype.hasOwnProperty.call(
obj.info, key)), true);
assert.strictEqual(info.start >= start, true);
assert.strictEqual(info.end <= end, true);
// NOTE: this check will be removed when pruned logs are
// retrieved also
assert.strictEqual(info.prune <= info.start, true);
assert.strictEqual(info.cseq >= info.end, true);
assert.strictEqual(Object.prototype.hasOwnProperty.call(
obj, 'log'), true);
const logs = obj.log;
assert.strictEqual(Array.isArray(logs), true);
assert.strictEqual(logs.length >= 1, true);
assert.strictEqual(logs.every(log =>
(typeof log === 'object') && (Object.keys(log).length > 0)
), true);
return done();
});
.on('end', () => {
const data = Buffer.concat(dataBufs, dataLen).toString();
const obj = JSON.parse(data);
assert.strictEqual(Object.prototype.hasOwnProperty.call(
obj, 'info'), true);
const info = obj.info;
assert.strictEqual(['start', 'end', 'cseq', 'prune']
.every(key => Object.prototype.hasOwnProperty.call(
obj.info, key)), true);
assert.strictEqual(info.start >= start, true);
assert.strictEqual(info.end <= end, true);
// NOTE: this check will be removed when pruned logs are
// retrieved also
assert.strictEqual(info.prune <= info.start, true);
assert.strictEqual(info.cseq >= info.end, true);
assert.strictEqual(Object.prototype.hasOwnProperty.call(
obj, 'log'), true);
const logs = obj.log;
assert.strictEqual(Array.isArray(logs), true);
assert.strictEqual(logs.length >= 1, true);
assert.strictEqual(logs.every(log =>
(typeof log === 'object') && (Object.keys(log).length > 0)
), true);
return done();
});
return undefined;
});
});
Expand Down
12 changes: 6 additions & 6 deletions tests/unit/simple_tests.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use strict'; // eslint-disable-line strict
'use strict';

const assert = require('assert');
const fs = require('fs');
Expand Down Expand Up @@ -54,11 +54,11 @@ const env = {
https: {
s: handler => https.createServer(httpsOptions, handler),
c: new RESTClient(['bucketclient.testing.local:9000'],
undefined,
true,
httpsOptions.key,
httpsOptions.cert,
httpsOptions.ca[0]),
undefined,
true,
httpsOptions.key,
httpsOptions.cert,
httpsOptions.ca[0]),
},
};

Expand Down
Loading
Loading