Skip to content

Commit

Permalink
[QA] Change default time interval in beats tests for stack integration (
Browse files Browse the repository at this point in the history
elastic#170483)

## Summary

It changes the default time interval for filebeat/metricbeat/packetbeat
integration tests for the stack functional upgrade tests. The data used
for creating the upgrade snapshots is out of the "Last 1 year" interval
used before. Now the interval will be changed to Last 5 years (couldn't
use an absolute date value due to the fact the same tests are used for
regular smoke where the data is recent).
  • Loading branch information
marius-dr authored Nov 2, 2023
1 parent 6b3c13c commit 63ccc1a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@ import { FtrProviderContext } from '../../../functional/ftr_provider_context';
export default function ({ getService, getPageObjects }: FtrProviderContext) {
describe('check filebeat', function () {
const retry = getService('retry');
const kibanaServer = getService('kibanaServer');
const PageObjects = getPageObjects(['common', 'discover', 'timePicker']);

it('filebeat- should have hit count GT 0', async function () {
await kibanaServer.uiSettings.update({
'timepicker:timeDefaults': `{ "from": "now-5y", "to": "now"}`,
});
await PageObjects.common.navigateToApp('discover', { insertTimestamp: false });
await PageObjects.discover.selectIndexPattern('filebeat-*');
await PageObjects.timePicker.setCommonlyUsedTime('Last_1 year');
await retry.try(async () => {
const hitCount = await PageObjects.discover.getHitCountInt();
expect(hitCount).to.be.greaterThan(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const log = getService('log');
const retry = getService('retry');
const browser = getService('browser');
const kibanaServer = getService('kibanaServer');
const PageObjects = getPageObjects(['common', 'discover', 'timePicker']);
const appsMenu = getService('appsMenu');

describe('check metricbeat', function () {
it('metricbeat- should have hit count GT 0', async function () {
const url = await browser.getCurrentUrl();
await kibanaServer.uiSettings.update({
'timepicker:timeDefaults': `{ "from": "now-5y", "to": "now"}`,
});
log.debug(url);
if (!url.includes('kibana')) {
await PageObjects.common.navigateToApp('discover', { insertTimestamp: false });
Expand All @@ -26,7 +30,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
}

await PageObjects.discover.selectIndexPattern('metricbeat-*');
await PageObjects.timePicker.setCommonlyUsedTime('Last_1 year');
await retry.try(async function () {
const hitCount = await PageObjects.discover.getHitCountInt();
expect(hitCount).to.be.greaterThan(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const log = getService('log');
const retry = getService('retry');
const browser = getService('browser');
const kibanaServer = getService('kibanaServer');
const PageObjects = getPageObjects(['common', 'discover', 'timePicker']);
const appsMenu = getService('appsMenu');

Expand All @@ -22,6 +23,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {

it('packetbeat- should have hit count GT 0', async function () {
const url = await browser.getCurrentUrl();
await kibanaServer.uiSettings.update({
'timepicker:timeDefaults': `{ "from": "now-5y", "to": "now"}`,
});
log.debug(url);
if (!url.includes('kibana')) {
await PageObjects.common.navigateToApp('discover', { insertTimestamp: false });
Expand All @@ -30,7 +34,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await appsMenu.clickLink('Discover');
}
await PageObjects.discover.selectIndexPattern('packetbeat-*');
await PageObjects.timePicker.setCommonlyUsedTime('Last_1 year');
await retry.try(async function () {
const hitCount = await PageObjects.discover.getHitCountInt();
expect(hitCount).to.be.greaterThan(0);
Expand Down

0 comments on commit 63ccc1a

Please sign in to comment.