From cb246490e48d86922ca5662e72d33c13eed7fb29 Mon Sep 17 00:00:00 2001 From: alecmerdler Date: Sat, 6 Oct 2018 19:57:37 -0400 Subject: [PATCH] debugging performance e2e test --- builder-run.sh | 2 +- .../integration-tests/tests/crud.scenario.ts | 2 +- .../tests/performance.scenario.ts | 18 ++++++++++++++---- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/builder-run.sh b/builder-run.sh index 31be5659c6b2..00305343bdc5 100755 --- a/builder-run.sh +++ b/builder-run.sh @@ -30,6 +30,6 @@ docker run $ENV_STR --rm --net=host \ --user="${BUILDER_RUN_USER}" \ $VOLUME_MOUNT \ -v "$(pwd)":/go/src/github.com/openshift/console \ - --shm-size=256m \ + --shm-size=512m \ -w /go/src/github.com/openshift/console \ $BUILDER_IMAGE "$@" diff --git a/frontend/integration-tests/tests/crud.scenario.ts b/frontend/integration-tests/tests/crud.scenario.ts index bd060fbe8d26..32c874d26bb7 100644 --- a/frontend/integration-tests/tests/crud.scenario.ts +++ b/frontend/integration-tests/tests/crud.scenario.ts @@ -13,7 +13,7 @@ import * as namespaceView from '../views/namespace.view'; const K8S_CREATION_TIMEOUT = 15000; -describe('Kubernetes resource CRUD operations', () => { +xdescribe('Kubernetes resource CRUD operations', () => { const testLabel = 'automatedTestName'; const leakedResources = new Set(); const k8sObjs = OrderedMap() diff --git a/frontend/integration-tests/tests/performance.scenario.ts b/frontend/integration-tests/tests/performance.scenario.ts index 724fc2aafa14..ef90aaa851af 100644 --- a/frontend/integration-tests/tests/performance.scenario.ts +++ b/frontend/integration-tests/tests/performance.scenario.ts @@ -35,7 +35,7 @@ const chunkedRoutes = OrderedMap() describe('Performance test', () => { it('checks bundle size using ResourceTiming API', async() => { - const resources = await browser.executeScript<{name: string, size: number}[]>(() => performance.getEntriesByType('resource') + const resources = await browser.executeScript(() => performance.getEntriesByType('resource') .filter(({name}) => name.endsWith('.js') && name.indexOf('main') > -1 && name.indexOf('runtime') === -1) .map(({name, decodedBodySize}) => ({name: name.split('/').slice(-1)[0], size: Math.floor(decodedBodySize / 1024)})) .reduce((acc, val) => acc.concat(`${val.name.split('-')[0]}: ${val.size} KB, `), '') @@ -47,7 +47,7 @@ describe('Performance test', () => { }); it('downloads new bundle for "Overview" route', async() => { - browser.get(`${appHost}/status/all-namespaces`); + await browser.get(`${appHost}/status/all-namespaces`); await browser.wait(until.presenceOf(crudView.resourceTitle)); const overviewChunk = await browser.executeScript(() => performance.getEntriesByType('resource') @@ -81,14 +81,24 @@ describe('Performance test', () => { return performance.getEntriesByType('resource').find(({name}) => name.endsWith('.js') && name.indexOf(chunkName) > -1); }; + const routeChunks = function() { + return performance.getEntriesByType('resource').filter(({name}) => name.endsWith('.js')).map(e => `${e.name} - ${Math.floor(e.decodedBodySize / 1024)} KB`); + }; + it(`downloads new bundle for ${routeName}`, async() => { + await browser.get(`${appHost}/status/all-namespaces`); + await browser.wait(until.presenceOf(crudView.resourceTitle)); await sidenavView.clickNavLink([route.section, route.name]); await crudView.isLoaded(); - const routeChunk = await browser.executeScript(routeChunkFor, routeName); + // FIXME(alecmerdler): Debugging the last route test always failing, regardless of chunk + const chunks = await browser.executeScript(routeChunks); + console.log(chunks); + + const routeChunk = await browser.executeScript(routeChunkFor, routeName); expect(routeChunk).toBeDefined(); - expect(routeChunk.decodedBodySize).toBeLessThan(chunkLimit); + expect((routeChunk as any).decodedBodySize).toBeLessThan(chunkLimit); }); }); });