Skip to content

Commit

Permalink
[Index Management] Fix API Integration Test and use of `timestamp_fie…
Browse files Browse the repository at this point in the history
…ld` (#69666) (#69755)

* fix types and functional api integration test

* access timestamp field name in object

* temporarily skip the API integration test and fix ts issue

Co-authored-by: Jean-Louis Leysens <jloleysens@gmail.com>
  • Loading branch information
Tyler Smalley and jloleysens committed Jun 24, 2020
1 parent 2488edf commit d082616
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
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

0 comments on commit d082616

Please sign in to comment.