Skip to content

Commit

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

# Backport

This will backport the following commits from `main` to `8.11`:
- [[QA] Change default time interval in beats tests for stack
integration (elastic#170483)](elastic#170483)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Marius
Dragomir","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-11-02T22:07:45Z","message":"[QA]
Change default time interval in beats tests for stack integration
(elastic#170483)\n\n## Summary\r\n\r\nIt changes the default time interval for
filebeat/metricbeat/packetbeat\r\nintegration tests for the stack
functional upgrade tests. The data used\r\nfor creating the upgrade
snapshots is out of the \"Last 1 year\" interval\r\nused before. Now the
interval will be changed to Last 5 years (couldn't\r\nuse an absolute
date value due to the fact the same tests are used for\r\nregular smoke
where the data is
recent).","sha":"63ccc1ae6af66c67c48e99cad8ed9407dcae4387","branchLabelMapping":{"^v8.12.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["test","Team:QA","release_note:skip","test-stack-integration","v8.12.0","v8.11.1"],"number":170483,"url":"https://github.com/elastic/kibana/pull/170483","mergeCommit":{"message":"[QA]
Change default time interval in beats tests for stack integration
(elastic#170483)\n\n## Summary\r\n\r\nIt changes the default time interval for
filebeat/metricbeat/packetbeat\r\nintegration tests for the stack
functional upgrade tests. The data used\r\nfor creating the upgrade
snapshots is out of the \"Last 1 year\" interval\r\nused before. Now the
interval will be changed to Last 5 years (couldn't\r\nuse an absolute
date value due to the fact the same tests are used for\r\nregular smoke
where the data is
recent).","sha":"63ccc1ae6af66c67c48e99cad8ed9407dcae4387"}},"sourceBranch":"main","suggestedTargetBranches":["8.11"],"targetPullRequestStates":[{"branch":"main","label":"v8.12.0","labelRegex":"^v8.12.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/170483","number":170483,"mergeCommit":{"message":"[QA]
Change default time interval in beats tests for stack integration
(elastic#170483)\n\n## Summary\r\n\r\nIt changes the default time interval for
filebeat/metricbeat/packetbeat\r\nintegration tests for the stack
functional upgrade tests. The data used\r\nfor creating the upgrade
snapshots is out of the \"Last 1 year\" interval\r\nused before. Now the
interval will be changed to Last 5 years (couldn't\r\nuse an absolute
date value due to the fact the same tests are used for\r\nregular smoke
where the data is
recent).","sha":"63ccc1ae6af66c67c48e99cad8ed9407dcae4387"}},{"branch":"8.11","label":"v8.11.1","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Marius Dragomir <[email protected]>
  • Loading branch information
kibanamachine and marius-dr authored Nov 2, 2023
1 parent 5b0b46d commit 80840ed
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 80840ed

Please sign in to comment.