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
Logs Sample Data #22276
Logs Sample Data #22276
Changes from 23 commits
fa05b8a
f8df0e8
d690cd6
74176da
3213662
ef08257
06bfaf2
9f497d3
cd7c407
1aa2d16
1f26258
19e5c3c
97b98ce
19949cf
040f765
1ac6cda
0a9ab0b
1fd97d7
012d24c
46b62ed
4faa639
b6086c8
41ce8f6
2fc50b0
b6faa50
b694f12
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,4 @@ | |
*/ | ||
|
||
export { flightsSpecProvider } from './flights'; | ||
export { logsSpecProvider } from './logs'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,167 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import path from 'path'; | ||
import { savedObjects } from './saved_objects'; | ||
|
||
export function logsSpecProvider() { | ||
return { | ||
id: 'logs', | ||
name: 'Sample log data', | ||
description: 'Sample data, visualizations, and dashboards for monitoring web logs.', | ||
previewImagePath: '/plugins/kibana/home/sample_data_resources/logs/dashboard.png', | ||
overviewDashboard: 'edf84fe0-e1a0-11e7-b6d5-4dc382ef7f5b', | ||
defaultIndex: '90943e30-9a47-11e8-b64d-95841ca0b247', | ||
dataPath: path.join(__dirname, './logs.json.gz'), | ||
fields: { | ||
request: { | ||
type: 'text', | ||
fields: { | ||
keyword: { | ||
type: 'keyword', | ||
ignore_above: 256 | ||
} | ||
} | ||
}, | ||
geo: { | ||
properties: { | ||
srcdest: { | ||
type: 'keyword' | ||
}, | ||
src: { | ||
type: 'keyword' | ||
}, | ||
dest: { | ||
type: 'keyword' | ||
}, | ||
coordinates: { | ||
type: 'geo_point' | ||
} | ||
} | ||
}, | ||
utc_time: { | ||
type: 'date' | ||
}, | ||
url: { | ||
type: 'text', | ||
fields: { | ||
keyword: { | ||
type: 'keyword', | ||
ignore_above: 256 | ||
} | ||
} | ||
}, | ||
message: { | ||
type: 'text', | ||
fields: { | ||
keyword: { | ||
type: 'keyword', | ||
ignore_above: 256 | ||
} | ||
} | ||
}, | ||
host: { | ||
type: 'text', | ||
fields: { | ||
keyword: { | ||
type: 'keyword', | ||
ignore_above: 256 | ||
} | ||
} | ||
}, | ||
clientip: { | ||
type: 'ip' | ||
}, | ||
response: { | ||
type: 'text', | ||
fields: { | ||
keyword: { | ||
type: 'keyword', | ||
ignore_above: 256 | ||
} | ||
} | ||
}, | ||
machine: { | ||
properties: { | ||
ram: { | ||
type: 'long' | ||
}, | ||
os: { | ||
type: 'text', | ||
fields: { | ||
keyword: { | ||
type: 'keyword', | ||
ignore_above: 256 | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
agent: { | ||
type: 'text', | ||
fields: { | ||
keyword: { | ||
type: 'keyword', | ||
ignore_above: 256 | ||
} | ||
} | ||
}, | ||
bytes: { | ||
type: 'long' | ||
}, | ||
tags: { | ||
type: 'text', | ||
fields: { | ||
keyword: { | ||
type: 'keyword', | ||
ignore_above: 256 | ||
} | ||
} | ||
}, | ||
referer: { | ||
type: 'keyword' | ||
}, | ||
ip: { | ||
type: 'ip' | ||
}, | ||
timestamp: { | ||
type: 'date' | ||
}, | ||
phpmemory: { | ||
type: 'long' | ||
}, | ||
memory: { | ||
type: 'double' | ||
}, | ||
extension: { | ||
type: 'text', | ||
fields: { | ||
keyword: { | ||
type: 'keyword', | ||
ignore_above: 256 | ||
} | ||
} | ||
} | ||
}, | ||
timeFields: ['timestamp'], | ||
currentTimeMarker: '2018-08-01T00:00:00', | ||
preserveDayOfWeekTimeOfDay: true, | ||
savedObjects: savedObjects, | ||
}; | ||
} |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,26 +32,44 @@ export default function ({ getService, getPageObjects }) { | |
await PageObjects.header.waitUntilLoadingHasFinished(); | ||
}); | ||
|
||
it('should display registered sample data sets', async ()=> { | ||
it('should display registered flights sample data sets', async ()=> { | ||
await retry.try(async () => { | ||
const exists = await PageObjects.home.doesSampleDataSetExist('flights'); | ||
expect(exists).to.be(true); | ||
}); | ||
}); | ||
|
||
it('should install sample data set', async ()=> { | ||
it('should display registered logs sample data sets', async ()=> { | ||
await retry.try(async () => { | ||
const exists = await PageObjects.home.doesSampleDataSetExist('logs'); | ||
expect(exists).to.be(true); | ||
}); | ||
}); | ||
|
||
it('should install flights sample data set', async ()=> { | ||
await PageObjects.home.addSampleDataSet('flights'); | ||
const isInstalled = await PageObjects.home.isSampleDataSetInstalled('flights'); | ||
expect(isInstalled).to.be(true); | ||
}); | ||
|
||
it('should install logs sample data set', async ()=> { | ||
await PageObjects.home.addSampleDataSet('logs'); | ||
await retry.try(async () => { | ||
const successToastExists = await PageObjects.home.doesSampleDataSetSuccessfulInstallToastExist(); | ||
expect(successToastExists).to.be(true); | ||
}); | ||
|
||
const isInstalled = await PageObjects.home.isSampleDataSetInstalled('logs'); | ||
expect(isInstalled).to.be(true); | ||
}); | ||
|
||
describe('dashboard', () => { | ||
after(async () => { | ||
await PageObjects.common.navigateToUrl('home', 'tutorial_directory/sampleData'); | ||
await PageObjects.header.waitUntilLoadingHasFinished(); | ||
}); | ||
|
||
it('should launch sample data set dashboard', async ()=> { | ||
it('should launch sample flights data set dashboard', async ()=> { | ||
await PageObjects.home.launchSampleDataSet('flights'); | ||
await PageObjects.header.waitUntilLoadingHasFinished(); | ||
const today = new Date(); | ||
|
@@ -63,6 +81,7 @@ export default function ({ getService, getPageObjects }) { | |
expect(panelCount).to.be(19); | ||
}); | ||
|
||
|
||
it.skip('pie charts rendered', async () => { | ||
await dashboardExpect.pieSliceCount(4); | ||
}); | ||
|
@@ -87,15 +106,40 @@ export default function ({ getService, getPageObjects }) { | |
const tsvb = await find.existsByCssSelector('.vega-view-container'); | ||
expect(tsvb).to.be(true); | ||
}); | ||
|
||
it.skip('should launch sample logs data set dashboard', async ()=> { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test should not be skipped. It is failing because There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. :doh: |
||
await PageObjects.home.launchSampleDataSet('logs'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I could not get this test to pass locally. At this point, the browser is on the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @nreese I think I should be good now, modified to |
||
await PageObjects.header.waitUntilLoadingHasFinished(); | ||
const today = new Date(); | ||
const todayYearMonthDay = today.toISOString().substring(0, 10); | ||
const fromTime = `${todayYearMonthDay} 00:00:00.000`; | ||
const toTime = `${todayYearMonthDay} 23:59:59.999`; | ||
await PageObjects.header.setAbsoluteRange(fromTime, toTime); | ||
const panelCount = await PageObjects.dashboard.getPanelCount(); | ||
expect(panelCount).to.be(11); | ||
}); | ||
|
||
}); | ||
|
||
// needs to be in describe block so it is run after 'dashboard describe block' | ||
describe('uninstall', () => { | ||
it('should uninstall sample data set', async ()=> { | ||
it('should uninstall flights sample data set', async ()=> { | ||
await PageObjects.home.removeSampleDataSet('flights'); | ||
const isInstalled = await PageObjects.home.isSampleDataSetInstalled('flights'); | ||
expect(isInstalled).to.be(false); | ||
}); | ||
|
||
it('should uninstall logs sample data set', async ()=> { | ||
await PageObjects.home.removeSampleDataSet('logs'); | ||
await retry.try(async () => { | ||
const successToastExists = await PageObjects.home.doesSampleDataSetSuccessfulUninstallToastExist(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove the check for the toast notifications. Those are flaky. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ++ removed, testing locally (because I just figured out how to do that 😄 ) |
||
expect(successToastExists).to.be(true); | ||
}); | ||
|
||
const isInstalled = await PageObjects.home.isSampleDataSetInstalled('logs'); | ||
expect(isInstalled).to.be(false); | ||
}); | ||
|
||
}); | ||
}); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the check for the toast notifications. Those are flaky.