Skip to content

Commit

Permalink
fix: minor bug fix (#133)
Browse files Browse the repository at this point in the history
* Bump minor version for TTK server logs feature

* Minor bug fix
  • Loading branch information
oderayi authored Feb 10, 2021
1 parent a9f88ff commit d7b2d38
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 23 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ml-testing-toolkit",
"description": "Testing Toolkit for Mojaloop implementations",
"version": "11.7.12",
"version": "11.8.0",
"license": "Apache-2.0",
"author": "Vijaya Kumar Guthi, ModusBox Inc.",
"contributors": [
Expand Down
5 changes: 1 addition & 4 deletions src/lib/server-logs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

const config = require('../config')
const elasticSearch = require('./adapters/elastic-search')
const ADAPTER_TYPES = { ELASTICSEARCH: 'ELASTICSEARCH', GRAFANA: 'GRAFANA' }
const ADAPTER_TYPES = { ELASTICSEARCH: 'ELASTICSEARCH' }
let _adapter

const search = ({ query }) => {
Expand Down Expand Up @@ -53,9 +53,6 @@ const _getAdapter = (systemConfig) => {
_adapter = elasticSearch
return _adapter
}
if (systemConfig.SERVER_LOGS.ADAPTER.TYPE === ADAPTER_TYPES.GRAFANA) {
throw new Error('[SERVER LOGS] Grafana adapter not implemented.')
}
}

const _validateAdapterConfig = (systemConfig) => {
Expand Down
17 changes: 0 additions & 17 deletions test/unit/lib/server-logs/server-logs.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,23 +73,6 @@ describe('Server Logs', () => {
ServerLogs.search({ query: { 'metadata.trace.traceId': 'mockTraceId' } })
}).toThrowError()
})
it('should throw error if GRAFANA adapter is used', async () => {
spyGetSystemConfig.mockReturnValueOnce({
SERVER_LOGS: {
ENABLED: true,
ADAPTER: {
TYPE: 'GRAFANA',
API_URL: 'http://mockurl.com',
INDEX: 'mock-index',
RESULTS_PER_PAGE: 10
}
}
})
ServerLogs.setAdapter(undefined)
expect(() => {
ServerLogs.search({ query: { 'metadata.trace.traceId': 'mockTraceId' } })
}).toThrowError()
})
it('should return falsy value if SERVER LOGS ADAPTER config is missing', async () => {
spyGetSystemConfig.mockReturnValueOnce({})
ServerLogs.setAdapter(undefined)
Expand Down

0 comments on commit d7b2d38

Please sign in to comment.