Skip to content

Commit 2897483

Browse files
committed
Formatting
1 parent 1296c58 commit 2897483

2 files changed

Lines changed: 26 additions & 10 deletions

File tree

unitTests/utility/environment/systemInformation.test.js

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const PROCESS_INFO = {
2929
user: 'lincoln',
3030
command: 'harper.js',
3131
params: '',
32-
path: 'node dist/bin'
32+
path: 'node dist/bin',
3333
},
3434
],
3535
clustering: [
@@ -182,7 +182,20 @@ const EXPECTED_PROPERTIES = {
182182
disk_size: ['fs', 'rw', 'type', 'size', 'used', 'use', 'mount', 'available'],
183183
network: ['default_interface', 'latency', 'interfaces', 'stats', 'connections'],
184184
network_latency: ['ms', 'ok', 'status', 'url'],
185-
network_interfaces: ['iface', 'ifaceName', 'default', 'ip4', 'ip4subnet', 'ip6', 'ip6subnet', 'mac', 'operstate', 'type', 'duplex', 'speed'],
185+
network_interfaces: [
186+
'iface',
187+
'ifaceName',
188+
'default',
189+
'ip4',
190+
'ip4subnet',
191+
'ip6',
192+
'ip6subnet',
193+
'mac',
194+
'operstate',
195+
'type',
196+
'duplex',
197+
'speed',
198+
],
186199
network_stats: ['iface', 'operstate', 'rx_bytes', 'rx_dropped', 'rx_errors', 'tx_bytes', 'tx_dropped', 'tx_errors'],
187200
harperdb_processes: ['core'],
188201
harperdb_processes_core: [
@@ -213,11 +226,13 @@ describe('test systemInformation module', () => {
213226

214227
before(() => {
215228
getHDBProcessInfoStub = sinon.stub(system_information, 'getHDBProcessInfo').resolves(PROCESS_INFO);
216-
sinon.stub(system_information, 'getTableSize').returns([
217-
new TableSizeObject('dev', 'dog', 4096, 0, 0, 4096),
218-
new TableSizeObject('dev', 'breed', 4096, 0, 0, 4096),
219-
new TableSizeObject('prod', 'customers', 4096, 0, 0, 4096),
220-
]);
229+
sinon
230+
.stub(system_information, 'getTableSize')
231+
.returns([
232+
new TableSizeObject('dev', 'dog', 4096, 0, 0, 4096),
233+
new TableSizeObject('dev', 'breed', 4096, 0, 0, 4096),
234+
new TableSizeObject('prod', 'customers', 4096, 0, 0, 4096),
235+
]);
221236
env_mgr.setProperty('clustering_enabled', false);
222237
});
223238

utility/environment/systemInformation.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -566,9 +566,10 @@ const attributeMap: Record<string, () => Promise<any> | any> = {
566566
* @returns {Promise<SystemInformationResponse>}
567567
*/
568568
export async function systemInformation(systemInfoReq: SystemInformationRequest): Promise<SystemInformationResponse> {
569-
const attributes = Array.isArray(systemInfoReq.attributes) && systemInfoReq.attributes.length > 0
570-
? systemInfoReq.attributes
571-
: Object.keys(attributeMap);
569+
const attributes =
570+
Array.isArray(systemInfoReq.attributes) && systemInfoReq.attributes.length > 0
571+
? systemInfoReq.attributes
572+
: Object.keys(attributeMap);
572573
const response = new SystemInformationResponse();
573574
await Promise.all(
574575
attributes

0 commit comments

Comments
 (0)