Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Index Management] Fix API Integration Test and use of timestamp_field #69666

Merged
merged 3 commits into from
Jun 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export const setup = async (): Promise<DataStreamsTabTestBed> => {

export const createDataStreamPayload = (name: string): DataStream => ({
name,
timeStampField: '@timestamp',
timeStampField: { name: '@timestamp', mapping: { type: 'date' } },
indices: [
{
name: 'indexName',
Expand Down
13 changes: 11 additions & 2 deletions x-pack/plugins/index_management/common/types/data_streams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,18 @@
* you may not use this file except in compliance with the Elastic License.
*/

interface TimestampFieldFromEs {
name: string;
mapping: {
type: string;
};
}

type TimestampField = TimestampFieldFromEs;

export interface DataStreamFromEs {
name: string;
timestamp_field: string;
timestamp_field: TimestampFieldFromEs;
indices: DataStreamIndexFromEs[];
generation: number;
}
Expand All @@ -18,7 +27,7 @@ export interface DataStreamIndexFromEs {

export interface DataStream {
name: string;
timeStampField: string;
timeStampField: TimestampField;
indices: DataStreamIndex[];
generation: number;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const DataStreamTable: React.FunctionComponent<Props> = ({
),
},
{
field: 'timeStampField',
field: 'timeStampField.name',
name: i18n.translate('xpack.idxMgmt.dataStreamList.table.timeStampFieldColumnTitle', {
defaultMessage: 'Timestamp field',
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,18 @@ export default function ({ getService }: FtrProviderContext) {

const deleteDataStream = (name: string) => {
return es.dataManagement
.deleteComposableIndexTemplate({
.deleteDataStream({
name,
})
.then(() =>
es.dataManagement.deleteDataStream({
es.dataManagement.deleteComposableIndexTemplate({
name,
})
);
};

describe('Data streams', function () {
// Unskip once ES snapshot has been promoted that updates the data stream response
describe.skip('Data streams', function () {
const testDataStreamName = 'test-data-stream';

describe('Get', () => {
Expand All @@ -79,7 +80,7 @@ export default function ({ getService }: FtrProviderContext) {
expect(dataStreams).to.eql([
{
name: testDataStreamName,
timeStampField: '@timestamp',
timeStampField: { name: '@timestamp', mapping: { type: 'date' } },
indices: [
{
name: indexName,
Expand Down