From 216ff9217b3ed3c4cc2f702b526f5176117d256c Mon Sep 17 00:00:00 2001 From: Chris Roberson Date: Tue, 12 Feb 2019 14:09:10 -0500 Subject: [PATCH 1/2] Skip tests for cloud --- .../apis/monitoring/cluster/overview.js | 4 +- .../monitoring/elasticsearch/node_detail.js | 4 +- .../elasticsearch_settings/check_nodes.js | 4 +- .../monitoring/standalone_cluster/clusters.js | 4 +- .../apps/monitoring/cluster/list.js | 12 +- .../apps/monitoring/elasticsearch/nodes.js | 122 +++++++++--------- 6 files changed, 83 insertions(+), 67 deletions(-) diff --git a/x-pack/test/api_integration/apis/monitoring/cluster/overview.js b/x-pack/test/api_integration/apis/monitoring/cluster/overview.js index d7dcb4a37a192..7c213aea635f2 100644 --- a/x-pack/test/api_integration/apis/monitoring/cluster/overview.js +++ b/x-pack/test/api_integration/apis/monitoring/cluster/overview.js @@ -11,7 +11,9 @@ export default function ({ getService }) { const supertest = getService('supertest'); const esArchiver = getService('esArchiver'); - describe('overview', () => { + describe('overview', function () { + this.tags(['skipCloud']); + describe('with trial license clusters', () => { const archive = 'monitoring/singlecluster-green-gold'; const timeRange = { diff --git a/x-pack/test/api_integration/apis/monitoring/elasticsearch/node_detail.js b/x-pack/test/api_integration/apis/monitoring/elasticsearch/node_detail.js index 99702267d12f4..9160f18f5f427 100644 --- a/x-pack/test/api_integration/apis/monitoring/elasticsearch/node_detail.js +++ b/x-pack/test/api_integration/apis/monitoring/elasticsearch/node_detail.js @@ -11,7 +11,9 @@ export default function ({ getService }) { const supertest = getService('supertest'); const esArchiver = getService('esArchiver'); - describe('node detail', () => { + describe('node detail', function () { + this.tags(['skipCloud']); + const archive = 'monitoring/singlecluster-three-nodes-shard-relocation'; const timeRange = { min: '2017-10-05T20:31:48.000Z', diff --git a/x-pack/test/api_integration/apis/monitoring/elasticsearch_settings/check_nodes.js b/x-pack/test/api_integration/apis/monitoring/elasticsearch_settings/check_nodes.js index 6a833d2b308b9..74ef0c01b1b9f 100644 --- a/x-pack/test/api_integration/apis/monitoring/elasticsearch_settings/check_nodes.js +++ b/x-pack/test/api_integration/apis/monitoring/elasticsearch_settings/check_nodes.js @@ -9,7 +9,9 @@ import expect from 'expect.js'; export default function ({ getService }) { const supertest = getService('supertest'); - describe('check nodes settings', () => { + describe('check nodes settings', function () { + this.tags(['skipCloud']); + it('should check node settings', async () => { const { body } = await supertest .get('/api/monitoring/v1/elasticsearch_settings/check/nodes') diff --git a/x-pack/test/api_integration/apis/monitoring/standalone_cluster/clusters.js b/x-pack/test/api_integration/apis/monitoring/standalone_cluster/clusters.js index 7489708d408ad..bb72e64ede4cf 100644 --- a/x-pack/test/api_integration/apis/monitoring/standalone_cluster/clusters.js +++ b/x-pack/test/api_integration/apis/monitoring/standalone_cluster/clusters.js @@ -11,7 +11,9 @@ export default function ({ getService }) { const supertest = getService('supertest'); const esArchiver = getService('esArchiver'); - describe('clusters', () => { + describe('clusters', function () { + this.tags(['skipCloud']); + const archive = 'monitoring/standalone_cluster'; const timeRange = { min: '2019-02-04T16:52:11.741Z', diff --git a/x-pack/test/functional/apps/monitoring/cluster/list.js b/x-pack/test/functional/apps/monitoring/cluster/list.js index eae7882a2748c..c8a3fe8a43626 100644 --- a/x-pack/test/functional/apps/monitoring/cluster/list.js +++ b/x-pack/test/functional/apps/monitoring/cluster/list.js @@ -87,7 +87,9 @@ export default function ({ getService, getPageObjects }) { await tearDown(); }); - describe('cluster row content', () => { + describe('cluster row content', function () { + this.tags(['skipCloud']); + it('non-primary basic cluster shows NA for everything', async () => { expect(await clusterList.getClusterName(UNSUPPORTED_CLUSTER_UUID)).to.be('staging'); expect(await clusterList.getClusterStatus(UNSUPPORTED_CLUSTER_UUID)).to.be('-'); @@ -111,20 +113,22 @@ export default function ({ getService, getPageObjects }) { }); }); - describe('cluster row actions', () => { + describe('cluster row actions', function () { + this.tags(['skipCloud']); + it('clicking the non-primary basic cluster shows a toast message', async () => { const basicClusterLink = await clusterList.getClusterLink(UNSUPPORTED_CLUSTER_UUID); await basicClusterLink.click(); expect(await testSubjects.exists('monitoringLicenseWarning', { timeout: 2000 })).to.be(true); }); - it('clicking the primary basic cluster goes to overview', async () => { + it('clicking the primary basic cluster goes to overview', async function () { const primaryBasicClusterLink = await clusterList.getClusterLink(SUPPORTED_CLUSTER_UUID); await primaryBasicClusterLink.click(); expect(await clusterOverview.isOnClusterOverview()).to.be(true); - expect(await clusterOverview.getClusterName()).to.be('production'); + await PageObjects.monitoring.clickBreadcrumb('breadcrumbClusters'); // reset for next test }); diff --git a/x-pack/test/functional/apps/monitoring/elasticsearch/nodes.js b/x-pack/test/functional/apps/monitoring/elasticsearch/nodes.js index 4b15576572ce0..3246097744465 100644 --- a/x-pack/test/functional/apps/monitoring/elasticsearch/nodes.js +++ b/x-pack/test/functional/apps/monitoring/elasticsearch/nodes.js @@ -44,40 +44,70 @@ export default function ({ getService, getPageObjects }) { }); }); - it('should have a nodes table with correct rows with default sorting', async () => { - const rows = await nodesList.getRows(); - expect(rows.length).to.be(3); + describe('skipCloud', function () { + this.tags(['skipCloud']); + + it('should have a nodes table with correct rows with default sorting', async () => { + const rows = await nodesList.getRows(); + expect(rows.length).to.be(3); + + const nodesAll = await nodesList.getNodesAll(); + const tableData = [ + { + name: 'whatever-01', + status: 'Status: Online', + cpu: '0% \n3% max\n0% min', + load: '3.28 \n3.71 max\n2.19 min', + memory: '39% \n52% max\n25% min', + disk: '173.9 GB \n173.9 GB max\n173.9 GB min', + shards: '38', + }, + { + name: 'whatever-02', + status: 'Status: Online', + cpu: '2% \n3% max\n0% min', + load: '3.28 \n3.73 max\n2.29 min', + memory: '25% \n49% max\n25% min', + disk: '173.9 GB \n173.9 GB max\n173.9 GB min', + shards: '38', + }, + { name: 'whatever-03', status: 'Status: Offline' }, + ]; + nodesAll.forEach((obj, node) => { + expect(nodesAll[node].name).to.be(tableData[node].name); + expect(nodesAll[node].status).to.be(tableData[node].status); + expect(nodesAll[node].cpu).to.be(tableData[node].cpu); + expect(nodesAll[node].load).to.be(tableData[node].load); + expect(nodesAll[node].memory).to.be(tableData[node].memory); + expect(nodesAll[node].disk).to.be(tableData[node].disk); + expect(nodesAll[node].shards).to.be(tableData[node].shards); + }); + }); - const nodesAll = await nodesList.getNodesAll(); - const tableData = [ - { - name: 'whatever-01', - status: 'Status: Online', - cpu: '0% \n3% max\n0% min', - load: '3.28 \n3.71 max\n2.19 min', - memory: '39% \n52% max\n25% min', - disk: '173.9 GB \n173.9 GB max\n173.9 GB min', - shards: '38', - }, - { - name: 'whatever-02', - status: 'Status: Online', - cpu: '2% \n3% max\n0% min', - load: '3.28 \n3.73 max\n2.29 min', - memory: '25% \n49% max\n25% min', - disk: '173.9 GB \n173.9 GB max\n173.9 GB min', - shards: '38', - }, - { name: 'whatever-03', status: 'Status: Offline' }, - ]; - nodesAll.forEach((obj, node) => { - expect(nodesAll[node].name).to.be(tableData[node].name); - expect(nodesAll[node].status).to.be(tableData[node].status); - expect(nodesAll[node].cpu).to.be(tableData[node].cpu); - expect(nodesAll[node].load).to.be(tableData[node].load); - expect(nodesAll[node].memory).to.be(tableData[node].memory); - expect(nodesAll[node].disk).to.be(tableData[node].disk); - expect(nodesAll[node].shards).to.be(tableData[node].shards); + it('should sort by cpu', async () => { + await nodesList.clickCpuCol(); + await nodesList.clickCpuCol(); + + const nodesAll = await nodesList.getNodesAll(); + const tableData = [{ cpu: '0% \n3% max\n0% min' }, { cpu: '2% \n3% max\n0% min' }, { cpu: undefined }]; + nodesAll.forEach((obj, node) => { + expect(nodesAll[node].cpu).to.be(tableData[node].cpu); + }); + }); + + it('should sort by load average', async () => { + await nodesList.clickLoadCol(); + await nodesList.clickLoadCol(); + + const nodesAll = await nodesList.getNodesAll(); + const tableData = [ + { load: '3.28 \n3.71 max\n2.19 min' }, + { load: '3.28 \n3.73 max\n2.29 min' }, + { load: undefined }, + ]; + nodesAll.forEach((obj, node) => { + expect(nodesAll[node].load).to.be(tableData[node].load); + }); }); }); @@ -111,32 +141,6 @@ export default function ({ getService, getPageObjects }) { }); }); - it('should sort by cpu', async () => { - await nodesList.clickCpuCol(); - await nodesList.clickCpuCol(); - - const nodesAll = await nodesList.getNodesAll(); - const tableData = [{ cpu: '0% \n3% max\n0% min' }, { cpu: '2% \n3% max\n0% min' }, { cpu: undefined }]; - nodesAll.forEach((obj, node) => { - expect(nodesAll[node].cpu).to.be(tableData[node].cpu); - }); - }); - - it('should sort by load average', async () => { - await nodesList.clickLoadCol(); - await nodesList.clickLoadCol(); - - const nodesAll = await nodesList.getNodesAll(); - const tableData = [ - { load: '3.28 \n3.71 max\n2.19 min' }, - { load: '3.28 \n3.73 max\n2.29 min' }, - { load: undefined }, - ]; - nodesAll.forEach((obj, node) => { - expect(nodesAll[node].load).to.be(tableData[node].load); - }); - }); - it('should sort by memory', async () => { await nodesList.clickMemoryCol(); await nodesList.clickMemoryCol(); From d2c11d0deefc0a1fc63122fd95201c6119c5ed0c Mon Sep 17 00:00:00 2001 From: Chris Roberson Date: Wed, 13 Feb 2019 13:19:56 -0500 Subject: [PATCH 2/2] Add TODOs --- x-pack/test/api_integration/apis/monitoring/cluster/overview.js | 1 + .../apis/monitoring/elasticsearch/node_detail.js | 1 + .../apis/monitoring/elasticsearch_settings/check_nodes.js | 1 + .../apis/monitoring/standalone_cluster/clusters.js | 1 + x-pack/test/functional/apps/monitoring/cluster/list.js | 2 ++ x-pack/test/functional/apps/monitoring/elasticsearch/nodes.js | 1 + 6 files changed, 7 insertions(+) diff --git a/x-pack/test/api_integration/apis/monitoring/cluster/overview.js b/x-pack/test/api_integration/apis/monitoring/cluster/overview.js index 7c213aea635f2..57be7082d6971 100644 --- a/x-pack/test/api_integration/apis/monitoring/cluster/overview.js +++ b/x-pack/test/api_integration/apis/monitoring/cluster/overview.js @@ -12,6 +12,7 @@ export default function ({ getService }) { const esArchiver = getService('esArchiver'); describe('overview', function () { + // TODO: https://github.com/elastic/stack-monitoring/issues/31 this.tags(['skipCloud']); describe('with trial license clusters', () => { diff --git a/x-pack/test/api_integration/apis/monitoring/elasticsearch/node_detail.js b/x-pack/test/api_integration/apis/monitoring/elasticsearch/node_detail.js index 9160f18f5f427..35fc50c14d278 100644 --- a/x-pack/test/api_integration/apis/monitoring/elasticsearch/node_detail.js +++ b/x-pack/test/api_integration/apis/monitoring/elasticsearch/node_detail.js @@ -12,6 +12,7 @@ export default function ({ getService }) { const esArchiver = getService('esArchiver'); describe('node detail', function () { + // TODO: https://github.com/elastic/stack-monitoring/issues/31 this.tags(['skipCloud']); const archive = 'monitoring/singlecluster-three-nodes-shard-relocation'; diff --git a/x-pack/test/api_integration/apis/monitoring/elasticsearch_settings/check_nodes.js b/x-pack/test/api_integration/apis/monitoring/elasticsearch_settings/check_nodes.js index 74ef0c01b1b9f..0c500610b1ed6 100644 --- a/x-pack/test/api_integration/apis/monitoring/elasticsearch_settings/check_nodes.js +++ b/x-pack/test/api_integration/apis/monitoring/elasticsearch_settings/check_nodes.js @@ -10,6 +10,7 @@ export default function ({ getService }) { const supertest = getService('supertest'); describe('check nodes settings', function () { + // TODO: https://github.com/elastic/stack-monitoring/issues/31 this.tags(['skipCloud']); it('should check node settings', async () => { diff --git a/x-pack/test/api_integration/apis/monitoring/standalone_cluster/clusters.js b/x-pack/test/api_integration/apis/monitoring/standalone_cluster/clusters.js index bb72e64ede4cf..e4a99127c7bb3 100644 --- a/x-pack/test/api_integration/apis/monitoring/standalone_cluster/clusters.js +++ b/x-pack/test/api_integration/apis/monitoring/standalone_cluster/clusters.js @@ -12,6 +12,7 @@ export default function ({ getService }) { const esArchiver = getService('esArchiver'); describe('clusters', function () { + // TODO: https://github.com/elastic/stack-monitoring/issues/31 this.tags(['skipCloud']); const archive = 'monitoring/standalone_cluster'; diff --git a/x-pack/test/functional/apps/monitoring/cluster/list.js b/x-pack/test/functional/apps/monitoring/cluster/list.js index c8a3fe8a43626..aa2e8ff8ee045 100644 --- a/x-pack/test/functional/apps/monitoring/cluster/list.js +++ b/x-pack/test/functional/apps/monitoring/cluster/list.js @@ -88,6 +88,7 @@ export default function ({ getService, getPageObjects }) { }); describe('cluster row content', function () { + // TODO: https://github.com/elastic/stack-monitoring/issues/31 this.tags(['skipCloud']); it('non-primary basic cluster shows NA for everything', async () => { @@ -114,6 +115,7 @@ export default function ({ getService, getPageObjects }) { }); describe('cluster row actions', function () { + // TODO: https://github.com/elastic/stack-monitoring/issues/31 this.tags(['skipCloud']); it('clicking the non-primary basic cluster shows a toast message', async () => { diff --git a/x-pack/test/functional/apps/monitoring/elasticsearch/nodes.js b/x-pack/test/functional/apps/monitoring/elasticsearch/nodes.js index 3246097744465..f57677411c210 100644 --- a/x-pack/test/functional/apps/monitoring/elasticsearch/nodes.js +++ b/x-pack/test/functional/apps/monitoring/elasticsearch/nodes.js @@ -45,6 +45,7 @@ export default function ({ getService, getPageObjects }) { }); describe('skipCloud', function () { + // TODO: https://github.com/elastic/stack-monitoring/issues/31 this.tags(['skipCloud']); it('should have a nodes table with correct rows with default sorting', async () => {