Skip to content

Commit

Permalink
remove llmobs from exporter tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sabrenner committed Oct 2, 2024
1 parent 1aae7c3 commit 62a9cc9
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions packages/dd-trace/test/exporters/agent/exporter.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@ describe('Exporter', () => {
let writer
let prioritySampler
let span
let llmobs

beforeEach(() => {
url = 'www.example.com'
flushInterval = 1000
span = {}
llmobs = {}
writer = {
append: sinon.spy(),
flush: sinon.spy(),
Expand All @@ -37,7 +35,7 @@ describe('Exporter', () => {

it('should pass computed stats header through to writer', () => {
const stats = { enabled: true }
exporter = new Exporter({ url, flushInterval, stats, llmobs }, prioritySampler)
exporter = new Exporter({ url, flushInterval, stats }, prioritySampler)
expect(Writer).to.have.been.calledWithMatch({
headers: {
'Datadog-Client-Computed-Stats': 'yes'
Expand All @@ -48,7 +46,7 @@ describe('Exporter', () => {
it('should pass computed stats header through to writer if standalone appsec is enabled', () => {
const stats = { enabled: false }
const appsec = { standalone: { enabled: true } }
exporter = new Exporter({ url, flushInterval, stats, appsec, llmobs }, prioritySampler)
exporter = new Exporter({ url, flushInterval, stats, appsec }, prioritySampler)

expect(Writer).to.have.been.calledWithMatch({
headers: {
Expand All @@ -59,27 +57,27 @@ describe('Exporter', () => {

it('should support IPv6', () => {
const stats = { enabled: true }
exporter = new Exporter({ hostname: '::1', flushInterval, stats, llmobs }, prioritySampler)
exporter = new Exporter({ hostname: '::1', flushInterval, stats }, prioritySampler)
expect(Writer).to.have.been.calledWithMatch({
url: new URL('http://[::1]')
})
})

describe('when interval is set to a positive number', () => {
beforeEach(() => {
exporter = new Exporter({ url, flushInterval, llmobs }, prioritySampler)
exporter = new Exporter({ url, flushInterval }, prioritySampler)
})

it('should not flush if export has not been called', (done) => {
exporter = new Exporter({ url, flushInterval, llmobs }, prioritySampler)
exporter = new Exporter({ url, flushInterval }, prioritySampler)
setTimeout(() => {
expect(writer.flush).not.to.have.been.called
done()
}, flushInterval + 100)
})

it('should flush after the configured interval if a payload has been exported', (done) => {
exporter = new Exporter({ url, flushInterval, llmobs }, prioritySampler)
exporter = new Exporter({ url, flushInterval }, prioritySampler)
exporter.export([{}])
setTimeout(() => {
expect(writer.flush).to.have.been.called
Expand All @@ -103,7 +101,7 @@ describe('Exporter', () => {

describe('when interval is set to 0', () => {
beforeEach(() => {
exporter = new Exporter({ url, flushInterval: 0, llmobs })
exporter = new Exporter({ url, flushInterval: 0 })
})

it('should flush right away when interval is set to 0', () => {
Expand All @@ -114,7 +112,7 @@ describe('Exporter', () => {

describe('setUrl', () => {
beforeEach(() => {
exporter = new Exporter({ url, llmobs })
exporter = new Exporter({ url })
})

it('should set the URL on self and writer', () => {
Expand Down

0 comments on commit 62a9cc9

Please sign in to comment.