Skip to content

Commit

Permalink
fixing ci
Browse files Browse the repository at this point in the history
  • Loading branch information
cauemarcondes committed Oct 7, 2021
1 parent 17f3f31 commit eb78ad5
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 19 deletions.
2 changes: 0 additions & 2 deletions x-pack/plugins/apm/common/utils/formatters/duration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ import { asDecimalOrInteger, asInteger, asDecimal } from './formatters';
import { TimeUnit } from './datetime';
import { Maybe } from '../../../typings/common';
import { isFiniteNumber } from '../is_finite_number';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import type { ThroughputUnit } from '../../../server/lib/helpers/calculate_throughput';

interface FormatterOptions {
defaultValue?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ describe('Observability dashboard data', () => {
start: 'now-15m',
end: 'now',
},
bucketSize: '600s',
intervalString: '600s',
bucketSize: 600,
};
afterEach(() => {
callApmApiMock.mockClear();
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/apm/server/routes/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { uniq } from 'lodash';
import { latencyAggregationTypeRt } from '../../common/latency_aggregation_types';
import { ProfilingValueType } from '../../common/profiling';
import { getSearchAggregatedTransactions } from '../lib/helpers/aggregated_transactions';
import { getThroughputUnit } from '../lib/helpers/calculate_throughput';
import { setupRequest } from '../lib/helpers/setup_request';
import { getServiceAnnotations } from '../lib/services/annotations';
import { getServices } from '../lib/services/get_services';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ describe('Metrics UI Observability Homepage Functions', () => {
const fetchData = createMetricsFetchData(mockedGetStartServices);
const endTime = moment('2020-07-02T13:25:11.629Z');
const startTime = endTime.clone().subtract(1, 'h');
const bucketSize = '300s';
const bucketSize = 300;
const intervalString = '300s';
const response = await fetchData({
absoluteTime: {
start: startTime.valueOf(),
Expand All @@ -67,6 +68,7 @@ describe('Metrics UI Observability Homepage Functions', () => {
end: 'now',
},
bucketSize,
intervalString,
});
expect(core.http.post).toHaveBeenCalledTimes(1);
expect(core.http.post).toHaveBeenCalledWith('/api/metrics/overview/top', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ const mockedCallFetchLogSourceConfigurationAPI =
const DEFAULT_PARAMS = {
absoluteTime: { start: 1593430680000, end: 1593430800000 },
relativeTime: { start: 'now-2m', end: 'now' }, // Doesn't matter for the test
bucketSize: '30s', // Doesn't matter for the test
intervalString: '30s', // Doesn't matter for the test
bucketSize: 30, // Doesn't matter for the test
};

function setup() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ describe('APMSection', () => {
status: fetcherHook.FETCH_STATUS.SUCCESS,
refetch: jest.fn(),
});
const { getByText, queryAllByTestId } = render(<APMSection bucketSize="60s" />);
const { getByText, queryAllByTestId } = render(
<APMSection bucketSize={{ intervalString: '60s', bucketSize: 60 }} />
);

expect(getByText('APM')).toBeInTheDocument();
expect(getByText('View in app')).toBeInTheDocument();
Expand All @@ -93,7 +95,9 @@ describe('APMSection', () => {
status: fetcherHook.FETCH_STATUS.SUCCESS,
refetch: jest.fn(),
});
const { getByText, queryAllByTestId } = render(<APMSection bucketSize="60s" />);
const { getByText, queryAllByTestId } = render(
<APMSection bucketSize={{ intervalString: '60s', bucketSize: 60 }} />
);

expect(getByText('APM')).toBeInTheDocument();
expect(getByText('View in app')).toBeInTheDocument();
Expand All @@ -107,7 +111,9 @@ describe('APMSection', () => {
status: fetcherHook.FETCH_STATUS.LOADING,
refetch: jest.fn(),
});
const { getByText, queryAllByText, getByTestId } = render(<APMSection bucketSize="60s" />);
const { getByText, queryAllByText, getByTestId } = render(
<APMSection bucketSize={{ intervalString: '60s', bucketSize: 60 }} />
);

expect(getByText('APM')).toBeInTheDocument();
expect(getByTestId('loading')).toBeInTheDocument();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ describe('UXSection', () => {
status: fetcherHook.FETCH_STATUS.SUCCESS,
refetch: jest.fn(),
});
const { getByText, getAllByText } = render(<UXSection bucketSize="60s" />);
const { getByText, getAllByText } = render(
<UXSection bucketSize={{ bucketSize: 60, intervalString: '60s' }} />
);

expect(getByText('User Experience')).toBeInTheDocument();
expect(getByText('View in app')).toBeInTheDocument();
Expand Down Expand Up @@ -99,7 +101,9 @@ describe('UXSection', () => {
status: fetcherHook.FETCH_STATUS.LOADING,
refetch: jest.fn(),
});
const { getByText, queryAllByText, getAllByText } = render(<UXSection bucketSize="60s" />);
const { getByText, queryAllByText, getAllByText } = render(
<UXSection bucketSize={{ bucketSize: 60, intervalString: '60s' }} />
);

expect(getByText('User Experience')).toBeInTheDocument();
expect(getAllByText('--')).toHaveLength(3);
Expand All @@ -112,7 +116,9 @@ describe('UXSection', () => {
status: fetcherHook.FETCH_STATUS.SUCCESS,
refetch: jest.fn(),
});
const { getByText, queryAllByText, getAllByText } = render(<UXSection bucketSize="60s" />);
const { getByText, queryAllByText, getAllByText } = render(
<UXSection bucketSize={{ bucketSize: 60, intervalString: '60s' }} />
);

expect(getByText('User Experience')).toBeInTheDocument();
expect(getAllByText('No data is available.')).toHaveLength(3);
Expand Down
3 changes: 2 additions & 1 deletion x-pack/plugins/observability/public/data_handler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ const params = {
start: 'now-15m',
end: 'now',
},
bucketSize: '10s',
intervalString: '10s',
bucketSize: 10,
};

describe('registerDataHandler', () => {
Expand Down
6 changes: 0 additions & 6 deletions x-pack/test/apm_api_integration/tests/services/throughput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,6 @@ export default function ApiTest({ getService }: FtrProviderContext) {
body = await callApi();
});

it('returns the throughput in seconds', () => {
expect(body.throughputUnit).to.eql('second');
});

it('returns the expected throughput', () => {
const throughputValues = uniq(body.currentPeriod.map((coord) => coord.y));
expect(throughputValues).to.eql([GO_PROD_RATE]);
Expand All @@ -141,7 +137,6 @@ export default function ApiTest({ getService }: FtrProviderContext) {
it('returns data for all environments', () => {
const throughputValues = body.currentPeriod.map(({ y }) => y);
expect(uniq(throughputValues)).to.eql([GO_PROD_RATE + GO_DEV_RATE]);
expect(body.throughputUnit).to.eql('second');
});
});

Expand All @@ -158,7 +153,6 @@ export default function ApiTest({ getService }: FtrProviderContext) {
it('returns data that matches the kuery', () => {
const throughputValues = body.currentPeriod.map(({ y }) => y);
expect(uniq(throughputValues)).to.eql([GO_DEV_RATE]);
expect(body.throughputUnit).to.eql('second');
});
});
}
Expand Down

0 comments on commit eb78ad5

Please sign in to comment.