Skip to content

Commit

Permalink
Disable local selenium server when not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk committed Jan 28, 2020
1 parent ee9ccc8 commit 1589f6f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build_test_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ jobs:
runs-on: ubuntu-latest
needs: build
env:
SKIP_LOCAL_SELENIUM_SERVER: true
NEXT_TELEMETRY_DISABLED: 1
HEADLESS: true
steps:
Expand All @@ -80,6 +81,7 @@ jobs:
env:
NEXT_TELEMETRY_DISABLED: 1
BROWSERSTACK: true
SKIP_LOCAL_SELENIUM_SERVER: true
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
steps:
Expand Down
7 changes: 5 additions & 2 deletions test/jest-environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ const getPort = require('get-port')
const seleniumServer = require('selenium-standalone')
const NodeEnvironment = require('jest-environment-node')

const { BROWSER_NAME: browserName = 'chrome' } = process.env
const {
BROWSER_NAME: browserName = 'chrome',
SKIP_LOCAL_SELENIUM_SERVER,
} = process.env

const newTabPg = `
<!DOCTYPE html>
Expand Down Expand Up @@ -38,7 +41,7 @@ class CustomEnvironment extends NodeEnvironment {

let seleniumServerPort

if (browserName !== 'chrome') {
if (browserName !== 'chrome' && SKIP_LOCAL_SELENIUM_SERVER !== 'true') {
console.log('Installing selenium server')
await new Promise((resolve, reject) => {
seleniumServer.install(err => {
Expand Down

0 comments on commit 1589f6f

Please sign in to comment.