Skip to content

Commit

Permalink
fixing api tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cauemarcondes committed Sep 3, 2020
1 parent 44f69d9 commit f459501
Show file tree
Hide file tree
Showing 6 changed files with 63,561 additions and 11 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,24 @@ export default function agentConfigurationTests({ getService }: FtrProviderConte

it('returns all services', async () => {
const { body } = await getServices();
expect(body).to.eql(['ALL_OPTION_VALUE', 'client', 'opbeans-java', 'opbeans-node']);
expect(body).to.eql([
'ALL_OPTION_VALUE',
'client',
'opbeans-dotnet',
'opbeans-go',
'opbeans-java',
'opbeans-node',
'opbeans-python',
'opbeans-ruby',
'opbeans-rum',
]);
});

it('returns the environments', async () => {
const { body } = await getEnvironments('opbeans-node');
expect(body).to.eql([
{ name: 'ALL_OPTION_VALUE', alreadyConfigured: false },
{ name: 'testing', alreadyConfigured: false },
{ name: 'production', alreadyConfigured: false },
]);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export default function ApiTest({ getService }: FtrProviderContext) {
const esArchiver = getService('esArchiver');

// url parameters
const start = encodeURIComponent('2020-08-25T12:51:30.000Z');
const end = encodeURIComponent('2020-08-25T12:54:30.000Z');
const start = encodeURIComponent('2020-08-26T11:00:00.000Z');
const end = encodeURIComponent('2020-08-26T11:30:00.000Z');
const uiFilters = encodeURIComponent(JSON.stringify({}));

describe('Error rate', () => {
Expand All @@ -39,18 +39,73 @@ export default function ApiTest({ getService }: FtrProviderContext) {
);

expect(response.status).to.be(200);

expect(response.body).to.eql({
noHits: false,
erroneousTransactionsRate: [
{ x: 1598359890000, y: 0.03333333333333333 },
{ x: 1598359920000, y: 0.09333333333333334 },
{ x: 1598359950000, y: 0.014492753623188406 },
{ x: 1598359980000, y: 0.1267605633802817 },
{ x: 1598360010000, y: 0.07462686567164178 },
{ x: 1598360040000, y: 0.06578947368421052 },
{ x: 1598360070000, y: null },
{ x: 1598439600000, y: 0.5 },
{ x: 1598439630000, y: null },
{ x: 1598439660000, y: 0 },
{ x: 1598439690000, y: null },
{ x: 1598439720000, y: 0.14285714285714285 },
{ x: 1598439750000, y: 0 },
{ x: 1598439780000, y: 0 },
{ x: 1598439810000, y: null },
{ x: 1598439840000, y: 0 },
{ x: 1598439870000, y: 0 },
{ x: 1598439900000, y: 0 },
{ x: 1598439930000, y: null },
{ x: 1598439960000, y: 0 },
{ x: 1598439990000, y: 0 },
{ x: 1598440020000, y: 1 },
{ x: 1598440050000, y: null },
{ x: 1598440080000, y: null },
{ x: 1598440110000, y: null },
{ x: 1598440140000, y: 0.6666666666666666 },
{ x: 1598440170000, y: null },
{ x: 1598440200000, y: 0 },
{ x: 1598440230000, y: 0 },
{ x: 1598440260000, y: 0 },
{ x: 1598440290000, y: null },
{ x: 1598440320000, y: 0 },
{ x: 1598440350000, y: 0 },
{ x: 1598440380000, y: 0 },
{ x: 1598440410000, y: null },
{ x: 1598440440000, y: 0 },
{ x: 1598440470000, y: 0 },
{ x: 1598440500000, y: 1 },
{ x: 1598440530000, y: null },
{ x: 1598440560000, y: 0.25 },
{ x: 1598440590000, y: 0 },
{ x: 1598440620000, y: null },
{ x: 1598440650000, y: null },
{ x: 1598440680000, y: 0 },
{ x: 1598440710000, y: 0 },
{ x: 1598440740000, y: null },
{ x: 1598440770000, y: 0 },
{ x: 1598440800000, y: 0 },
{ x: 1598440830000, y: 0 },
{ x: 1598440860000, y: null },
{ x: 1598440890000, y: null },
{ x: 1598440920000, y: 0.3333333333333333 },
{ x: 1598440950000, y: 0.6666666666666666 },
{ x: 1598440980000, y: 0.5 },
{ x: 1598441010000, y: null },
{ x: 1598441040000, y: 0.14285714285714285 },
{ x: 1598441070000, y: 0.6666666666666666 },
{ x: 1598441100000, y: 0 },
{ x: 1598441130000, y: null },
{ x: 1598441160000, y: 0.5 },
{ x: 1598441190000, y: 0 },
{ x: 1598441220000, y: null },
{ x: 1598441250000, y: null },
{ x: 1598441280000, y: 0 },
{ x: 1598441310000, y: 0 },
{ x: 1598441340000, y: null },
{ x: 1598441370000, y: 1 },
{ x: 1598441400000, y: null },
],
average: 0.06805605383766485,
average: 0.18894993894993897,
});
});
});
Expand Down
Binary file not shown.
Loading

0 comments on commit f459501

Please sign in to comment.