From 6bccd8f40750694a1a485fb221af3694ea2c0b8e Mon Sep 17 00:00:00 2001 From: isabello Date: Fri, 9 Jun 2017 11:00:13 +0200 Subject: [PATCH 1/5] Restore karma-jenkins-reporter in karma.conf.js --- karma.conf.js | 1 + 1 file changed, 1 insertion(+) diff --git a/karma.conf.js b/karma.conf.js index 1d68bebf6..dbbeaf088 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -112,6 +112,7 @@ module.exports = function (config) { 'karma-chrome-launcher', 'karma-ng-html2js-preprocessor', 'karma-mocha-reporter', + 'karma-jenkins-reporter', 'karma-coverage', 'karma-coveralls', 'karma-phantomjs-launcher', From 8abaa97ac35e6f26523efe7bf84b084271dadd07 Mon Sep 17 00:00:00 2001 From: isabello Date: Fri, 9 Jun 2017 12:45:03 +0200 Subject: [PATCH 2/5] Update karma preprocessor --- karma.conf.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/karma.conf.js b/karma.conf.js index dbbeaf088..2683b57bb 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -74,7 +74,7 @@ module.exports = function (config) { autoWatch: opts.live, ngHtml2JsPreprocessor: { - stripPrefix: 'app/components/', + stripPrefix: 'src/app/components/', moduleName: 'my.templates', }, From a9fd0ff3d93db4f219af38b41a09aec01de22d40 Mon Sep 17 00:00:00 2001 From: isabello Date: Fri, 9 Jun 2017 13:00:28 +0200 Subject: [PATCH 3/5] Crank up logging for karma --- karma.conf.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/karma.conf.js b/karma.conf.js index 2683b57bb..8159ab26e 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -15,7 +15,6 @@ preprocessors[testLibs] = ['webpack']; preprocessors[test] = ['webpack']; const opts = { - onTravis: process.env.ON_TRAVIS, onJenkins: process.env.ON_JENKINS, live: process.env.LIVE, }; @@ -44,7 +43,7 @@ module.exports = function (config) { // Rest results reporter to use // Possible values: 'dots', 'progress' // Available reporters: https://npmjs.org/browse/keyword/karma-reporter - reporters: ['coverage', 'mocha'].concat(opts.onTravis ? ['coveralls'] : []).concat(opts.onJenkins ? ['coveralls'] : []), + reporters: ['coverage', 'mocha'].concat(opts.onJenkins ? ['coveralls'] : []), preprocessors, @@ -68,7 +67,7 @@ module.exports = function (config) { // config.LOG_WARN // config.LOG_INFO // config.LOG_DEBUG - logLevel: config.LOG_INFO, + logLevel: config.LOG_DEBUG, // Enable / disable watching file and executing tests whenever any file changes autoWatch: opts.live, @@ -82,9 +81,6 @@ module.exports = function (config) { reporters: [{ type: 'text', dir: 'coverage/', - }, { - type: opts.onTravis ? 'lcov' : 'html', - dir: 'coverage/', }, { type: opts.onJenkins ? 'lcov' : 'html', dir: 'coverage/', From b5b5d03b2dbf1e7727dbcd3d5ff3e4f546aec24c Mon Sep 17 00:00:00 2001 From: isabello Date: Fri, 9 Jun 2017 14:49:24 +0200 Subject: [PATCH 4/5] Reduce logging --- Jenkinsfile | 8 +++++--- karma.conf.js | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3b480cf43..bd89bd644 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,7 +1,9 @@ -environment { - ON_JENKINS = 'TRUE' -} + node('lisk-nano-01'){ + environment { + ON_JENKINS = 'true' + CI_BRANCH = '$BRANCH_NAME' + } lock(resource: "lisk-nano-01", inversePrecedence: true) { stage ('Cleanup Orphaned Processes') { try { diff --git a/karma.conf.js b/karma.conf.js index 8159ab26e..60312b3bc 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -67,7 +67,7 @@ module.exports = function (config) { // config.LOG_WARN // config.LOG_INFO // config.LOG_DEBUG - logLevel: config.LOG_DEBUG, + logLevel: config.LOG_INFO, // Enable / disable watching file and executing tests whenever any file changes autoWatch: opts.live, From 4850629db9175ea1ac5b479d23b53fa03e051558 Mon Sep 17 00:00:00 2001 From: isabello Date: Fri, 9 Jun 2017 15:56:38 +0200 Subject: [PATCH 5/5] Remove env and CI related exports --- Jenkinsfile | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index bd89bd644..2b7afa324 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,9 +1,4 @@ - node('lisk-nano-01'){ - environment { - ON_JENKINS = 'true' - CI_BRANCH = '$BRANCH_NAME' - } lock(resource: "lisk-nano-01", inversePrecedence: true) { stage ('Cleanup Orphaned Processes') { try { @@ -72,6 +67,7 @@ node('lisk-nano-01'){ stage ('Run Tests') { try { sh ''' + export ON_JENKINS=true # Run test cd $WORKSPACE npm run test