-
Notifications
You must be signed in to change notification settings - Fork 318
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
openai: do not crash when dogstatsd not configured (#3361)
- Loading branch information
Showing
7 changed files
with
70 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
'use strict' | ||
|
||
const services = require('../src/services') | ||
|
||
describe('Plugin', () => { | ||
describe('openai services', () => { | ||
describe('when unconfigured', () => { | ||
afterEach(() => { | ||
services.shutdown() | ||
}) | ||
|
||
it('dogstatsd does not throw', () => { | ||
const service = services.init({ | ||
hostname: 'foo', | ||
service: 'bar', | ||
apiKey: 'my api key', | ||
interval: 1000 | ||
}) | ||
|
||
service.metrics.increment('mykey') | ||
service.logger.log('hello') | ||
}) | ||
|
||
it('logger does not throw', () => { | ||
const service = services.init({ | ||
hostname: 'foo', | ||
service: 'bar', | ||
interval: 1000 | ||
}) | ||
|
||
service.logger.log('hello') | ||
}) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters