Skip to content
Merged
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
Original file line numberDiff line numberDiff line change
Expand Up@@ -25,7 +25,7 @@ const MIN_FILESYSTEM_SIZE = 1950000000000 // 1950 GB of file system storage
* and used in signature generation
*/
const healthCheck = async (
{ libs, snapbackSM } = {},
{ libs, snapbackSM, trustedNotifierManager } = {},
logger,
sequelize,
getMonitors,
Expand DownExpand Up@@ -197,6 +197,10 @@ const healthCheck = async (
latestFindReplicaSetUpdatesJobSuccess: parseDateOrNull(
latestFindReplicaSetUpdatesJobSuccess
)
},
trustedNotifier: {
...trustedNotifierManager.getTrustedNotifierData(),
id: trustedNotifierManager.trustedNotifierID
}
}

Expand DownExpand Up@@ -234,7 +238,7 @@ const parseDateOrNull = (date) => {

// TODO remove verbose health check after fully deprecated
const healthCheckVerbose = async (
{ libs, snapbackSM } = {},
{ libs, snapbackSM, trustedNotifierManager } = {},
logger,
sequelize,
getMonitors,
Expand All@@ -244,7 +248,7 @@ const healthCheckVerbose = async (
getAsyncProcessingQueueJobs
) => {
return healthCheck(
{ libs, snapbackSM },
{ libs, snapbackSM, trustedNotifierManager },
logger,
sequelize,
getMonitors,
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -35,6 +35,17 @@ const libsMock = {
}
}

const trustedNotifierManagerMock = {
getTrustedNotifierData: () => {
return {
email: 'trusted@notifier.com',
wallet: '0x73EB6d82CFB20bA669e9c178b718d770C49AAAAA',
endpoint: 'default.trustednotifier'
}
},
trustedNotifierID: 12
}

const sequelizeMock = {
query: async () => Promise.resolve()
}
Expand DownExpand Up@@ -150,7 +161,8 @@ describe('Test Health Check', function () {
{
libs: libsMock,
snapbackSM: snapbackSMMock,
asyncProcessingQueue: AsyncProcessingQueueMock(0, 2)
asyncProcessingQueue: AsyncProcessingQueueMock(0, 2),
trustedNotifierManager: trustedNotifierManagerMock
},
mockLogger,
sequelizeMock,
Expand DownExpand Up@@ -237,6 +249,12 @@ describe('Test Health Check', function () {
latestFindSyncRequestsJobSuccess: null,
latestFindReplicaSetUpdatesJobStart: null,
latestFindReplicaSetUpdatesJobSuccess: null
},
trustedNotifier: {
email: 'trusted@notifier.com',
wallet: '0x73EB6d82CFB20bA669e9c178b718d770C49AAAAA',
endpoint: 'default.trustednotifier',
id: 12
}
})
})
Expand All@@ -256,7 +274,8 @@ describe('Test Health Check', function () {
const res = await healthCheck(
{
snapbackSM: snapbackSMMock,
asyncProcessingQueue: AsyncProcessingQueueMock(0, 2)
asyncProcessingQueue: AsyncProcessingQueueMock(0, 2),
trustedNotifierManager: trustedNotifierManagerMock
},
mockLogger,
sequelizeMock,
Expand DownExpand Up@@ -343,6 +362,12 @@ describe('Test Health Check', function () {
latestFindSyncRequestsJobSuccess: null,
latestFindReplicaSetUpdatesJobStart: null,
latestFindReplicaSetUpdatesJobSuccess: null
},
trustedNotifier: {
email: 'trusted@notifier.com',
wallet: '0x73EB6d82CFB20bA669e9c178b718d770C49AAAAA',
endpoint: 'default.trustednotifier',
id: 12
}
})
})
Expand All@@ -351,7 +376,8 @@ describe('Test Health Check', function () {
const res = await healthCheck(
{
snapbackSM: snapbackSMMock,
asyncProcessingQueue: AsyncProcessingQueueMock(0, 2)
asyncProcessingQueue: AsyncProcessingQueueMock(0, 2),
trustedNotifierManager: trustedNotifierManagerMock
},
mockLogger,
sequelizeMock,
Expand DownExpand Up@@ -438,6 +464,12 @@ describe('Test Health Check', function () {
latestFindSyncRequestsJobSuccess: null,
latestFindReplicaSetUpdatesJobStart: null,
latestFindReplicaSetUpdatesJobSuccess: null
},
trustedNotifier: {
email: 'trusted@notifier.com',
wallet: '0x73EB6d82CFB20bA669e9c178b718d770C49AAAAA',
endpoint: 'default.trustednotifier',
id: 12
}
})

Expand DownExpand Up@@ -487,7 +519,8 @@ describe('Test Health Check Verbose', function () {
const res = await healthCheckVerbose(
{
snapbackSM: snapbackSMMock,
asyncProcessingQueue: AsyncProcessingQueueMock(0, 2)
asyncProcessingQueue: AsyncProcessingQueueMock(0, 2),
trustedNotifierManager: trustedNotifierManagerMock
},
mockLogger,
sequelizeMock,
Expand DownExpand Up@@ -574,6 +607,12 @@ describe('Test Health Check Verbose', function () {
latestFindSyncRequestsJobSuccess: null,
latestFindReplicaSetUpdatesJobStart: null,
latestFindReplicaSetUpdatesJobSuccess: null
},
trustedNotifier: {
email: 'trusted@notifier.com',
wallet: '0x73EB6d82CFB20bA669e9c178b718d770C49AAAAA',
endpoint: 'default.trustednotifier',
id: 12
}
})
})
Expand All@@ -593,7 +632,8 @@ describe('Test Health Check Verbose', function () {
{
libs: libsMock,
snapbackSM: snapbackSMMock,
asyncProcessingQueue: AsyncProcessingQueueMock(0, 2)
asyncProcessingQueue: AsyncProcessingQueueMock(0, 2),
trustedNotifierManager: trustedNotifierManagerMock
},
mockLogger,
sequelizeMock,
Expand All@@ -607,7 +647,8 @@ describe('Test Health Check Verbose', function () {
{
libs: libsMock,
snapbackSM: snapbackSMMock,
asyncProcessingQueue: AsyncProcessingQueueMock(0, 2)
asyncProcessingQueue: AsyncProcessingQueueMock(0, 2),
trustedNotifierManager: trustedNotifierManagerMock
},
mockLogger,
sequelizeMock,
Expand Down