From: Eduardo San Martin Morote Date: Thu, 5 Aug 2021 10:54:31 +0000 (+0200) Subject: ci: skip e2e bs tests X-Git-Tag: v4.0.11~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=24c84cd47220c6017fe4c54b4881fac1366fa1ca;p=thirdparty%2Fvuejs%2Frouter.git ci: skip e2e bs tests --- diff --git a/circle.yml b/circle.yml index 40256228..05c3c20e 100644 --- a/circle.yml +++ b/circle.yml @@ -55,6 +55,8 @@ jobs: - attach_workspace: at: ~/project - run: yarn test:e2e:bs + - store_artifacts: + path: e2e/screenshots - store_test_results: path: e2e/reports @@ -100,15 +102,18 @@ workflows: - test-e2e: requires: - install - - test-e2e-bs: + - build-lint: requires: - install + # - build-e2e: + # requires: + # - install + # - test-e2e-bs: + # requires: + # - build-e2e - test-unit: requires: - install - - build-lint: - requires: - - install - coverage: requires: - test-unit diff --git a/e2e/runner.js b/e2e/runner.js index 3bd8746c..9abea45b 100644 --- a/e2e/runner.js +++ b/e2e/runner.js @@ -26,6 +26,20 @@ const { resolve } = require('path') const Nightwatch = require('nightwatch') const args = process.argv.slice(2) +// allow running browserstack local +const isLocal = args.indexOf('--local') > -1 + +if (isLocal && (!process.env.BS_USER || !process.env.BS_KEY)) { + console.log( + 'Hey!\n', + 'You are missing credentials for Browserstack.\n', + 'If you are a contributor, this is normal, credentials are private. These tests must be run by a maintainer of vue-router', + 'If you are a maintainer, make sure to create your `.env` file with both `BS_USER` and `BS_KEY` variables!' + ) + // fail if testing locally + process.exit(process.env.CI ? 0 : 1) +} + // if we are running yarn dev locally, we can pass --dev to avoid launching another server instance const server = args.indexOf('--dev') > -1 @@ -34,9 +48,6 @@ const server = // ? require('./staticServer') require('./devServer') -// allow running browserstack local -const isLocal = args.indexOf('--local') > -1 - const DEFAULT_CONFIG = './nightwatch.json' const NW_CONFIG = isLocal ? resolve(__dirname, './nightwatch.browserstack.js') @@ -86,17 +97,6 @@ process.mainModule.filename = resolve( ) if (isLocal) { - if (isLocal && (!process.env.BS_USER || !process.env.BS_KEY)) { - console.log( - 'Hey!\n', - 'You are missing credentials for Browserstack.\n', - 'If you are a contributor, this is normal, credentials are private. These tests must be run by a maintainer of vue-router', - 'If you are a maintainer, make sure to create your `.env` file with both `BS_USER` and `BS_KEY` variables!' - ) - // fail if testing locally - process.exit(process.env.CI ? 0 : 1) - } - let bsLocal const browserstack = require('browserstack-local') Nightwatch.bs_local = bsLocal = new browserstack.Local() diff --git a/e2e/vite.config.js b/e2e/vite.config.js index d6e47bff..2755f979 100644 --- a/e2e/vite.config.js +++ b/e2e/vite.config.js @@ -1,8 +1,8 @@ -import fs from 'fs' -import { resolve, join } from 'path' -import { defineConfig } from 'vite' -import vue from '@vitejs/plugin-vue' -import history from 'connect-history-api-fallback' +const fs = require('fs') +const { resolve, join } = require('path') +const { defineConfig } = require('vite') +const vue = require('@vitejs/plugin-vue') +const history = require('connect-history-api-fallback') /** @type {string[]} */ let examples = []