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

WIP: chore: updates Node to v16 (BKTCLT-3) #226

Open
wants to merge 11 commits into
base: development/7.4
Choose a base branch
from
2 changes: 0 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ jobs:
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: install dependencies
run: yarn install --frozen-lockfile
- name: run lint
run: yarn run --silent lint -- --max-warnings 0
- name: set host bucketclient.testing.local
run: sudo bash -c 'echo "127.0.0.1 bucketclient.testing.local" >> /etc/hosts'
- name: run test
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@
},
"homepage": "https://github.com/scality/bucketclient#readme",
"devDependencies": {
"eslint": "^2.4.0",
"eslint-config-airbnb": "^6.0.0",
"eslint": "^7.32.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-config-scality": "scality/Guidelines#71a059ad",
"eslint-plugin-react": "4.2.3",
"mocha": ""
"eslint-plugin-import": "^2.22.1",
"mocha": "^8.4.0"
},
"dependencies": {
"agentkeepalive": "^4.1.3",
Expand Down
25 changes: 14 additions & 11 deletions tests/unit/simple_tests.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
'use strict'; // eslint-disable-line strict

george-the-wizard marked this conversation as resolved.
Show resolved Hide resolved
// eslint-disable-line strict

const assert = require('assert');
const fs = require('fs');
const http = require('http');
const https = require('https');

const errors = require('arsenal').errors;
const { errors } = require('arsenal');

const RESTClient = require('../../index.js').RESTClient;
const { RESTClient } = require('../../index.js');

const existBucket = {
name: 'Zaphod',
Expand Down Expand Up @@ -38,19 +39,21 @@ const httpsOptions = {
requestCert: true,
};

const REST_CLIENT_SERVERNAME = 'bucketclient.testing.local';

const env = {
http: {
c: new RESTClient(['bucketclient.testing.local:9000']),
c: new RESTClient([`${REST_CLIENT_SERVERNAME}:9000`]),
s: handler => http.createServer(handler),
},
https: {
s: handler => https.createServer(httpsOptions, handler),
c: new RESTClient(['bucketclient.testing.local:9000'],
undefined,
true,
httpsOptions.key,
httpsOptions.cert,
httpsOptions.ca[0]),
c: new RESTClient([`${REST_CLIENT_SERVERNAME}:9000`],
undefined,
true,
httpsOptions.key,
httpsOptions.cert,
httpsOptions.ca[0]),
},
};

Expand Down Expand Up @@ -100,7 +103,7 @@ Object.keys(env).forEach(key => {

it('should create a new non-existing bucket', done => {
client.createBucket(nonExistBucket.name, reqUids,
'{ status: "dead" }', done);
'{ status: "dead" }', done);
});

it('should try to create an already existing bucket and fail', done => {
Expand Down
Loading