Jenkins fixes for CI

This commit is contained in:
Juan Ferrer 2019-01-26 20:26:14 +01:00
parent 009a11fefe
commit 69bb8173c0
5 changed files with 35 additions and 3 deletions

6
Jenkinsfile vendored
View File

@ -58,12 +58,12 @@ pipeline {
stage('Test') {
environment {
NODE_ENV = ""
FIREFOX_BIN = "firefox/firefox-bin"
FIREFOX_BIN = "/opt/firefox/firefox-bin"
}
steps {
nodejs('node-lts') {
sh 'karma start'
sh 'gulp docker'
sh 'karma start --junit'
sh 'gulp docker --run-chown'
sh 'gulp backendUnitTest --junit'
sh 'docker rm -f salix-db'
}

View File

@ -300,6 +300,8 @@ async function docker() {
await execP(`docker build --build-arg STAMP=${stamp} -t salix-db ./services/db`);
let runChown = process.platform != 'linux';
if (argv.runChown) runChown = true;
await execP(`docker run --env RUN_CHOWN=${runChown} -d --name salix-db -p 3306:3306 salix-db`);
if (runChown) await dockerWait();
}

View File

@ -79,6 +79,7 @@ module.exports = function(config) {
'karma-webpack',
'karma-chrome-launcher',
'karma-firefox-launcher',
'karma-junit-reporter',
'karma-sourcemap-loader'
],
@ -113,5 +114,15 @@ module.exports = function(config) {
if (process.env.FIREFOX_BIN)
baseConfig.browsers = ['FirefoxHeadless'];
if (config.junit) {
Object.assign(baseConfig, {
singleRun: true,
reporters: ['dots', 'junit'],
junitReporter: {
outputFile: 'test-results.xml'
}
});
}
config.set(baseConfig);
};

18
package-lock.json generated
View File

@ -8150,6 +8150,24 @@
}
}
},
"karma-junit-reporter": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/karma-junit-reporter/-/karma-junit-reporter-1.2.0.tgz",
"integrity": "sha1-T5xAzt+xo5X4rvh2q/lhiZF8Y5Y=",
"dev": true,
"requires": {
"path-is-absolute": "^1.0.0",
"xmlbuilder": "8.2.2"
},
"dependencies": {
"xmlbuilder": {
"version": "8.2.2",
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-8.2.2.tgz",
"integrity": "sha1-aSSGc0ELS6QuGmE2VR0pIjNap3M=",
"dev": true
}
}
},
"karma-sourcemap-loader": {
"version": "0.3.7",
"resolved": "https://registry.npmjs.org/karma-sourcemap-loader/-/karma-sourcemap-loader-0.3.7.tgz",

View File

@ -59,6 +59,7 @@
"karma-chrome-launcher": "^2.2.0",
"karma-firefox-launcher": "^1.1.0",
"karma-jasmine": "^2.0.1",
"karma-junit-reporter": "^1.2.0",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^3.0.5",
"merge-stream": "^1.0.1",