Skip to content

Commit

Permalink
fixing ci
Browse files Browse the repository at this point in the history
  • Loading branch information
cauemarcondes committed Feb 18, 2025
1 parent 4b76d9c commit 91e62ef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderCon
]);

const currentStatsLatencyValues = body.services[0].currentStats.latency.timeseries;
expect(currentStatsLatencyValues.every(({ y }) => y === 1000000)).to.be(true);
expect(currentStatsLatencyValues?.every(({ y }) => y === 1000000)).to.be(true);
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { generateData, dataConfig } from './generate_data';
export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderContext) {
const apmApiClient = getService('apmApi');
const synthtrace = getService('synthtrace');
const es = getService('es');
const start = new Date('2021-01-01T00:00:00.000Z').getTime();
const end = new Date('2021-01-01T00:15:00.000Z').getTime() - 1;
const bucketSize = Math.round((end - start) / (60 * 1000));
Expand Down Expand Up @@ -94,7 +93,7 @@ export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderCon

const expectedValue = transaction.duration * 1000;
expect(latency.value).to.be(expectedValue);
expect(latency.timeseries.every(({ y }) => y === expectedValue)).to.be(true);
expect(latency.timeseries?.every(({ y }) => y === expectedValue)).to.be(true);
});

it('returns the correct throughput', () => {
Expand All @@ -106,7 +105,7 @@ export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderCon
const expectedThroughput = rate + errorRate;
expect(roundNumber(throughput.value)).to.be(roundNumber(expectedThroughput));
expect(
throughput.timeseries.every(
throughput.timeseries?.every(
({ y }) => roundNumber(y) === roundNumber(expectedThroughput / bucketSize)
)
).to.be(true);
Expand All @@ -121,7 +120,7 @@ export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderCon
const expectedValuePerBucket = (rate + errorRate) * transaction.duration * 1000;
expect(totalTime.value).to.be(expectedValuePerBucket * bucketSize);
expect(
totalTime.timeseries.every(
totalTime.timeseries?.every(
({ y }) => roundNumber(y) === roundNumber(expectedValuePerBucket)
)
).to.be(true);
Expand All @@ -134,7 +133,7 @@ export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderCon
const { rate, transaction, errorRate: dataConfigErroRate } = dataConfig;
const expectedValue = dataConfigErroRate / (rate + dataConfigErroRate);
expect(errorRate.value).to.be(expectedValue);
expect(errorRate.timeseries.every(({ y }) => y === expectedValue)).to.be(true);
expect(errorRate.timeseries?.every(({ y }) => y === expectedValue)).to.be(true);
});
});
});
Expand Down

0 comments on commit 91e62ef

Please sign in to comment.