From 09fe1ed19a60066be5dc25d4f314ba350f5c0af6 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Sat, 5 Jan 2019 08:37:54 +0000 Subject: [PATCH 01/31] release event not available so use push event and filter --- .github/main.workflow | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/main.workflow b/.github/main.workflow index 98d4d0bad..33f84ec26 100644 --- a/.github/main.workflow +++ b/.github/main.workflow @@ -1,10 +1,17 @@ workflow "build, test and publish on release" { - on = "release" + on = "push" resolves = "publish" } +# filter for a new tag +action "check for new tag" { + uses = "actions/bin/filter@1.0.0" + args = "tag" +} + # install with yarn action "install" { + needs = "check for new tag" uses = "actions/npm@1.0.0" runs = "yarn" args = "install" From a1f517f9cace0cba7a91a8c86fa5e2a9ec4cde05 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Sat, 5 Jan 2019 08:40:03 +0000 Subject: [PATCH 02/31] use @master in place of @1.0.0 --- .github/main.workflow | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/main.workflow b/.github/main.workflow index 33f84ec26..34caa2464 100644 --- a/.github/main.workflow +++ b/.github/main.workflow @@ -5,7 +5,7 @@ workflow "build, test and publish on release" { # filter for a new tag action "check for new tag" { - uses = "actions/bin/filter@1.0.0" + uses = "actions/bin/filter@master" args = "tag" } From 18cf41eae43aa4a44de0ff1f11fb4123065bf57a Mon Sep 17 00:00:00 2001 From: John Reilly Date: Sat, 5 Jan 2019 08:48:14 +0000 Subject: [PATCH 03/31] check for a new tag last --- .github/main.workflow | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/main.workflow b/.github/main.workflow index 34caa2464..d232d9f95 100644 --- a/.github/main.workflow +++ b/.github/main.workflow @@ -3,15 +3,8 @@ workflow "build, test and publish on release" { resolves = "publish" } -# filter for a new tag -action "check for new tag" { - uses = "actions/bin/filter@master" - args = "tag" -} - # install with yarn action "install" { - needs = "check for new tag" uses = "actions/npm@1.0.0" runs = "yarn" args = "install" @@ -33,9 +26,16 @@ action "test" { args = "test" } +# filter for a new tag +action "check for new tag" { + needs = "test" + uses = "actions/bin/filter@master" + args = "tag" +} + # publish with npm action "publish" { - needs = "test" + needs = "check for new tag" uses = "actions/npm@1.0.0" args = "publish" secrets = ["NPM_AUTH_TOKEN"] From e8340e55e4b7d152d8292462d5de2b6a890a8626 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Sat, 5 Jan 2019 10:36:10 +0000 Subject: [PATCH 04/31] Try using docker://zenika/alpine-chrome:with-node Need chrome to run tests --- .github/main.workflow | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/main.workflow b/.github/main.workflow index d232d9f95..b840793dd 100644 --- a/.github/main.workflow +++ b/.github/main.workflow @@ -21,8 +21,7 @@ action "build" { # test with yarn action "test" { needs = "build" - uses = "actions/npm@1.0.0" - runs = "yarn" + uses = "docker://zenika/alpine-chrome:with-node" args = "test" } From e13ee80a93b2ede12b9769f7314f33f53fc59db7 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Sat, 5 Jan 2019 10:38:47 +0000 Subject: [PATCH 05/31] Can use yarn --- .github/main.workflow | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/main.workflow b/.github/main.workflow index b840793dd..4c1b69993 100644 --- a/.github/main.workflow +++ b/.github/main.workflow @@ -23,6 +23,7 @@ action "test" { needs = "build" uses = "docker://zenika/alpine-chrome:with-node" args = "test" + runs = "yarn" } # filter for a new tag From 1b9d6360ef818d7b40f7e390988b8b5f5580270f Mon Sep 17 00:00:00 2001 From: John Reilly Date: Sat, 5 Jan 2019 10:44:30 +0000 Subject: [PATCH 06/31] Just run execution tests --- .github/main.workflow | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/main.workflow b/.github/main.workflow index 4c1b69993..e42b30e97 100644 --- a/.github/main.workflow +++ b/.github/main.workflow @@ -22,8 +22,8 @@ action "build" { action "test" { needs = "build" uses = "docker://zenika/alpine-chrome:with-node" - args = "test" runs = "yarn" + args = "execution-tests" } # filter for a new tag From 915caaaa4f500a4d899aa1e11cfa2353842efe51 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Sat, 5 Jan 2019 10:56:34 +0000 Subject: [PATCH 07/31] Use node 10 docker image and run all tests --- .github/main.workflow | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/main.workflow b/.github/main.workflow index e42b30e97..7a5c24dac 100644 --- a/.github/main.workflow +++ b/.github/main.workflow @@ -21,9 +21,9 @@ action "build" { # test with yarn action "test" { needs = "build" - uses = "docker://zenika/alpine-chrome:with-node" + uses = "docker://node:10" runs = "yarn" - args = "execution-tests" + args = "test" } # filter for a new tag From 7841e07e650b3df3fb2ba9f62923082c80d67919 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Sat, 5 Jan 2019 12:15:12 +0000 Subject: [PATCH 08/31] Comment tests until they are dockerised --- .github/main.workflow | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/main.workflow b/.github/main.workflow index 7a5c24dac..b61e0d834 100644 --- a/.github/main.workflow +++ b/.github/main.workflow @@ -18,17 +18,17 @@ action "build" { args = "build" } -# test with yarn -action "test" { - needs = "build" - uses = "docker://node:10" - runs = "yarn" - args = "test" -} +# test with yarn - commented until they work in docker +#action "test" { +# needs = "build" +# uses = "docker://node:10" +# runs = "yarn" +# args = "test" +#} # filter for a new tag action "check for new tag" { - needs = "test" + needs = "build" uses = "actions/bin/filter@master" args = "tag" } From 3c1fcc089627c731f465970b2516818d6d9bc9e0 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Sat, 5 Jan 2019 17:09:13 +0000 Subject: [PATCH 09/31] Run execution tests again --- .github/main.workflow | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/main.workflow b/.github/main.workflow index b61e0d834..d81e87386 100644 --- a/.github/main.workflow +++ b/.github/main.workflow @@ -19,16 +19,16 @@ action "build" { } # test with yarn - commented until they work in docker -#action "test" { -# needs = "build" -# uses = "docker://node:10" -# runs = "yarn" -# args = "test" -#} +action "test" { + needs = "build" + uses = "docker://zenika/alpine-chrome:with-node" + runs = "yarn" + args = "execution-tests" +} # filter for a new tag action "check for new tag" { - needs = "build" + needs = "test" uses = "actions/bin/filter@master" args = "tag" } From 5507c28fffa2b9522076e4929e4118809343af3a Mon Sep 17 00:00:00 2001 From: John Reilly Date: Sat, 5 Jan 2019 17:11:06 +0000 Subject: [PATCH 10/31] Don't install pnpm globally --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2b6dd9747..bf9ec6a7c 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "lint": "tslint --project \"./src\"", "comparison-tests": "tsc --project \"./test/comparison-tests\" && npm link ./test/comparison-tests/testLib && node test/comparison-tests/run-tests.js", "comparison-tests-generate": "node test/comparison-tests/stub-new-version.js", - "execution-tests": "npm i -g pnpm && node test/execution-tests/run-tests.js", + "execution-tests": "node test/execution-tests/run-tests.js", "test": "node test/run-tests.js" }, "husky": { From 4816b95f88e3c9a502fa988b206538bc44116fa0 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Sat, 5 Jan 2019 17:13:24 +0000 Subject: [PATCH 11/31] Use npx to run pnpm --- test/execution-tests/run-tests.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/execution-tests/run-tests.js b/test/execution-tests/run-tests.js index afdcfcac9..30f959112 100644 --- a/test/execution-tests/run-tests.js +++ b/test/execution-tests/run-tests.js @@ -105,8 +105,8 @@ function runTests(testName) { var karmaConfPath = path.join(testPath, 'karma.conf.js'); if (pathExists(path.join(testPath, 'shrinkwrap.yaml'))) { - console.log('pnpm install into ' + testPath); - execSync('pnpm install', { cwd: testPath, stdio: 'inherit' }); + console.log('npx pnpm install into ' + testPath); + execSync('npx pnpm install', { cwd: testPath, stdio: 'inherit' }); } else if (pathExists(path.join(testPath, 'package.json'))) { console.log('yarn install into ' + testPath); execSync('yarn install', { cwd: testPath, stdio: 'inherit' }); From 8d0f21a773e2688ba91fa34851e2d1d9ec0ae89a Mon Sep 17 00:00:00 2001 From: John Reilly Date: Sat, 5 Jan 2019 17:28:54 +0000 Subject: [PATCH 12/31] Run Chrome no sandbox --- .../1.8.2_allowJs-entryFileIsJs/karma.conf.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/execution-tests/1.8.2_allowJs-entryFileIsJs/karma.conf.js b/test/execution-tests/1.8.2_allowJs-entryFileIsJs/karma.conf.js index 1171a0cb4..bc5f7cee6 100644 --- a/test/execution-tests/1.8.2_allowJs-entryFileIsJs/karma.conf.js +++ b/test/execution-tests/1.8.2_allowJs-entryFileIsJs/karma.conf.js @@ -7,8 +7,14 @@ var reporterOptions = require('../../reporterOptions'); module.exports = function(config) { config.set({ - browsers: [ 'ChromeHeadless' ], - + browsers: ['ChromeHeadlessNoSandbox'], + customLaunchers: { + ChromeHeadlessNoSandbox: { + base: 'ChromeHeadless', + flags: ['--no-sandbox'] + } + }, + files: [ // This loads all the tests './**/*.tests.js' From 58a2b6727bfed3a2ff69bcd03bcae011b7be3c95 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Sat, 5 Jan 2019 17:37:31 +0000 Subject: [PATCH 13/31] More --no-sandbox --- .../1.8.2_allowJs-entryFileIsJs/karma.conf.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/execution-tests/1.8.2_allowJs-entryFileIsJs/karma.conf.js b/test/execution-tests/1.8.2_allowJs-entryFileIsJs/karma.conf.js index bc5f7cee6..8527ef9a6 100644 --- a/test/execution-tests/1.8.2_allowJs-entryFileIsJs/karma.conf.js +++ b/test/execution-tests/1.8.2_allowJs-entryFileIsJs/karma.conf.js @@ -9,10 +9,14 @@ module.exports = function(config) { config.set({ browsers: ['ChromeHeadlessNoSandbox'], customLaunchers: { - ChromeHeadlessNoSandbox: { - base: 'ChromeHeadless', - flags: ['--no-sandbox'] - } + ChromeHeadlessNoSandbox: { + base: 'ChromeHeadless', + flags: [ + '--no-sandbox', // required to run without privileges in docker + '--user-data-dir=/tmp/chrome-test-profile', + '--disable-web-security' + ] + } }, files: [ From a085064bae2fbe9942a395bc19b36217c83751d2 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Sat, 5 Jan 2019 20:58:50 +0000 Subject: [PATCH 14/31] create own dockerfile with node / chrome headless --- .github/main.workflow | 2 +- .github/node-chrome/Dockerfile | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 .github/node-chrome/Dockerfile diff --git a/.github/main.workflow b/.github/main.workflow index d81e87386..72e1b516c 100644 --- a/.github/main.workflow +++ b/.github/main.workflow @@ -21,7 +21,7 @@ action "build" { # test with yarn - commented until they work in docker action "test" { needs = "build" - uses = "docker://zenika/alpine-chrome:with-node" + uses = "./.github/node-chrome" runs = "yarn" args = "execution-tests" } diff --git a/.github/node-chrome/Dockerfile b/.github/node-chrome/Dockerfile new file mode 100644 index 000000000..7792e69a1 --- /dev/null +++ b/.github/node-chrome/Dockerfile @@ -0,0 +1,21 @@ +# Taken from https://raw.githubusercontent.com/filipesilva/ng-github-actions/master/.github/node-chrome/Dockerfile + +# Taken from https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md#running-puppeteer-in-docker +# Using the "jessie" image because without it there's a "Error: spawn ps ENOENT" after karma/protractor exits. +FROM node:10-jessie-slim + +# See https://crbug.com/795759 +RUN apt-get update && apt-get install -yq libgconf-2-4 + +# Install latest chrome dev package and fonts to support major charsets (Chinese, Japanese, Arabic, Hebrew, Thai and a few others) +# Note: this installs the necessary libs to make the bundled version of Chromium that Puppeteer +# installs, work. +RUN apt-get update && apt-get install -y wget --no-install-recommends \ + && wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \ + && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \ + && apt-get update \ + && apt-get install -y google-chrome-unstable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst ttf-freefont \ + --no-install-recommends \ + && rm -rf /var/lib/apt/lists/* \ + && apt-get purge --auto-remove -y curl \ + && rm -rf /src/*.deb From be59bf8e8c69b992b92f8cb3fe90fe2cc7e6024a Mon Sep 17 00:00:00 2001 From: John Reilly Date: Sat, 5 Jan 2019 21:54:15 +0000 Subject: [PATCH 15/31] common karma.conf.js using ChromeHeadless --no-sandbox --- .../1.8.2_allowJs-entryFileIsJs/karma.conf.js | 59 +++-------------- .../karma.conf.js | 52 ++++----------- .../2.0.3_typesResolution/karma.conf.js | 52 ++++----------- .../karma.conf.js | 51 ++++---------- .../2.1.4_babel-es2016/karma.conf.js | 50 ++++---------- .../2.1.4_babel-react/karma.conf.js | 51 ++++---------- .../execution-tests/2.1.4_react/karma.conf.js | 51 ++++---------- .../karma.conf.js | 51 ++++---------- .../2.4.1_importCodeSplitting/karma.conf.js | 51 ++++---------- .../2.4.1_nodeResolutionAllowJs/karma.conf.js | 52 ++++----------- .../3.0.1_projectReferences/karma.conf.js | 50 ++++---------- .../3.0.1_resolveJsonModule/karma.conf.js | 52 ++++----------- .../3.0.1_resolveModuleName/karma.conf.js | 52 ++++----------- .../allowTsInNodeModules/karma.conf.js | 52 ++++----------- .../babel-codeSplitting/karma.conf.js | 52 ++++----------- .../babel-es2015/karma.conf.js | 52 ++++----------- .../babel-es6resolveParent/karma.conf.js | 52 ++++----------- .../basic-happypack/karma.conf.js | 66 +++++++------------ test/execution-tests/basic/karma.conf.js | 52 ++++----------- .../nodeResolution/karma.conf.js | 52 ++++----------- .../option-context/karma.conf.js | 51 ++++---------- .../simpleDependency/karma.conf.js | 52 ++++----------- test/karmaConfig.js | 51 ++++++++++++++ test/reporterOptions.js | 8 --- 24 files changed, 304 insertions(+), 910 deletions(-) create mode 100644 test/karmaConfig.js delete mode 100644 test/reporterOptions.js diff --git a/test/execution-tests/1.8.2_allowJs-entryFileIsJs/karma.conf.js b/test/execution-tests/1.8.2_allowJs-entryFileIsJs/karma.conf.js index 8527ef9a6..21e1a1ada 100644 --- a/test/execution-tests/1.8.2_allowJs-entryFileIsJs/karma.conf.js +++ b/test/execution-tests/1.8.2_allowJs-entryFileIsJs/karma.conf.js @@ -1,57 +1,14 @@ /* eslint-disable no-var, strict */ 'use strict'; -var path = require('path'); -var webpack = require('webpack'); var webpackConfig = require('./webpack.config.js'); -var reporterOptions = require('../../reporterOptions'); +var makeKarmaConfig = require('../../karmaConfig'); module.exports = function(config) { - config.set({ - browsers: ['ChromeHeadlessNoSandbox'], - customLaunchers: { - ChromeHeadlessNoSandbox: { - base: 'ChromeHeadless', - flags: [ - '--no-sandbox', // required to run without privileges in docker - '--user-data-dir=/tmp/chrome-test-profile', - '--disable-web-security' - ] - } - }, - - files: [ - // This loads all the tests - './**/*.tests.js' - ], - - port: 9876, - - frameworks: [ 'jasmine' ], - - logLevel: config.LOG_INFO, //config.LOG_DEBUG - - preprocessors: { - './**/*.js': [ 'webpack', 'sourcemap' ] - }, - - webpack: { - devtool: 'inline-source-map', - mode: webpackConfig.mode, - module: webpackConfig.module, - resolve: webpackConfig.resolve, - - // for test harness purposes only, you would not need this in a normal project - resolveLoader: webpackConfig.resolveLoader - }, - - webpackMiddleware: { - quiet: true, - stats: { - colors: true - } - }, - - // reporter options - mochaReporter: reporterOptions, - }); + config.set( + makeKarmaConfig({ + config, + webpackConfig, + files: ['./**/*.tests.js'] + }) + ); }; diff --git a/test/execution-tests/1.8.2_babel-allowSyntheticDefaultImports/karma.conf.js b/test/execution-tests/1.8.2_babel-allowSyntheticDefaultImports/karma.conf.js index 3b2022de7..a38a197f0 100644 --- a/test/execution-tests/1.8.2_babel-allowSyntheticDefaultImports/karma.conf.js +++ b/test/execution-tests/1.8.2_babel-allowSyntheticDefaultImports/karma.conf.js @@ -1,47 +1,17 @@ /* eslint-disable no-var, strict */ 'use strict'; -var path = require('path'); -var webpack = require('webpack'); var webpackConfig = require('./webpack.config.js'); -var reporterOptions = require('../../reporterOptions'); +var makeKarmaConfig = require('../../karmaConfig'); module.exports = function(config) { - config.set({ - browsers: [ 'ChromeHeadless' ], - - files: [ - // This ensures we have the es6 shims in place from babel and then loads all the tests - 'main.js' - ], - - port: 9876, - - frameworks: [ 'jasmine' ], - - logLevel: config.LOG_INFO, //config.LOG_DEBUG - - preprocessors: { - 'main.js': [ 'webpack', 'sourcemap' ] - }, - - webpack: { - devtool: 'inline-source-map', - mode: webpackConfig.mode, - module: webpackConfig.module, - resolve: webpackConfig.resolve, - - // for test harness purposes only, you would not need this in a normal project - resolveLoader: webpackConfig.resolveLoader - }, - - webpackMiddleware: { - quiet: true, - stats: { - colors: true - } - }, - - // reporter options - mochaReporter: reporterOptions, - }); + config.set( + makeKarmaConfig({ + config, + webpackConfig, + files: [ + // This ensures we have the es6 shims in place from babel and then loads all the tests + 'main.js' + ] + }) + ); }; diff --git a/test/execution-tests/2.0.3_typesResolution/karma.conf.js b/test/execution-tests/2.0.3_typesResolution/karma.conf.js index eb9f24b0e..a38a197f0 100644 --- a/test/execution-tests/2.0.3_typesResolution/karma.conf.js +++ b/test/execution-tests/2.0.3_typesResolution/karma.conf.js @@ -1,47 +1,17 @@ /* eslint-disable no-var, strict */ 'use strict'; -var path = require('path'); -var webpack = require('webpack'); var webpackConfig = require('./webpack.config.js'); -var reporterOptions = require('../../reporterOptions'); +var makeKarmaConfig = require('../../karmaConfig'); module.exports = function(config) { - config.set({ - browsers: [ 'ChromeHeadless' ], - - files: [ - // This loads all the tests - 'main.js' - ], - - port: 9876, - - frameworks: [ 'jasmine' ], - - logLevel: config.LOG_INFO, //config.LOG_DEBUG - - preprocessors: { - 'main.js': [ 'webpack', 'sourcemap' ] - }, - - webpack: { - devtool: 'inline-source-map', - mode: webpackConfig.mode, - module: webpackConfig.module, - resolve: webpackConfig.resolve, - - // for test harness purposes only, you would not need this in a normal project - resolveLoader: webpackConfig.resolveLoader - }, - - webpackMiddleware: { - quiet: true, - stats: { - colors: true - } - }, - - // reporter options - mochaReporter: reporterOptions - }); + config.set( + makeKarmaConfig({ + config, + webpackConfig, + files: [ + // This ensures we have the es6 shims in place from babel and then loads all the tests + 'main.js' + ] + }) + ); }; diff --git a/test/execution-tests/2.1.4_babel-allowJsImportTypes/karma.conf.js b/test/execution-tests/2.1.4_babel-allowJsImportTypes/karma.conf.js index 303de7b97..a38a197f0 100644 --- a/test/execution-tests/2.1.4_babel-allowJsImportTypes/karma.conf.js +++ b/test/execution-tests/2.1.4_babel-allowJsImportTypes/karma.conf.js @@ -1,46 +1,17 @@ /* eslint-disable no-var, strict */ 'use strict'; var webpackConfig = require('./webpack.config.js'); -var reporterOptions = require('../../reporterOptions'); +var makeKarmaConfig = require('../../karmaConfig'); module.exports = function(config) { - // Documentation: https://karma-runner.github.io/0.13/config/configuration-file.html - config.set({ - browsers: [ 'ChromeHeadless' ], - - files: [ - // This ensures we have the es6 shims in place and then loads all the tests - 'main.js' - ], - - port: 9876, - - frameworks: [ 'jasmine' ], - - logLevel: config.LOG_INFO, //config.LOG_DEBUG - - preprocessors: { - 'main.js': [ 'webpack', 'sourcemap' ] - }, - - webpack: { - devtool: 'inline-source-map', - mode: webpackConfig.mode, - module: webpackConfig.module, - resolve: webpackConfig.resolve, - - // for test harness purposes only, you would not need this in a normal project - resolveLoader: webpackConfig.resolveLoader - }, - - webpackMiddleware: { - quiet: true, - stats: { - colors: true - } - }, - - // reporter options - mochaReporter: reporterOptions - }); + config.set( + makeKarmaConfig({ + config, + webpackConfig, + files: [ + // This ensures we have the es6 shims in place from babel and then loads all the tests + 'main.js' + ] + }) + ); }; diff --git a/test/execution-tests/2.1.4_babel-es2016/karma.conf.js b/test/execution-tests/2.1.4_babel-es2016/karma.conf.js index f9f53b52e..a38a197f0 100644 --- a/test/execution-tests/2.1.4_babel-es2016/karma.conf.js +++ b/test/execution-tests/2.1.4_babel-es2016/karma.conf.js @@ -1,45 +1,17 @@ /* eslint-disable no-var, strict */ 'use strict'; var webpackConfig = require('./webpack.config.js'); -var reporterOptions = require('../../reporterOptions'); +var makeKarmaConfig = require('../../karmaConfig'); module.exports = function(config) { - config.set({ - browsers: [ 'ChromeHeadless' ], - - files: [ - // This ensures we have the es6 shims in place from babel and then loads all the tests - 'main.js' - ], - - port: 9876, - - frameworks: [ 'jasmine' ], - - logLevel: config.LOG_INFO, //config.LOG_DEBUG - - preprocessors: { - 'main.js': [ 'webpack', 'sourcemap' ] - }, - - webpack: { - devtool: 'inline-source-map', - mode: webpackConfig.mode, - module: webpackConfig.module, - resolve: webpackConfig.resolve, - - // for test harness purposes only, you would not need this in a normal project - resolveLoader: webpackConfig.resolveLoader - }, - - webpackMiddleware: { - quiet: true, - stats: { - colors: true - } - }, - - // reporter options - mochaReporter: reporterOptions, - }); + config.set( + makeKarmaConfig({ + config, + webpackConfig, + files: [ + // This ensures we have the es6 shims in place from babel and then loads all the tests + 'main.js' + ] + }) + ); }; diff --git a/test/execution-tests/2.1.4_babel-react/karma.conf.js b/test/execution-tests/2.1.4_babel-react/karma.conf.js index 303de7b97..a38a197f0 100644 --- a/test/execution-tests/2.1.4_babel-react/karma.conf.js +++ b/test/execution-tests/2.1.4_babel-react/karma.conf.js @@ -1,46 +1,17 @@ /* eslint-disable no-var, strict */ 'use strict'; var webpackConfig = require('./webpack.config.js'); -var reporterOptions = require('../../reporterOptions'); +var makeKarmaConfig = require('../../karmaConfig'); module.exports = function(config) { - // Documentation: https://karma-runner.github.io/0.13/config/configuration-file.html - config.set({ - browsers: [ 'ChromeHeadless' ], - - files: [ - // This ensures we have the es6 shims in place and then loads all the tests - 'main.js' - ], - - port: 9876, - - frameworks: [ 'jasmine' ], - - logLevel: config.LOG_INFO, //config.LOG_DEBUG - - preprocessors: { - 'main.js': [ 'webpack', 'sourcemap' ] - }, - - webpack: { - devtool: 'inline-source-map', - mode: webpackConfig.mode, - module: webpackConfig.module, - resolve: webpackConfig.resolve, - - // for test harness purposes only, you would not need this in a normal project - resolveLoader: webpackConfig.resolveLoader - }, - - webpackMiddleware: { - quiet: true, - stats: { - colors: true - } - }, - - // reporter options - mochaReporter: reporterOptions - }); + config.set( + makeKarmaConfig({ + config, + webpackConfig, + files: [ + // This ensures we have the es6 shims in place from babel and then loads all the tests + 'main.js' + ] + }) + ); }; diff --git a/test/execution-tests/2.1.4_react/karma.conf.js b/test/execution-tests/2.1.4_react/karma.conf.js index 303de7b97..a38a197f0 100644 --- a/test/execution-tests/2.1.4_react/karma.conf.js +++ b/test/execution-tests/2.1.4_react/karma.conf.js @@ -1,46 +1,17 @@ /* eslint-disable no-var, strict */ 'use strict'; var webpackConfig = require('./webpack.config.js'); -var reporterOptions = require('../../reporterOptions'); +var makeKarmaConfig = require('../../karmaConfig'); module.exports = function(config) { - // Documentation: https://karma-runner.github.io/0.13/config/configuration-file.html - config.set({ - browsers: [ 'ChromeHeadless' ], - - files: [ - // This ensures we have the es6 shims in place and then loads all the tests - 'main.js' - ], - - port: 9876, - - frameworks: [ 'jasmine' ], - - logLevel: config.LOG_INFO, //config.LOG_DEBUG - - preprocessors: { - 'main.js': [ 'webpack', 'sourcemap' ] - }, - - webpack: { - devtool: 'inline-source-map', - mode: webpackConfig.mode, - module: webpackConfig.module, - resolve: webpackConfig.resolve, - - // for test harness purposes only, you would not need this in a normal project - resolveLoader: webpackConfig.resolveLoader - }, - - webpackMiddleware: { - quiet: true, - stats: { - colors: true - } - }, - - // reporter options - mochaReporter: reporterOptions - }); + config.set( + makeKarmaConfig({ + config, + webpackConfig, + files: [ + // This ensures we have the es6 shims in place from babel and then loads all the tests + 'main.js' + ] + }) + ); }; diff --git a/test/execution-tests/2.4.1_babel-importCodeSplitting/karma.conf.js b/test/execution-tests/2.4.1_babel-importCodeSplitting/karma.conf.js index 303de7b97..a38a197f0 100644 --- a/test/execution-tests/2.4.1_babel-importCodeSplitting/karma.conf.js +++ b/test/execution-tests/2.4.1_babel-importCodeSplitting/karma.conf.js @@ -1,46 +1,17 @@ /* eslint-disable no-var, strict */ 'use strict'; var webpackConfig = require('./webpack.config.js'); -var reporterOptions = require('../../reporterOptions'); +var makeKarmaConfig = require('../../karmaConfig'); module.exports = function(config) { - // Documentation: https://karma-runner.github.io/0.13/config/configuration-file.html - config.set({ - browsers: [ 'ChromeHeadless' ], - - files: [ - // This ensures we have the es6 shims in place and then loads all the tests - 'main.js' - ], - - port: 9876, - - frameworks: [ 'jasmine' ], - - logLevel: config.LOG_INFO, //config.LOG_DEBUG - - preprocessors: { - 'main.js': [ 'webpack', 'sourcemap' ] - }, - - webpack: { - devtool: 'inline-source-map', - mode: webpackConfig.mode, - module: webpackConfig.module, - resolve: webpackConfig.resolve, - - // for test harness purposes only, you would not need this in a normal project - resolveLoader: webpackConfig.resolveLoader - }, - - webpackMiddleware: { - quiet: true, - stats: { - colors: true - } - }, - - // reporter options - mochaReporter: reporterOptions - }); + config.set( + makeKarmaConfig({ + config, + webpackConfig, + files: [ + // This ensures we have the es6 shims in place from babel and then loads all the tests + 'main.js' + ] + }) + ); }; diff --git a/test/execution-tests/2.4.1_importCodeSplitting/karma.conf.js b/test/execution-tests/2.4.1_importCodeSplitting/karma.conf.js index 303de7b97..a38a197f0 100644 --- a/test/execution-tests/2.4.1_importCodeSplitting/karma.conf.js +++ b/test/execution-tests/2.4.1_importCodeSplitting/karma.conf.js @@ -1,46 +1,17 @@ /* eslint-disable no-var, strict */ 'use strict'; var webpackConfig = require('./webpack.config.js'); -var reporterOptions = require('../../reporterOptions'); +var makeKarmaConfig = require('../../karmaConfig'); module.exports = function(config) { - // Documentation: https://karma-runner.github.io/0.13/config/configuration-file.html - config.set({ - browsers: [ 'ChromeHeadless' ], - - files: [ - // This ensures we have the es6 shims in place and then loads all the tests - 'main.js' - ], - - port: 9876, - - frameworks: [ 'jasmine' ], - - logLevel: config.LOG_INFO, //config.LOG_DEBUG - - preprocessors: { - 'main.js': [ 'webpack', 'sourcemap' ] - }, - - webpack: { - devtool: 'inline-source-map', - mode: webpackConfig.mode, - module: webpackConfig.module, - resolve: webpackConfig.resolve, - - // for test harness purposes only, you would not need this in a normal project - resolveLoader: webpackConfig.resolveLoader - }, - - webpackMiddleware: { - quiet: true, - stats: { - colors: true - } - }, - - // reporter options - mochaReporter: reporterOptions - }); + config.set( + makeKarmaConfig({ + config, + webpackConfig, + files: [ + // This ensures we have the es6 shims in place from babel and then loads all the tests + 'main.js' + ] + }) + ); }; diff --git a/test/execution-tests/2.4.1_nodeResolutionAllowJs/karma.conf.js b/test/execution-tests/2.4.1_nodeResolutionAllowJs/karma.conf.js index f0cb98bc7..a38a197f0 100644 --- a/test/execution-tests/2.4.1_nodeResolutionAllowJs/karma.conf.js +++ b/test/execution-tests/2.4.1_nodeResolutionAllowJs/karma.conf.js @@ -1,47 +1,17 @@ /* eslint-disable no-var, strict */ 'use strict'; -var path = require('path'); -var webpack = require('webpack'); var webpackConfig = require('./webpack.config.js'); -var reporterOptions = require('../../reporterOptions'); +var makeKarmaConfig = require('../../karmaConfig'); module.exports = function(config) { - config.set({ - browsers: [ 'ChromeHeadless' ], - - files: [ - // This loads all the tests - 'main.js' - ], - - port: 9876, - - frameworks: [ 'jasmine' ], - - logLevel: config.LOG_INFO, //config.LOG_DEBUG - - preprocessors: { - 'main.js': [ 'webpack', 'sourcemap' ] - }, - - webpack: { - devtool: 'inline-source-map', - mode: webpackConfig.mode, - module: webpackConfig.module, - resolve: webpackConfig.resolve, - - // for test harness purposes only, you would not need this in a normal project - resolveLoader: webpackConfig.resolveLoader - }, - - webpackMiddleware: { - quiet: true, - stats: { - colors: true - } - }, - - // reporter options - mochaReporter: reporterOptions - }); + config.set( + makeKarmaConfig({ + config, + webpackConfig, + files: [ + // This ensures we have the es6 shims in place from babel and then loads all the tests + 'main.js' + ] + }) + ); }; diff --git a/test/execution-tests/3.0.1_projectReferences/karma.conf.js b/test/execution-tests/3.0.1_projectReferences/karma.conf.js index 926196284..a38a197f0 100644 --- a/test/execution-tests/3.0.1_projectReferences/karma.conf.js +++ b/test/execution-tests/3.0.1_projectReferences/karma.conf.js @@ -1,45 +1,17 @@ /* eslint-disable no-var, strict */ 'use strict'; var webpackConfig = require('./webpack.config.js'); -var reporterOptions = require('../../reporterOptions'); +var makeKarmaConfig = require('../../karmaConfig'); module.exports = function(config) { - config.set({ - browsers: [ 'ChromeHeadless' ], - - files: [ - // This loads all the tests - 'main.js' - ], - - port: 9876, - - frameworks: [ 'jasmine' ], - - logLevel: config.LOG_INFO, //config.LOG_DEBUG - - preprocessors: { - 'main.js': [ 'webpack', 'sourcemap' ] - }, - - webpack: { - devtool: 'inline-source-map', - mode: webpackConfig.mode, - module: webpackConfig.module, - resolve: webpackConfig.resolve, - - // for test harness purposes only, you would not need this in a normal project - resolveLoader: webpackConfig.resolveLoader - }, - - webpackMiddleware: { - quiet: true, - stats: { - colors: true - } - }, - - // reporter options - mochaReporter: reporterOptions - }); + config.set( + makeKarmaConfig({ + config, + webpackConfig, + files: [ + // This ensures we have the es6 shims in place from babel and then loads all the tests + 'main.js' + ] + }) + ); }; diff --git a/test/execution-tests/3.0.1_resolveJsonModule/karma.conf.js b/test/execution-tests/3.0.1_resolveJsonModule/karma.conf.js index f0cb98bc7..a38a197f0 100644 --- a/test/execution-tests/3.0.1_resolveJsonModule/karma.conf.js +++ b/test/execution-tests/3.0.1_resolveJsonModule/karma.conf.js @@ -1,47 +1,17 @@ /* eslint-disable no-var, strict */ 'use strict'; -var path = require('path'); -var webpack = require('webpack'); var webpackConfig = require('./webpack.config.js'); -var reporterOptions = require('../../reporterOptions'); +var makeKarmaConfig = require('../../karmaConfig'); module.exports = function(config) { - config.set({ - browsers: [ 'ChromeHeadless' ], - - files: [ - // This loads all the tests - 'main.js' - ], - - port: 9876, - - frameworks: [ 'jasmine' ], - - logLevel: config.LOG_INFO, //config.LOG_DEBUG - - preprocessors: { - 'main.js': [ 'webpack', 'sourcemap' ] - }, - - webpack: { - devtool: 'inline-source-map', - mode: webpackConfig.mode, - module: webpackConfig.module, - resolve: webpackConfig.resolve, - - // for test harness purposes only, you would not need this in a normal project - resolveLoader: webpackConfig.resolveLoader - }, - - webpackMiddleware: { - quiet: true, - stats: { - colors: true - } - }, - - // reporter options - mochaReporter: reporterOptions - }); + config.set( + makeKarmaConfig({ + config, + webpackConfig, + files: [ + // This ensures we have the es6 shims in place from babel and then loads all the tests + 'main.js' + ] + }) + ); }; diff --git a/test/execution-tests/3.0.1_resolveModuleName/karma.conf.js b/test/execution-tests/3.0.1_resolveModuleName/karma.conf.js index f0cb98bc7..a38a197f0 100644 --- a/test/execution-tests/3.0.1_resolveModuleName/karma.conf.js +++ b/test/execution-tests/3.0.1_resolveModuleName/karma.conf.js @@ -1,47 +1,17 @@ /* eslint-disable no-var, strict */ 'use strict'; -var path = require('path'); -var webpack = require('webpack'); var webpackConfig = require('./webpack.config.js'); -var reporterOptions = require('../../reporterOptions'); +var makeKarmaConfig = require('../../karmaConfig'); module.exports = function(config) { - config.set({ - browsers: [ 'ChromeHeadless' ], - - files: [ - // This loads all the tests - 'main.js' - ], - - port: 9876, - - frameworks: [ 'jasmine' ], - - logLevel: config.LOG_INFO, //config.LOG_DEBUG - - preprocessors: { - 'main.js': [ 'webpack', 'sourcemap' ] - }, - - webpack: { - devtool: 'inline-source-map', - mode: webpackConfig.mode, - module: webpackConfig.module, - resolve: webpackConfig.resolve, - - // for test harness purposes only, you would not need this in a normal project - resolveLoader: webpackConfig.resolveLoader - }, - - webpackMiddleware: { - quiet: true, - stats: { - colors: true - } - }, - - // reporter options - mochaReporter: reporterOptions - }); + config.set( + makeKarmaConfig({ + config, + webpackConfig, + files: [ + // This ensures we have the es6 shims in place from babel and then loads all the tests + 'main.js' + ] + }) + ); }; diff --git a/test/execution-tests/allowTsInNodeModules/karma.conf.js b/test/execution-tests/allowTsInNodeModules/karma.conf.js index f0cb98bc7..a38a197f0 100644 --- a/test/execution-tests/allowTsInNodeModules/karma.conf.js +++ b/test/execution-tests/allowTsInNodeModules/karma.conf.js @@ -1,47 +1,17 @@ /* eslint-disable no-var, strict */ 'use strict'; -var path = require('path'); -var webpack = require('webpack'); var webpackConfig = require('./webpack.config.js'); -var reporterOptions = require('../../reporterOptions'); +var makeKarmaConfig = require('../../karmaConfig'); module.exports = function(config) { - config.set({ - browsers: [ 'ChromeHeadless' ], - - files: [ - // This loads all the tests - 'main.js' - ], - - port: 9876, - - frameworks: [ 'jasmine' ], - - logLevel: config.LOG_INFO, //config.LOG_DEBUG - - preprocessors: { - 'main.js': [ 'webpack', 'sourcemap' ] - }, - - webpack: { - devtool: 'inline-source-map', - mode: webpackConfig.mode, - module: webpackConfig.module, - resolve: webpackConfig.resolve, - - // for test harness purposes only, you would not need this in a normal project - resolveLoader: webpackConfig.resolveLoader - }, - - webpackMiddleware: { - quiet: true, - stats: { - colors: true - } - }, - - // reporter options - mochaReporter: reporterOptions - }); + config.set( + makeKarmaConfig({ + config, + webpackConfig, + files: [ + // This ensures we have the es6 shims in place from babel and then loads all the tests + 'main.js' + ] + }) + ); }; diff --git a/test/execution-tests/babel-codeSplitting/karma.conf.js b/test/execution-tests/babel-codeSplitting/karma.conf.js index f0cb98bc7..a38a197f0 100644 --- a/test/execution-tests/babel-codeSplitting/karma.conf.js +++ b/test/execution-tests/babel-codeSplitting/karma.conf.js @@ -1,47 +1,17 @@ /* eslint-disable no-var, strict */ 'use strict'; -var path = require('path'); -var webpack = require('webpack'); var webpackConfig = require('./webpack.config.js'); -var reporterOptions = require('../../reporterOptions'); +var makeKarmaConfig = require('../../karmaConfig'); module.exports = function(config) { - config.set({ - browsers: [ 'ChromeHeadless' ], - - files: [ - // This loads all the tests - 'main.js' - ], - - port: 9876, - - frameworks: [ 'jasmine' ], - - logLevel: config.LOG_INFO, //config.LOG_DEBUG - - preprocessors: { - 'main.js': [ 'webpack', 'sourcemap' ] - }, - - webpack: { - devtool: 'inline-source-map', - mode: webpackConfig.mode, - module: webpackConfig.module, - resolve: webpackConfig.resolve, - - // for test harness purposes only, you would not need this in a normal project - resolveLoader: webpackConfig.resolveLoader - }, - - webpackMiddleware: { - quiet: true, - stats: { - colors: true - } - }, - - // reporter options - mochaReporter: reporterOptions - }); + config.set( + makeKarmaConfig({ + config, + webpackConfig, + files: [ + // This ensures we have the es6 shims in place from babel and then loads all the tests + 'main.js' + ] + }) + ); }; diff --git a/test/execution-tests/babel-es2015/karma.conf.js b/test/execution-tests/babel-es2015/karma.conf.js index 914175018..a38a197f0 100644 --- a/test/execution-tests/babel-es2015/karma.conf.js +++ b/test/execution-tests/babel-es2015/karma.conf.js @@ -1,47 +1,17 @@ /* eslint-disable no-var, strict */ 'use strict'; -var path = require('path'); -var webpack = require('webpack'); var webpackConfig = require('./webpack.config.js'); -var reporterOptions = require('../../reporterOptions'); +var makeKarmaConfig = require('../../karmaConfig'); module.exports = function(config) { - config.set({ - browsers: [ 'ChromeHeadless' ], - - files: [ - // This ensures we have the es6 shims in place from babel and then loads all the tests - 'main.js' - ], - - port: 9876, - - frameworks: [ 'jasmine' ], - - logLevel: config.LOG_INFO, //config.LOG_DEBUG - - preprocessors: { - 'main.js': [ 'webpack', 'sourcemap' ] - }, - - webpack: { - devtool: 'inline-source-map', - mode: webpackConfig.mode, - module: webpackConfig.module, - resolve: webpackConfig.resolve, - - // for test harness purposes only, you would not need this in a normal project - resolveLoader: webpackConfig.resolveLoader - }, - - webpackMiddleware: { - quiet: true, - stats: { - colors: true - } - }, - - // reporter options - mochaReporter: reporterOptions - }); + config.set( + makeKarmaConfig({ + config, + webpackConfig, + files: [ + // This ensures we have the es6 shims in place from babel and then loads all the tests + 'main.js' + ] + }) + ); }; diff --git a/test/execution-tests/babel-es6resolveParent/karma.conf.js b/test/execution-tests/babel-es6resolveParent/karma.conf.js index 914175018..a38a197f0 100644 --- a/test/execution-tests/babel-es6resolveParent/karma.conf.js +++ b/test/execution-tests/babel-es6resolveParent/karma.conf.js @@ -1,47 +1,17 @@ /* eslint-disable no-var, strict */ 'use strict'; -var path = require('path'); -var webpack = require('webpack'); var webpackConfig = require('./webpack.config.js'); -var reporterOptions = require('../../reporterOptions'); +var makeKarmaConfig = require('../../karmaConfig'); module.exports = function(config) { - config.set({ - browsers: [ 'ChromeHeadless' ], - - files: [ - // This ensures we have the es6 shims in place from babel and then loads all the tests - 'main.js' - ], - - port: 9876, - - frameworks: [ 'jasmine' ], - - logLevel: config.LOG_INFO, //config.LOG_DEBUG - - preprocessors: { - 'main.js': [ 'webpack', 'sourcemap' ] - }, - - webpack: { - devtool: 'inline-source-map', - mode: webpackConfig.mode, - module: webpackConfig.module, - resolve: webpackConfig.resolve, - - // for test harness purposes only, you would not need this in a normal project - resolveLoader: webpackConfig.resolveLoader - }, - - webpackMiddleware: { - quiet: true, - stats: { - colors: true - } - }, - - // reporter options - mochaReporter: reporterOptions - }); + config.set( + makeKarmaConfig({ + config, + webpackConfig, + files: [ + // This ensures we have the es6 shims in place from babel and then loads all the tests + 'main.js' + ] + }) + ); }; diff --git a/test/execution-tests/basic-happypack/karma.conf.js b/test/execution-tests/basic-happypack/karma.conf.js index bc6b3fe0f..101d16921 100644 --- a/test/execution-tests/basic-happypack/karma.conf.js +++ b/test/execution-tests/basic-happypack/karma.conf.js @@ -1,48 +1,32 @@ /* eslint-disable no-var, strict */ 'use strict'; -var path = require('path'); -var webpack = require('webpack'); var webpackConfig = require('./webpack.config.js'); -var reporterOptions = require('../../reporterOptions'); +var makeKarmaConfig = require('../../karmaConfig'); module.exports = function(config) { - config.set({ - browsers: [ 'ChromeHeadless' ], - - files: [ - // This loads all the tests - 'main.js' - ], - - port: 9876, - - frameworks: [ 'jasmine' ], - - logLevel: config.LOG_INFO, //config.LOG_DEBUG - - preprocessors: { - 'main.js': [ 'webpack', 'sourcemap' ] - }, - - webpack: { - devtool: 'inline-source-map', - mode: webpackConfig.mode, - module: webpackConfig.module, - resolve: webpackConfig.resolve, - plugins: webpackConfig.plugins, - - // for test harness purposes only, you would not need this in a normal project - resolveLoader: webpackConfig.resolveLoader - }, - - webpackMiddleware: { - quiet: true, - stats: { - colors: true + config.set( + Object.assign( + {}, + makeKarmaConfig({ + config, + webpackConfig, + files: [ + // This ensures we have the es6 shims in place from babel and then loads all the tests + 'main.js' + ] + }), + { + webpack: { + devtool: 'inline-source-map', + mode: webpackConfig.mode, + module: webpackConfig.module, + resolve: webpackConfig.resolve, + plugins: webpackConfig.plugins, + + // for test harness purposes only, you would not need this in a normal project + resolveLoader: webpackConfig.resolveLoader + } } - }, - - // reporter options - mochaReporter: reporterOptions - }); + ) + ); }; diff --git a/test/execution-tests/basic/karma.conf.js b/test/execution-tests/basic/karma.conf.js index f0cb98bc7..a38a197f0 100644 --- a/test/execution-tests/basic/karma.conf.js +++ b/test/execution-tests/basic/karma.conf.js @@ -1,47 +1,17 @@ /* eslint-disable no-var, strict */ 'use strict'; -var path = require('path'); -var webpack = require('webpack'); var webpackConfig = require('./webpack.config.js'); -var reporterOptions = require('../../reporterOptions'); +var makeKarmaConfig = require('../../karmaConfig'); module.exports = function(config) { - config.set({ - browsers: [ 'ChromeHeadless' ], - - files: [ - // This loads all the tests - 'main.js' - ], - - port: 9876, - - frameworks: [ 'jasmine' ], - - logLevel: config.LOG_INFO, //config.LOG_DEBUG - - preprocessors: { - 'main.js': [ 'webpack', 'sourcemap' ] - }, - - webpack: { - devtool: 'inline-source-map', - mode: webpackConfig.mode, - module: webpackConfig.module, - resolve: webpackConfig.resolve, - - // for test harness purposes only, you would not need this in a normal project - resolveLoader: webpackConfig.resolveLoader - }, - - webpackMiddleware: { - quiet: true, - stats: { - colors: true - } - }, - - // reporter options - mochaReporter: reporterOptions - }); + config.set( + makeKarmaConfig({ + config, + webpackConfig, + files: [ + // This ensures we have the es6 shims in place from babel and then loads all the tests + 'main.js' + ] + }) + ); }; diff --git a/test/execution-tests/nodeResolution/karma.conf.js b/test/execution-tests/nodeResolution/karma.conf.js index f0cb98bc7..a38a197f0 100644 --- a/test/execution-tests/nodeResolution/karma.conf.js +++ b/test/execution-tests/nodeResolution/karma.conf.js @@ -1,47 +1,17 @@ /* eslint-disable no-var, strict */ 'use strict'; -var path = require('path'); -var webpack = require('webpack'); var webpackConfig = require('./webpack.config.js'); -var reporterOptions = require('../../reporterOptions'); +var makeKarmaConfig = require('../../karmaConfig'); module.exports = function(config) { - config.set({ - browsers: [ 'ChromeHeadless' ], - - files: [ - // This loads all the tests - 'main.js' - ], - - port: 9876, - - frameworks: [ 'jasmine' ], - - logLevel: config.LOG_INFO, //config.LOG_DEBUG - - preprocessors: { - 'main.js': [ 'webpack', 'sourcemap' ] - }, - - webpack: { - devtool: 'inline-source-map', - mode: webpackConfig.mode, - module: webpackConfig.module, - resolve: webpackConfig.resolve, - - // for test harness purposes only, you would not need this in a normal project - resolveLoader: webpackConfig.resolveLoader - }, - - webpackMiddleware: { - quiet: true, - stats: { - colors: true - } - }, - - // reporter options - mochaReporter: reporterOptions - }); + config.set( + makeKarmaConfig({ + config, + webpackConfig, + files: [ + // This ensures we have the es6 shims in place from babel and then loads all the tests + 'main.js' + ] + }) + ); }; diff --git a/test/execution-tests/option-context/karma.conf.js b/test/execution-tests/option-context/karma.conf.js index 303de7b97..a38a197f0 100644 --- a/test/execution-tests/option-context/karma.conf.js +++ b/test/execution-tests/option-context/karma.conf.js @@ -1,46 +1,17 @@ /* eslint-disable no-var, strict */ 'use strict'; var webpackConfig = require('./webpack.config.js'); -var reporterOptions = require('../../reporterOptions'); +var makeKarmaConfig = require('../../karmaConfig'); module.exports = function(config) { - // Documentation: https://karma-runner.github.io/0.13/config/configuration-file.html - config.set({ - browsers: [ 'ChromeHeadless' ], - - files: [ - // This ensures we have the es6 shims in place and then loads all the tests - 'main.js' - ], - - port: 9876, - - frameworks: [ 'jasmine' ], - - logLevel: config.LOG_INFO, //config.LOG_DEBUG - - preprocessors: { - 'main.js': [ 'webpack', 'sourcemap' ] - }, - - webpack: { - devtool: 'inline-source-map', - mode: webpackConfig.mode, - module: webpackConfig.module, - resolve: webpackConfig.resolve, - - // for test harness purposes only, you would not need this in a normal project - resolveLoader: webpackConfig.resolveLoader - }, - - webpackMiddleware: { - quiet: true, - stats: { - colors: true - } - }, - - // reporter options - mochaReporter: reporterOptions - }); + config.set( + makeKarmaConfig({ + config, + webpackConfig, + files: [ + // This ensures we have the es6 shims in place from babel and then loads all the tests + 'main.js' + ] + }) + ); }; diff --git a/test/execution-tests/simpleDependency/karma.conf.js b/test/execution-tests/simpleDependency/karma.conf.js index f0cb98bc7..a38a197f0 100644 --- a/test/execution-tests/simpleDependency/karma.conf.js +++ b/test/execution-tests/simpleDependency/karma.conf.js @@ -1,47 +1,17 @@ /* eslint-disable no-var, strict */ 'use strict'; -var path = require('path'); -var webpack = require('webpack'); var webpackConfig = require('./webpack.config.js'); -var reporterOptions = require('../../reporterOptions'); +var makeKarmaConfig = require('../../karmaConfig'); module.exports = function(config) { - config.set({ - browsers: [ 'ChromeHeadless' ], - - files: [ - // This loads all the tests - 'main.js' - ], - - port: 9876, - - frameworks: [ 'jasmine' ], - - logLevel: config.LOG_INFO, //config.LOG_DEBUG - - preprocessors: { - 'main.js': [ 'webpack', 'sourcemap' ] - }, - - webpack: { - devtool: 'inline-source-map', - mode: webpackConfig.mode, - module: webpackConfig.module, - resolve: webpackConfig.resolve, - - // for test harness purposes only, you would not need this in a normal project - resolveLoader: webpackConfig.resolveLoader - }, - - webpackMiddleware: { - quiet: true, - stats: { - colors: true - } - }, - - // reporter options - mochaReporter: reporterOptions - }); + config.set( + makeKarmaConfig({ + config, + webpackConfig, + files: [ + // This ensures we have the es6 shims in place from babel and then loads all the tests + 'main.js' + ] + }) + ); }; diff --git a/test/karmaConfig.js b/test/karmaConfig.js new file mode 100644 index 000000000..1daf5d53a --- /dev/null +++ b/test/karmaConfig.js @@ -0,0 +1,51 @@ +module.exports = function makeKarmaConfig({ config, webpackConfig, files }) { + return { + browsers: ['ChromeHeadlessNoSandbox'], + customLaunchers: { + ChromeHeadlessNoSandbox: { + base: 'ChromeHeadless', + flags: ['--no-sandbox'] + } + }, + + // This loads all the tests + files, + + port: 9876, + + frameworks: ['jasmine'], + + logLevel: config.LOG_INFO, //config.LOG_DEBUG + + preprocessors: { + './**/*.js': ['webpack', 'sourcemap'] + }, + + webpack: { + devtool: 'inline-source-map', + mode: webpackConfig.mode, + module: webpackConfig.module, + resolve: webpackConfig.resolve, + + // for test harness purposes only, you would not need this in a normal project + resolveLoader: webpackConfig.resolveLoader + }, + + webpackMiddleware: { + quiet: true, + stats: { + colors: true + } + }, + + // reporter options + mochaReporter: { + colors: { + success: 'green', + info: 'cyan', + warning: 'bgBlue', + error: 'bgRed' + } + } + }; +}; diff --git a/test/reporterOptions.js b/test/reporterOptions.js deleted file mode 100644 index 76d9f14b4..000000000 --- a/test/reporterOptions.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = { - colors: { - success: 'green', - info: 'cyan', - warning: 'bgBlue', - error: 'bgRed' - } -}; \ No newline at end of file From 8efb10c269b723b74c16a648a31654a19c1239a4 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Sat, 5 Jan 2019 22:06:06 +0000 Subject: [PATCH 16/31] no sandbox on command line --- test/execution-tests/run-tests.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/execution-tests/run-tests.js b/test/execution-tests/run-tests.js index 30f959112..bfaee142d 100644 --- a/test/execution-tests/run-tests.js +++ b/test/execution-tests/run-tests.js @@ -115,7 +115,7 @@ function runTests(testName) { try { if (pathExists(path.join(testPath, 'karma.conf.js'))) { var singleRunOrWatch = watch ? '' : ' --single-run'; - execSync('karma start --reporters mocha' + singleRunOrWatch + ' --browsers ChromeHeadless', { cwd: testPath, stdio: 'inherit' }); + execSync('karma start --reporters mocha' + singleRunOrWatch + ' --browsers ChromeHeadlessNoSandbox', { cwd: testPath, stdio: 'inherit' }); passingTests.push(testName); } else { From e3f73955c315a0d97ad2713e9bb893803d6f8acc Mon Sep 17 00:00:00 2001 From: John Reilly Date: Sat, 5 Jan 2019 22:15:31 +0000 Subject: [PATCH 17/31] use alpine-chrome:with-node docker image --- .github/main.workflow | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/main.workflow b/.github/main.workflow index 72e1b516c..06432ddb2 100644 --- a/.github/main.workflow +++ b/.github/main.workflow @@ -21,7 +21,8 @@ action "build" { # test with yarn - commented until they work in docker action "test" { needs = "build" - uses = "./.github/node-chrome" + uses = "docker://zenika/alpine-chrome:with-node" +# uses = "./.github/node-chrome" runs = "yarn" args = "execution-tests" } From 5cb183e5c1aee5831001fdc6dd055eb742da46ec Mon Sep 17 00:00:00 2001 From: John Reilly Date: Sat, 5 Jan 2019 22:19:12 +0000 Subject: [PATCH 18/31] back to the version that works --- .github/main.workflow | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/main.workflow b/.github/main.workflow index 06432ddb2..72e1b516c 100644 --- a/.github/main.workflow +++ b/.github/main.workflow @@ -21,8 +21,7 @@ action "build" { # test with yarn - commented until they work in docker action "test" { needs = "build" - uses = "docker://zenika/alpine-chrome:with-node" -# uses = "./.github/node-chrome" + uses = "./.github/node-chrome" runs = "yarn" args = "execution-tests" } From 17ad00278ba00b89a2abc3007c37947a34cda35c Mon Sep 17 00:00:00 2001 From: John Reilly Date: Sat, 5 Jan 2019 22:46:30 +0000 Subject: [PATCH 19/31] drop node 6 from travis --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 52929afdd..9838be98b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,6 @@ addons: chrome: stable language: node_js node_js: - - "6" - "8" - "10" sudo: required From e03d27bc90de53c3341e662176ff7ecb3e865dd4 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Sun, 6 Jan 2019 06:22:17 +0000 Subject: [PATCH 20/31] try using node:10-slim --- .github/node-chrome/Dockerfile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/node-chrome/Dockerfile b/.github/node-chrome/Dockerfile index 7792e69a1..bebb641d2 100644 --- a/.github/node-chrome/Dockerfile +++ b/.github/node-chrome/Dockerfile @@ -1,8 +1,6 @@ # Taken from https://raw.githubusercontent.com/filipesilva/ng-github-actions/master/.github/node-chrome/Dockerfile - -# Taken from https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md#running-puppeteer-in-docker -# Using the "jessie" image because without it there's a "Error: spawn ps ENOENT" after karma/protractor exits. -FROM node:10-jessie-slim +# and https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md#running-puppeteer-in-docker +FROM node:10-slim # See https://crbug.com/795759 RUN apt-get update && apt-get install -yq libgconf-2-4 From 1a55f40fd6edfe65347c6102deecb2cecf899631 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Sun, 6 Jan 2019 09:51:22 +0000 Subject: [PATCH 21/31] start building and running in docker --- .dockerignore | 6 +++++ Dockerfile | 37 +++++++++++++++++++++++++++++++ test/execution-tests/run-tests.js | 2 +- 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..a3eb6da9f --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +.git +.github +.vscode +.test +node_modules +examples diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..22d270ecb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,37 @@ +FROM node:10-slim + +# See https://crbug.com/795759 +RUN apt-get update && apt-get install -yq libgconf-2-4 + +# Install latest chrome dev package and fonts to support major charsets (Chinese, Japanese, Arabic, Hebrew, Thai and a few others) +# Note: this installs the necessary libs to make the bundled version of Chromium that Puppeteer +# installs, work. +RUN apt-get update && apt-get install -y wget --no-install-recommends \ + && wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \ + && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \ + && apt-get update \ + && apt-get install -y google-chrome-unstable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst ttf-freefont \ + --no-install-recommends \ + && rm -rf /var/lib/apt/lists/* \ + && apt-get purge --auto-remove -y curl \ + && rm -rf /src/*.deb + +# install packages +ADD package.json yarn.lock index.js / +RUN yarn + +# build +COPY src src +RUN yarn build + +# test +COPY test test +RUN yarn execution-tests + +# build and run execution tests with: +# docker build -t ts-loader . + + + +# docker build -t ts-loader . && docker run -rm ts-loader +# docker build -t ts-loader . && docker run -it ts-loader \ No newline at end of file diff --git a/test/execution-tests/run-tests.js b/test/execution-tests/run-tests.js index bfaee142d..0a10d4b4c 100644 --- a/test/execution-tests/run-tests.js +++ b/test/execution-tests/run-tests.js @@ -106,7 +106,7 @@ function runTests(testName) { if (pathExists(path.join(testPath, 'shrinkwrap.yaml'))) { console.log('npx pnpm install into ' + testPath); - execSync('npx pnpm install', { cwd: testPath, stdio: 'inherit' }); + execSync('npx pnpm install --force', { cwd: testPath, stdio: 'inherit' }); } else if (pathExists(path.join(testPath, 'package.json'))) { console.log('yarn install into ' + testPath); execSync('yarn install', { cwd: testPath, stdio: 'inherit' }); From a4fc243abdbea72494d74ca83dd78a7f75355ee3 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Sun, 6 Jan 2019 18:51:26 +0000 Subject: [PATCH 22/31] use full node image instead of slim for comparison tests --- .github/node-chrome/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/node-chrome/Dockerfile b/.github/node-chrome/Dockerfile index bebb641d2..654aa4479 100644 --- a/.github/node-chrome/Dockerfile +++ b/.github/node-chrome/Dockerfile @@ -1,6 +1,6 @@ # Taken from https://raw.githubusercontent.com/filipesilva/ng-github-actions/master/.github/node-chrome/Dockerfile # and https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md#running-puppeteer-in-docker -FROM node:10-slim +FROM node:10 # See https://crbug.com/795759 RUN apt-get update && apt-get install -yq libgconf-2-4 From 1dd8f9476d10c65e300af85f8c2cdb579eb47725 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Sun, 6 Jan 2019 19:34:31 +0000 Subject: [PATCH 23/31] set GITHUB_WORKSPACE = "/github/workspace/ts-loader" --- .github/main.workflow | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/main.workflow b/.github/main.workflow index 72e1b516c..ae85701e9 100644 --- a/.github/main.workflow +++ b/.github/main.workflow @@ -8,6 +8,9 @@ action "install" { uses = "actions/npm@1.0.0" runs = "yarn" args = "install" + env = { + GITHUB_WORKSPACE = "/github/workspace/ts-loader" + } } # build with yarn @@ -16,6 +19,9 @@ action "build" { uses = "actions/npm@1.0.0" runs = "yarn" args = "build" + env = { + GITHUB_WORKSPACE = "/github/workspace/ts-loader" + } } # test with yarn - commented until they work in docker @@ -24,6 +30,9 @@ action "test" { uses = "./.github/node-chrome" runs = "yarn" args = "execution-tests" + env = { + GITHUB_WORKSPACE = "/github/workspace/ts-loader" + } } # filter for a new tag @@ -31,6 +40,9 @@ action "check for new tag" { needs = "test" uses = "actions/bin/filter@master" args = "tag" + env = { + GITHUB_WORKSPACE = "/github/workspace/ts-loader" + } } # publish with npm @@ -39,4 +51,7 @@ action "publish" { uses = "actions/npm@1.0.0" args = "publish" secrets = ["NPM_AUTH_TOKEN"] + env = { + GITHUB_WORKSPACE = "/github/workspace/ts-loader" + } } From e2a2a8eee8545defac43c4be27a1c09b3b695dc5 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Sun, 6 Jan 2019 19:41:46 +0000 Subject: [PATCH 24/31] close to being able to run comparison tests in docker container --- .github/main.workflow | 14 +------------- Dockerfile | 21 +++++++++------------ 2 files changed, 10 insertions(+), 25 deletions(-) diff --git a/.github/main.workflow b/.github/main.workflow index ae85701e9..71faf3191 100644 --- a/.github/main.workflow +++ b/.github/main.workflow @@ -9,7 +9,7 @@ action "install" { runs = "yarn" args = "install" env = { - GITHUB_WORKSPACE = "/github/workspace/ts-loader" + GITHUB_WORKSPACE = "/github/workspace/ts-loader" } } @@ -19,9 +19,6 @@ action "build" { uses = "actions/npm@1.0.0" runs = "yarn" args = "build" - env = { - GITHUB_WORKSPACE = "/github/workspace/ts-loader" - } } # test with yarn - commented until they work in docker @@ -30,9 +27,6 @@ action "test" { uses = "./.github/node-chrome" runs = "yarn" args = "execution-tests" - env = { - GITHUB_WORKSPACE = "/github/workspace/ts-loader" - } } # filter for a new tag @@ -40,9 +34,6 @@ action "check for new tag" { needs = "test" uses = "actions/bin/filter@master" args = "tag" - env = { - GITHUB_WORKSPACE = "/github/workspace/ts-loader" - } } # publish with npm @@ -51,7 +42,4 @@ action "publish" { uses = "actions/npm@1.0.0" args = "publish" secrets = ["NPM_AUTH_TOKEN"] - env = { - GITHUB_WORKSPACE = "/github/workspace/ts-loader" - } } diff --git a/Dockerfile b/Dockerfile index 22d270ecb..2a03604e1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:10-slim +FROM node:10 # See https://crbug.com/795759 RUN apt-get update && apt-get install -yq libgconf-2-4 @@ -16,22 +16,19 @@ RUN apt-get update && apt-get install -y wget --no-install-recommends \ && apt-get purge --auto-remove -y curl \ && rm -rf /src/*.deb +WORKDIR /ts-loader + # install packages -ADD package.json yarn.lock index.js / +COPY package.json yarn.lock index.js /ts-loader/ RUN yarn # build -COPY src src +COPY src /ts-loader/src RUN yarn build # test -COPY test test -RUN yarn execution-tests - -# build and run execution tests with: -# docker build -t ts-loader . - - +COPY test /ts-loader/test -# docker build -t ts-loader . && docker run -rm ts-loader -# docker build -t ts-loader . && docker run -it ts-loader \ No newline at end of file +# build and run tests with: +# docker build -t ts-loader . +# docker run -it ts-loader yarn test From f3dbf6774a883dca6ea45789ced20b75211f0e1c Mon Sep 17 00:00:00 2001 From: John Reilly Date: Sun, 6 Jan 2019 19:45:37 +0000 Subject: [PATCH 25/31] left a stray --- .github/main.workflow | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/main.workflow b/.github/main.workflow index 71faf3191..72e1b516c 100644 --- a/.github/main.workflow +++ b/.github/main.workflow @@ -8,9 +8,6 @@ action "install" { uses = "actions/npm@1.0.0" runs = "yarn" args = "install" - env = { - GITHUB_WORKSPACE = "/github/workspace/ts-loader" - } } # build with yarn From 9d230a3c04c1cf828b0520f5fcf1ca1ff5242175 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Sun, 6 Jan 2019 20:57:00 +0000 Subject: [PATCH 26/31] tests pass in docker --- Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2a03604e1..f929cb1cd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,18 +16,18 @@ RUN apt-get update && apt-get install -y wget --no-install-recommends \ && apt-get purge --auto-remove -y curl \ && rm -rf /src/*.deb -WORKDIR /ts-loader +WORKDIR /TypeStrong/ts-loader # install packages -COPY package.json yarn.lock index.js /ts-loader/ +COPY package.json yarn.lock index.js /TypeStrong/ts-loader/ RUN yarn # build -COPY src /ts-loader/src +COPY src /TypeStrong/ts-loader/src RUN yarn build # test -COPY test /ts-loader/test +COPY test /TypeStrong/ts-loader/test # build and run tests with: # docker build -t ts-loader . From 5e1948712eaab45592df0873be7f2993a0ec4d7e Mon Sep 17 00:00:00 2001 From: John Reilly Date: Sun, 6 Jan 2019 21:18:08 +0000 Subject: [PATCH 27/31] can comparison tests pass in a GitHub Action? --- .github/main.workflow | 4 ++-- test/comparison-tests/create-and-execute-test.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/main.workflow b/.github/main.workflow index 72e1b516c..c50e826eb 100644 --- a/.github/main.workflow +++ b/.github/main.workflow @@ -18,12 +18,12 @@ action "build" { args = "build" } -# test with yarn - commented until they work in docker +# test with yarn action "test" { needs = "build" uses = "./.github/node-chrome" runs = "yarn" - args = "execution-tests" + args = "test" } # filter for a new tag diff --git a/test/comparison-tests/create-and-execute-test.js b/test/comparison-tests/create-and-execute-test.js index 8ad3114ba..03b4f3f78 100644 --- a/test/comparison-tests/create-and-execute-test.js +++ b/test/comparison-tests/create-and-execute-test.js @@ -416,7 +416,7 @@ function getNormalisedFileContent(file, location) { return 'at ' + remainingPathAndColon + 'irrelevant-line-number' + colon + 'irrelevant-column-number'; }) // strip C:/projects/ts-loader/.test/ - .replace(/(C\:\/)?[\w|\/]*\/ts-loader\/\.test/g, '') + .replace(/(C\:\/)?[\w|\/]*\/(ts-loader|workspace)\/\.test/g, '') .replace(/webpack:\/\/(C:\/)?[\w|\/|-]*\/comparison-tests\//g, 'webpack://comparison-tests/') .replace(/WEBPACK FOOTER\/n\/ (C:\/)?[\w|\/|-]*\/comparison-tests\//g, 'WEBPACK FOOTER/n/ /ts-loader/test/comparison-tests/') .replace(/!\** (C\:\/)?[\w|\/|-]*\/comparison-tests\//g, '!*** /ts-loader/test/comparison-tests/') @@ -440,9 +440,9 @@ function normaliseString(platformSpecificContent) { .replace(new RegExp(regexEscape('\\'), 'g'), '/') .replace(new RegExp(regexEscape('//'), 'g'), '/') // replace C:/source/ts-loader/index.js or /home/travis/build/TypeStrong/ts-loader/index.js with ts-loader - .replace(/ \S+[\/|\\]ts-loader[\/|\\]index.js/g, 'ts-loader') + .replace(/ \S+[\/|\\](ts-loader|workspace)[\/|\\]index.js/g, 'ts-loader') // replace (C:/source/ts-loader/dist/index.js with (ts-loader) - .replace(/\(\S+[\/|\\]ts-loader[\/|\\]dist[\/|\\]index.js:\d*:\d*\)/g, '(ts-loader)'); + .replace(/\(\S+[\/|\\](ts-loader|workspace)[\/|\\]dist[\/|\\]index.js:\d*:\d*\)/g, '(ts-loader)'); } /** From e9272754fef3b45e7eab0fa6ee4b544f6aedfb00 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Mon, 7 Jan 2019 06:34:53 +0000 Subject: [PATCH 28/31] comparison tests will not pass in github action --- .github/main.workflow | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/main.workflow b/.github/main.workflow index c50e826eb..76e2ccc23 100644 --- a/.github/main.workflow +++ b/.github/main.workflow @@ -23,7 +23,7 @@ action "test" { needs = "build" uses = "./.github/node-chrome" runs = "yarn" - args = "test" + args = "execution-tests" } # filter for a new tag From b38f734394e3169761c904578657adabcc3810bb Mon Sep 17 00:00:00 2001 From: John Reilly Date: Mon, 7 Jan 2019 06:43:40 +0000 Subject: [PATCH 29/31] add docker:build step to package.json --- package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index bf9ec6a7c..9c55e97e1 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,9 @@ "comparison-tests": "tsc --project \"./test/comparison-tests\" && npm link ./test/comparison-tests/testLib && node test/comparison-tests/run-tests.js", "comparison-tests-generate": "node test/comparison-tests/stub-new-version.js", "execution-tests": "node test/execution-tests/run-tests.js", - "test": "node test/run-tests.js" + "test": "node test/run-tests.js", + "docker:build": "docker build -t ts-loader .", + "postdocker:build": "docker run -it ts-loader yarn test" }, "husky": { "hooks": { From 6ed74cee428ea1fe2ca87427ad6c34fd49ce2e42 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Tue, 8 Jan 2019 13:03:06 +0000 Subject: [PATCH 30/31] Exclude npm publishing until https://github.com/actions/bin/issues/13 is fixed --- .github/main.workflow | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/main.workflow b/.github/main.workflow index 76e2ccc23..ca081d2d6 100644 --- a/.github/main.workflow +++ b/.github/main.workflow @@ -33,10 +33,10 @@ action "check for new tag" { args = "tag" } -# publish with npm -action "publish" { - needs = "check for new tag" - uses = "actions/npm@1.0.0" - args = "publish" - secrets = ["NPM_AUTH_TOKEN"] -} +# publish with npm - commented until this issue is resolved: https://github.com/actions/bin/issues/13 +#action "publish" { +# needs = "check for new tag" +# uses = "actions/npm@1.0.0" +# args = "publish" +# secrets = ["NPM_AUTH_TOKEN"] +#} From 9a1362fa5ba43f9bf3cf7f7fbe353cc5f8685871 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Tue, 8 Jan 2019 13:04:30 +0000 Subject: [PATCH 31/31] Update main.workflow --- .github/main.workflow | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/main.workflow b/.github/main.workflow index ca081d2d6..397120d8c 100644 --- a/.github/main.workflow +++ b/.github/main.workflow @@ -1,6 +1,7 @@ workflow "build, test and publish on release" { on = "push" - resolves = "publish" +# resolves = "publish" - commented until this issue is resolved: https://github.com/actions/bin/issues/13 + resolves = "check for new tag" } # install with yarn