Skip to content

Commit

Permalink
Set UTC timezone and default index pattern AFTER wiping .kibana (#11527)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lee Drengenberg authored May 4, 2017
1 parent 7e74b2d commit e0e064a
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 30 deletions.
6 changes: 6 additions & 0 deletions test/functional/apps/context/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export default function ({ getService, getPageObjects, loadTestFile }) {
const remote = getService('remote');
const esArchiver = getService('esArchiver');
const PageObjects = getPageObjects(['common']);
const kibanaServer = getService('kibanaServer');

describe('context app', function () {
this.timeout(config.get('timeouts.test'));
Expand All @@ -11,6 +12,11 @@ export default function ({ getService, getPageObjects, loadTestFile }) {
await remote.setWindowSize(1200,800);
await esArchiver.loadIfNeeded('logstash_functional');
await esArchiver.load('visualize');
await kibanaServer.uiSettings.replace({
'dateFormat:tz':'UTC',
'defaultIndex':'logstash-*'
});

await PageObjects.common.navigateToApp('discover');
});

Expand Down
10 changes: 5 additions & 5 deletions test/functional/apps/discover/_collapse_expand.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ export default function ({ getService, getPageObjects }) {
const toTime = '2015-09-23 18:31:44.000';

// delete .kibana index and update configDoc
return kibanaServer.uiSettings.replace({
'dateFormat:tz':'UTC',
'defaultIndex':'logstash-*'
})
return esArchiver.load('discover')
.then(function loadkibanaIndexPattern() {
log.debug('load kibana index with default index pattern');
return esArchiver.load('discover');
return kibanaServer.uiSettings.replace({
'dateFormat:tz':'UTC',
'defaultIndex':'logstash-*'
});
})
// and load a set of makelogs data
.then(function loadIfEmptyMakelogs() {
Expand Down
6 changes: 3 additions & 3 deletions test/functional/apps/discover/_discover.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ export default function ({ getService, getPageObjects }) {

before(async function () {
// delete .kibana index and update configDoc
await esArchiver.load('discover');

log.debug('load kibana index with default index pattern');
await kibanaServer.uiSettings.replace({
'dateFormat:tz':'UTC',
'defaultIndex':'logstash-*'
});

log.debug('load kibana index with default index pattern');
await esArchiver.load('discover');

// and load a set of makelogs data
await esArchiver.loadIfNeeded('logstash_functional');
log.debug('discover');
Expand Down
10 changes: 5 additions & 5 deletions test/functional/apps/discover/_field_data.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ export default function ({ getService, getPageObjects }) {
const toTime = '2015-09-23 18:31:44.000';

// delete .kibana index and update configDoc
return kibanaServer.uiSettings.replace({
'dateFormat:tz': 'UTC',
'defaultIndex': 'logstash-*'
})
return esArchiver.load('discover')
.then(function loadkibanaIndexPattern() {
log.debug('load kibana index with default index pattern');
return esArchiver.load('discover');
return kibanaServer.uiSettings.replace({
'dateFormat:tz': 'UTC',
'defaultIndex': 'logstash-*'
});
})
// and load a set of makelogs data
.then(function loadIfEmptyMakelogs() {
Expand Down
10 changes: 5 additions & 5 deletions test/functional/apps/discover/_shared_links.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ export default function ({ getService, getPageObjects }) {
const toTime = '2015-09-23 18:31:44.000';

// delete .kibana index and update configDoc
return kibanaServer.uiSettings.replace({
'dateFormat:tz': 'UTC',
'defaultIndex': 'logstash-*'
})
return esArchiver.load('discover')
.then(function loadkibanaIndexPattern() {
log.debug('load kibana index with default index pattern');
return esArchiver.load('discover');
return kibanaServer.uiSettings.replace({
'dateFormat:tz': 'UTC',
'defaultIndex': 'logstash-*'
});
})
// and load a set of makelogs data
.then(function loadIfEmptyMakelogs() {
Expand Down
10 changes: 5 additions & 5 deletions test/functional/apps/discover/_source_filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ export default function ({ getService, getPageObjects }) {
const toTime = '2015-09-23 18:31:44.000';

// delete .kibana index and update configDoc
return kibanaServer.uiSettings.replace({
'dateFormat:tz': 'UTC',
'defaultIndex':'logstash-*'
})
return esArchiver.load('visualize_source-filters')
.then(function loadkibanaIndexPattern() {
log.debug('load kibana index with default index pattern');
return esArchiver.load('visualize_source-filters');
return kibanaServer.uiSettings.replace({
'dateFormat:tz': 'UTC',
'defaultIndex':'logstash-*'
});
})
// and load a set of makelogs data
.then(function loadIfEmptyMakelogs() {
Expand Down
8 changes: 4 additions & 4 deletions test/functional/apps/visualize/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ export default function ({ getService, loadTestFile }) {

log.debug('Starting visualize before method');
const logstash = esArchiver.loadIfNeeded('logstash_functional');
// delete .kibana index and update configDoc
return kibanaServer.uiSettings.replace({ 'dateFormat:tz':'UTC', 'defaultIndex':'logstash-*' })
log.debug('load .kibana index with visualize test data');
return esArchiver.load('visualize')
.then(function loadkibanaIndexPattern() {
log.debug('load kibana index with default index pattern');
return esArchiver.load('visualize');
log.debug('make sure UTC timezone and default index pattern are set in .kibana');
return kibanaServer.uiSettings.replace({ 'dateFormat:tz':'UTC', 'defaultIndex':'logstash-*' });
})
// wait for the logstash data load to finish if it hasn't already
.then(function () {
Expand Down
6 changes: 3 additions & 3 deletions test/functional/page_objects/dashboard_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ export function DashboardPageProvider({ getService, getPageObjects }) {
class DashboardPage {
async initTests() {
const logstash = esArchiver.loadIfNeeded('logstash_functional');

log.debug('load kibana index with visualizations');
await esArchiver.load('dashboard');
await kibanaServer.uiSettings.replace({
'dateFormat:tz':'UTC',
'defaultIndex':'logstash-*'
});

log.debug('load kibana index with visualizations');
await esArchiver.load('dashboard');

await PageObjects.common.navigateToApp('dashboard');
return logstash;
}
Expand Down

0 comments on commit e0e064a

Please sign in to comment.