From 0fa97c2ce9ffbd12cd75f49530c8225b24269225 Mon Sep 17 00:00:00 2001 From: Steve Faulkner Date: Wed, 12 Aug 2020 15:25:53 -0500 Subject: [PATCH] Increase Cypress Timeout and Disable LiveReload in test (#145) Co-authored-by: Tanuj Mittal --- .github/workflows/ci.yml | 10 ++++++++++ cypress/cypress.json | 2 +- cypress/package.json | 2 +- webpack.config.js | 8 +++++++- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fecf5c976..4f1dd4e8b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -134,6 +134,11 @@ jobs: NODE_TLS_REJECT_UNAUTHORIZED: 0 CYPRESS_CACHE_FOLDER: ~/.cache/Cypress CYPRESS_CONNECTION_STRING: ${{ secrets.CONNECTION_STRING_SQL }} + - uses: actions/upload-artifact@v2 + name: videos + if: ${{ failure() }} + with: + path: "**/*.mp4" endtoendmongo: name: "End To End Tests | Mongo" needs: [lint, format, compile, unittest] @@ -163,6 +168,11 @@ jobs: NODE_TLS_REJECT_UNAUTHORIZED: 0 CYPRESS_CACHE_FOLDER: ~/.cache/Cypress CYPRESS_CONNECTION_STRING: ${{ secrets.CONNECTION_STRING_MONGO }} + - uses: actions/upload-artifact@v2 + if: ${{ failure() }} + name: videos + with: + path: "**/*.mp4" accessibility: name: "Accessibility | Hosted" needs: [lint, format, compile, unittest] diff --git a/cypress/cypress.json b/cypress/cypress.json index 4c9e0a6cb..81ece3f2b 100644 --- a/cypress/cypress.json +++ b/cypress/cypress.json @@ -3,7 +3,7 @@ "pluginsFile": false, "fixturesFolder": false, "supportFile": "./support/index.js", - "defaultCommandTimeout": 60000, + "defaultCommandTimeout": 90000, "chromeWebSecurity": false, "reporter": "mochawesome", "reporterOptions": { diff --git a/cypress/package.json b/cypress/package.json index 05d99bede..8b01790ba 100644 --- a/cypress/package.json +++ b/cypress/package.json @@ -6,7 +6,7 @@ "scripts": { "test": "cypress run", "wait-for-server": "wait-on -t 240000 -i 5000 -v https-get://0.0.0.0:1234/", - "test:sql": "cypress run --browser chrome --headless --spec \"./integration/dataexplorer/SQL/*\"", + "test:sql": "cypress run --browser chrome --spec \"./integration/dataexplorer/SQL/*\"", "test:ci": "wait-on -t 240000 -i 5000 -v https-get://0.0.0.0:1234/ https-get://0.0.0.0:8081/_explorer/index.html && cypress run --browser chrome --headless", "test:debug": "cypress open" }, diff --git a/webpack.config.js b/webpack.config.js index 2548c5865..e8a57219c 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -10,6 +10,7 @@ const CreateFileWebpack = require("create-file-webpack"); const childProcess = require("child_process"); const BundleAnalyzerPlugin = require("webpack-bundle-analyzer").BundleAnalyzerPlugin; const TerserPlugin = require("terser-webpack-plugin"); +const isCI = require("is-ci"); const gitSha = childProcess.execSync("git rev-parse HEAD").toString("utf8"); @@ -214,8 +215,13 @@ module.exports = function(env = {}, argv = {}) { }) ] }, + watch: isCI || mode === "production" ? false : true, + // Hack since it is hard to disable watch entirely with webpack dev server https://github.com/webpack/webpack-dev-server/issues/1251#issuecomment-654240734 + watchOptions: isCI ? { poll: 24 * 60 * 60 * 1000 } : {}, devServer: { - hot: false, + hot: !isCI, + inline: !isCI, + liveReload: !isCI, https: true, host: "0.0.0.0", port: envVars.PORT,