From fdb64ba0e2f58334d0ebcb159f08273243051d89 Mon Sep 17 00:00:00 2001 From: Ryan Hall Date: Mon, 11 Nov 2019 16:46:22 -0500 Subject: [PATCH 1/5] remove puppeteer dependency --- explorer/package.json | 4 --- yarn.lock | 60 +++---------------------------------------- 2 files changed, 3 insertions(+), 61 deletions(-) diff --git a/explorer/package.json b/explorer/package.json index 0034c179e50..c1f763e7f24 100644 --- a/explorer/package.json +++ b/explorer/package.json @@ -60,7 +60,6 @@ "@chainlink/prettier-config": "0.0.1", "@types/bcrypt": "^3.0.0", "@types/cookie-session": "^2.0.37", - "@types/expect-puppeteer": "^3.3.1", "@types/express": "^4.16.1", "@types/express-winston": "^3.0.1", "@types/helmet": "0.0.43", @@ -70,7 +69,6 @@ "@types/mime-types": "^2.1.0", "@types/node": "^11.11.3", "@types/node-fetch": "^2.5.0", - "@types/puppeteer": "^1.12.0", "@types/supertest": "^2.0.7", "@types/uuid": "^3.4.4", "@types/ws": "^6.0.1", @@ -79,12 +77,10 @@ "cross-env": "^6.0.3", "depcheck": "^0.8.3", "eslint": "^6.3.0", - "expect-puppeteer": "^4.1.0", "http-status-codes": "^1.3.2", "jest": "^24.7.0", "node-fetch": "^2.6.0", "prettier": "^1.18.2", - "puppeteer": "^1.20.0", "supertest": "^4.0.2", "ts-jest": "^24.0.0", "ts-node-dev": "^1.0.0-pre.40", diff --git a/yarn.lock b/yarn.lock index 3e776ebb09b..29bb9d8ecfd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2668,14 +2668,6 @@ resolved "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz#2862f3f58a9a7f7c3e78d79f130dd4d71c25c2a7" integrity sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g== -"@types/expect-puppeteer@^3.3.1": - version "3.3.1" - resolved "https://registry.npmjs.org/@types/expect-puppeteer/-/expect-puppeteer-3.3.1.tgz#46e5944bf425b86ea13a563c7c8b86901414988d" - integrity sha512-3raSnf28NelDtv0ksvQPZs410taJZ4d70vA8sVzmbRPV04fpmQm9/BOxUCloETD/ZI1EXRpv0pzOQKhPTbm4jg== - dependencies: - "@types/jest" "*" - "@types/puppeteer" "*" - "@types/express-serve-static-core@*": version "4.16.9" resolved "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.16.9.tgz#69e00643b0819b024bdede95ced3ff239bb54558" @@ -2788,7 +2780,7 @@ resolved "https://registry.npmjs.org/@types/jest-diff/-/jest-diff-20.0.1.tgz#35cc15b9c4f30a18ef21852e255fdb02f6d59b89" integrity sha512-yALhelO3i0hqZwhjtcr6dYyaLoCHbAMshwtj6cGxTvHZAKXHsYGdff6E8EPw3xLKY0ELUTQ69Q1rQiJENnccMA== -"@types/jest@*", "@types/jest@^24.0.0", "@types/jest@^24.0.18": +"@types/jest@^24.0.0", "@types/jest@^24.0.18": version "24.0.18" resolved "https://registry.npmjs.org/@types/jest/-/jest-24.0.18.tgz#9c7858d450c59e2164a8a9df0905fc5091944498" integrity sha512-jcDDXdjTcrQzdN06+TSVsPPqxvsZA/5QkYfIZlq1JMw7FdP5AZylbOc+6B/cuDurctRe+MziUMtQ3xQdrbjqyQ== @@ -2917,13 +2909,6 @@ resolved "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.2.tgz#0e58ae66773d7fd7c372a493aff740878ec9ceaa" integrity sha512-f8JzJNWVhKtc9dg/dyDNfliTKNOJSLa7Oht/ElZdF/UbMUmAH3rLmAk3ODNjw0mZajDEgatA03tRjB4+Dp/tzA== -"@types/puppeteer@*", "@types/puppeteer@^1.12.0": - version "1.20.0" - resolved "https://registry.yarnpkg.com/@types/puppeteer/-/puppeteer-1.20.0.tgz#8a09062a744ca1e2f0607468d810b149ab7cf97f" - integrity sha512-V3nWu/ENNW7LzHumrgf1D+HnIEQHE+nHThq9MTPmGjQC75SVlWsalCp1OaZFaDeuUgWOmQPIBhSLz0cz+Hlz8w== - dependencies: - "@types/node" "*" - "@types/q@^1.5.1": version "1.5.2" resolved "https://registry.npmjs.org/@types/q/-/q-1.5.2.tgz#690a1475b84f2a884fd07cd797c00f5f31356ea8" @@ -3656,13 +3641,6 @@ after@0.8.2: resolved "https://registry.npmjs.org/after/-/after-0.8.2.tgz#fedb394f9f0e02aa9768e702bda23b505fae7e1f" integrity sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8= -agent-base@^4.1.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.1.tgz#d89e5999f797875674c07d87f260fc41e83e8ca9" - integrity sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg== - dependencies: - es6-promisify "^5.0.0" - "airbnb-js-shims@^1 || ^2": version "2.2.0" resolved "https://registry.npmjs.org/airbnb-js-shims/-/airbnb-js-shims-2.2.0.tgz#46e1d9d9516f704ef736de76a3b6d484df9a96d8" @@ -9823,11 +9801,6 @@ expect-ct@0.2.0: resolved "https://registry.npmjs.org/expect-ct/-/expect-ct-0.2.0.tgz#3a54741b6ed34cc7a93305c605f63cd268a54a62" integrity sha512-6SK3MG/Bbhm8MsgyJAylg+ucIOU71/FzyFalcfu5nY19dH8y/z0tBJU0wrNBXD4B27EoQtqPF/9wqH0iYAd04g== -expect-puppeteer@^4.1.0: - version "4.3.0" - resolved "https://registry.npmjs.org/expect-puppeteer/-/expect-puppeteer-4.3.0.tgz#732a3c94ab44af0c7d947040ad3e3637a0359bf3" - integrity sha512-p8N/KSVPG9PAOJlftK5f1n3JrULJ6Qq1EQ8r/n9xzkX2NmXbK8PcnJnkSAEzEHrMycELKGnlJV7M5nkgm+wEWA== - expect@^24.9.0: version "24.9.0" resolved "https://registry.npmjs.org/expect/-/expect-24.9.0.tgz#b75165b4817074fa4a157794f46fe9f1ba15b6ca" @@ -9945,7 +9918,7 @@ extract-css-chunks-webpack-plugin@^3.2.1: schema-utils "^1.0.0" webpack-sources "^1.1.0" -extract-zip@1.6.7, extract-zip@^1.6.6: +extract-zip@1.6.7: version "1.6.7" resolved "https://registry.npmjs.org/extract-zip/-/extract-zip-1.6.7.tgz#a840b4b8af6403264c8db57f4f1a74333ef81fe9" integrity sha1-qEC0uK9kAyZMjbV/Txp0Mz74H+k= @@ -11870,14 +11843,6 @@ https-browserify@^1.0.0: resolved "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" integrity sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM= -https-proxy-agent@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz#51552970fa04d723e04c56d04178c3f92592bbc0" - integrity sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ== - dependencies: - agent-base "^4.1.0" - debug "^3.1.0" - human-signals@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3" @@ -17651,11 +17616,6 @@ proxy-addr@~2.0.5: forwarded "~0.1.2" ipaddr.js "1.9.0" -proxy-from-env@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.0.0.tgz#33c50398f70ea7eb96d21f7b817630a55791c7ee" - integrity sha1-M8UDmPcOp+uW0h97gXYwpVeRx+4= - prr@~1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" @@ -17784,20 +17744,6 @@ punycode@^2.1.0, punycode@^2.1.1: resolved "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== -puppeteer@^1.20.0: - version "1.20.0" - resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-1.20.0.tgz#e3d267786f74e1d87cf2d15acc59177f471bbe38" - integrity sha512-bt48RDBy2eIwZPrkgbcwHtb51mj2nKvHOPMaSH2IsWiv7lOG9k9zhaRzpDZafrk05ajMc3cu+lSQYYOfH2DkVQ== - dependencies: - debug "^4.1.0" - extract-zip "^1.6.6" - https-proxy-agent "^2.2.1" - mime "^2.0.3" - progress "^2.0.1" - proxy-from-env "^1.0.0" - rimraf "^2.6.1" - ws "^6.1.0" - q@2.0.x: version "2.0.3" resolved "https://registry.npmjs.org/q/-/q-2.0.3.tgz#75b8db0255a1a5af82f58c3f3aaa1efec7d0d134" @@ -23634,7 +23580,7 @@ ws@^5.1.1, ws@^5.2.0: dependencies: async-limiter "~1.0.0" -ws@^6.0.0, ws@^6.1.0, ws@^6.1.2, ws@^6.2.1: +ws@^6.0.0, ws@^6.1.2, ws@^6.2.1: version "6.2.1" resolved "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz#442fdf0a47ed64f59b6a5d8ff130f4748ed524fb" integrity sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA== From eb32d5b835da4c3e8746a733d8f41ba6f637e62e Mon Sep 17 00:00:00 2001 From: Ryan Hall Date: Mon, 11 Nov 2019 16:55:36 -0500 Subject: [PATCH 2/5] add jobRunId detection to integration test --- integration/cypress/integration/createAndRunJob.spec.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/integration/cypress/integration/createAndRunJob.spec.ts b/integration/cypress/integration/createAndRunJob.spec.ts index 906ab7480d7..92cb7eb7a77 100644 --- a/integration/cypress/integration/createAndRunJob.spec.ts +++ b/integration/cypress/integration/createAndRunJob.spec.ts @@ -40,5 +40,8 @@ context('End to end', function() { cy.clickLink(runId) }) cy.contains('h5', 'Complete').should('exist') + cy.get('@runId').then(runId => { + cy.contains(runId).should('exist') + }) }) }) From 1841c82037a02f7f4723d153220278b2cb5e2dca Mon Sep 17 00:00:00 2001 From: Ryan Hall Date: Mon, 11 Nov 2019 16:56:57 -0500 Subject: [PATCH 3/5] remove puppeteer!! --- explorer/e2e/showJobRun.test.ts | 43 ------------------- .../integration/createAndRunJob.spec.ts | 4 +- 2 files changed, 1 insertion(+), 46 deletions(-) delete mode 100644 explorer/e2e/showJobRun.test.ts diff --git a/explorer/e2e/showJobRun.test.ts b/explorer/e2e/showJobRun.test.ts deleted file mode 100644 index 2ae165a4e63..00000000000 --- a/explorer/e2e/showJobRun.test.ts +++ /dev/null @@ -1,43 +0,0 @@ -import expect from 'expect-puppeteer' -import { Server } from 'http' -import { Browser, launch, Page } from 'puppeteer' -import { getDb } from '../src/database' -import { createChainlinkNode } from '../src/entity/ChainlinkNode' -import { DEFAULT_TEST_PORT, start, stop } from '../src/support/server' -import { createJobRun } from '../src/factories' - -describe('End to end', () => { - let browser: Browser - let page: Page - let server: Server - - beforeAll(async () => { - browser = await launch({ - args: ['--no-sandbox'], - devtools: false, - headless: true, - }) - - page = await browser.newPage() - server = await start() - - page.on('console', msg => console.log('PAGE LOG:', msg.text())) - }) - - afterAll(async done => { - browser.close() - stop(server, done) - }) - - it('can search for job run', async () => { - const db = await getDb() - const [node] = await createChainlinkNode(db, 'endToEndChainlinkNode') - const jobRun = await createJobRun(db, node) - - await page.goto(`http://localhost:${DEFAULT_TEST_PORT}`) - await expect(page).toFill('form input[name=search]', jobRun.runId) - await expect(page).toClick('form button') - await page.waitForNavigation() - await expect(page).toMatch(jobRun.runId) - }) -}) diff --git a/integration/cypress/integration/createAndRunJob.spec.ts b/integration/cypress/integration/createAndRunJob.spec.ts index 92cb7eb7a77..46c01fef92b 100644 --- a/integration/cypress/integration/createAndRunJob.spec.ts +++ b/integration/cypress/integration/createAndRunJob.spec.ts @@ -38,10 +38,8 @@ context('End to end', function() { cy.clickButton('Search') cy.get('@runId').then(runId => { cy.clickLink(runId) - }) - cy.contains('h5', 'Complete').should('exist') - cy.get('@runId').then(runId => { cy.contains(runId).should('exist') }) + cy.contains('h5', 'Complete').should('exist') }) }) From ce64df85cebadf4a7a6e4a633cd44918fe8030af Mon Sep 17 00:00:00 2001 From: Ryan Hall Date: Mon, 11 Nov 2019 17:06:43 -0500 Subject: [PATCH 4/5] remove e2e linting and test scripts --- .circleci/config.yml | 3 --- explorer/tsconfig.json | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 76d96817526..24899be65f7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -274,9 +274,6 @@ jobs: - run: name: Run Client Tests command: yarn workspace @chainlink/explorer-client run test-ci:silent - - run: - name: Run E2E Tests - command: yarn workspace @chainlink/explorer-client run build && yarn workspace @chainlink/explorer run test-ci:e2e:silent - store_artifacts: path: ./integration/logs forks: diff --git a/explorer/tsconfig.json b/explorer/tsconfig.json index 407e608672f..826c0de4d09 100644 --- a/explorer/tsconfig.json +++ b/explorer/tsconfig.json @@ -15,5 +15,5 @@ "baseUrl": ".", "typeRoots": ["node_modules/@types", "../node_modules/@types", "@types"] }, - "include": ["src/**/*", "e2e/**/*"] + "include": ["src/**/*"] } From 03ab0cddc0daa5c72f3ff1515d64c2fecb48aeaa Mon Sep 17 00:00:00 2001 From: Ryan Hall Date: Mon, 11 Nov 2019 17:13:06 -0500 Subject: [PATCH 5/5] remove e2e linting and test scripts --- explorer/package.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/explorer/package.json b/explorer/package.json index c1f763e7f24..7c9390524b7 100644 --- a/explorer/package.json +++ b/explorer/package.json @@ -20,11 +20,8 @@ "pretest": "NODE_ENV=test yarn automigrate", "test": "yarn jest --runInBand --detectOpenHandles", "test-ci": "yarn jest src/__tests__ --runInBand --detectOpenHandles", - "test-ci:e2e": "yarn build && yarn test-ci:e2e:no-build", - "test-ci:e2e:no-build": "yarn jest e2e/ --runInBand --detectOpenHandles", "test-ci:silent": "yarn test-ci --silent", - "test-ci:e2e:silent": "yarn test-ci:e2e --silent", - "lint": "eslint --ext .js,.ts,.tsx,.jsx src e2e", + "lint": "eslint --ext .js,.ts,.tsx,.jsx src", "lint:fix": "yarn lint --fix", "format": "prettier --write \"**/*\"", "migration:run": "cross-env ts-node ./src/bin/migrator.ts migrate",