From 17d37712735ed829b3cf95520a2ead8a1956a877 Mon Sep 17 00:00:00 2001 From: Jeff Stieler Date: Wed, 15 Apr 2020 11:17:48 -0600 Subject: [PATCH] Remove defunct E2E test runner script, add docker scripts to package file. --- package.json | 6 ++-- tests/bin/e2e-test-integration.js | 46 ------------------------------- 2 files changed, 4 insertions(+), 48 deletions(-) delete mode 100755 tests/bin/e2e-test-integration.js diff --git a/package.json b/package.json index e6224364ca2..0fe0ed2d973 100644 --- a/package.json +++ b/package.json @@ -13,8 +13,10 @@ "build": "grunt && npm run makepot", "build-watch": "grunt watch", "lint:js": "eslint assets/js --ext=js", - "test:e2e": "./tests/bin/e2e-test-integration.js", - "test:e2e-dev": "./tests/bin/e2e-test-integration.js --dev", + "docker:up": "npm explore @woocommerce/e2e-env -- npm run docker:up", + "docker:down": "npm explore @woocommerce/e2e-env -- npm run docker:down", + "test:e2e": "npm explore @woocommerce/e2e-env -- npm run test:e2e", + "test:e2e-dev": "npm explore @woocommerce/e2e-env -- npm run test:e2e-dev", "makepot": "composer run-script makepot", "packages:fix:textdomain": "node ./bin/package-update-textdomain.js", "git:update-hooks": "rm -r .git/hooks && mkdir -p .git/hooks && node ./node_modules/husky/husky.js install" diff --git a/tests/bin/e2e-test-integration.js b/tests/bin/e2e-test-integration.js deleted file mode 100755 index d30d5f1068b..00000000000 --- a/tests/bin/e2e-test-integration.js +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env node - -const { spawnSync } = require( 'child_process' ); -const program = require( 'commander' ); -const { useJestPuppeteerConfig } = require( 'puppeteer-utils' ); - -program - .usage( ' [options]' ) - .option( '--dev', 'Development mode' ) - .parse( process.argv ); - -const testEnvVars = { - NODE_ENV: 'test:e2e', - JEST_PUPPETEER_CONFIG: 'tests/e2e-tests/config/jest-puppeteer.config.js', - NODE_CONFIG_DIR: 'tests/e2e-tests/config', -}; - -if ( program.dev ) { - testEnvVars.PUPPETEER_HEADLESS = 'false'; - testEnvVars.PUPPETEER_SLOWMO = '50'; - - delete testEnvVars.JEST_PUPPETEER_CONFIG; - useJestPuppeteerConfig(); -} - -const envVars = Object.assign( {}, process.env, testEnvVars ); - -let jestProcess = spawnSync( - 'jest', - [ - '--maxWorkers=1', - '--config=tests/e2e-tests/config/jest.config.js', - '--rootDir=./', - '--verbose', - program.args, - ], - { - stdio: 'inherit', - env: envVars, - } -); - -console.log( 'Jest exit code: ' + jestProcess.status ); - -// Pass Jest exit code to npm -process.exit( jestProcess.status );