From 66a632f72d872bd00b6e69face63b214a2cde5c2 Mon Sep 17 00:00:00 2001 From: HC-kang Date: Tue, 31 Oct 2023 16:41:25 +0900 Subject: [PATCH 1/2] Remove: remove ping check --- src/modules/health-check/health-check.controller.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/health-check/health-check.controller.ts b/src/modules/health-check/health-check.controller.ts index 8b9c5b2..c059055 100644 --- a/src/modules/health-check/health-check.controller.ts +++ b/src/modules/health-check/health-check.controller.ts @@ -23,7 +23,7 @@ export class HealthCheckController { @HealthCheck() check() { return this.health.check([ - () => this.http.pingCheck('google', 'https://google.com'), + // () => this.http.pingCheck('google', 'https://google.com'), () => this.db.pingCheck('database', { timeout: 300 }), () => this.sampleHealthIndicator.isHealthy('sample'), ]); From b7b523f19081da353268b3919fcb76d0aeedf558 Mon Sep 17 00:00:00 2001 From: HC-kang Date: Tue, 31 Oct 2023 16:46:26 +0900 Subject: [PATCH 2/2] Test: remove test for http ping checking --- .../health-check/health-check.controller.spec.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/modules/health-check/health-check.controller.spec.ts b/src/modules/health-check/health-check.controller.spec.ts index 93a416b..e44adcd 100644 --- a/src/modules/health-check/health-check.controller.spec.ts +++ b/src/modules/health-check/health-check.controller.spec.ts @@ -68,13 +68,13 @@ describe('HealthCheckController', () => { it('should run general health checks', async () => { // Arrange - const httpResult = { status: 'up' }; + // const httpResult = { status: 'up' }; const dbResult = { status: 'up' }; const sampleResult = { status: 'up' }; - const httpSpy = jest - .spyOn(mockHttp, 'pingCheck') - .mockResolvedValue(httpResult as unknown as HealthIndicatorResult); + // const httpSpy = jest + // .spyOn(mockHttp, 'pingCheck') + // .mockResolvedValue(httpResult as unknown as HealthIndicatorResult); const dbSpy = jest .spyOn(mockTypeOrm, 'pingCheck') .mockResolvedValue(dbResult as unknown as HealthIndicatorResult); @@ -99,12 +99,13 @@ describe('HealthCheckController', () => { // Assert expect(healthSpy).toHaveBeenCalled(); - expect(httpSpy).toHaveBeenCalledWith('google', 'https://google.com'); + // expect(httpSpy).toHaveBeenCalledWith('google', 'https://google.com'); expect(dbSpy).toHaveBeenCalledWith('database', { timeout: 300 }); expect(sampleSpy).toHaveBeenCalledWith('sample'); expect(result).toEqual({ status: 'up', - info: [httpResult, dbResult, sampleResult], + info: [dbResult, sampleResult], + // info: [httpResult, dbResult, sampleResult], }); }); });