Skip to content

Commit

Permalink
Merge pull request #20 from aeleftheriadis/feature/fix-azure-pipeline
Browse files Browse the repository at this point in the history
Added pipeline changes
  • Loading branch information
brunobritodev committed Jan 9, 2020
2 parents 89e8181 + 12ecde6 commit 8953526
Show file tree
Hide file tree
Showing 8 changed files with 257 additions and 7 deletions.
38 changes: 38 additions & 0 deletions azure-pipelines.pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ jobs:
inputs:
command: 'test'
projects: './src'
publishTestResults: false
arguments: '--configuration $(BuildConfiguration) --logger "trx;LogFileName=TestResults.trx" --logger "xunit;LogFileName=TestResults.xml" --results-directory ./BuildReports/UnitTests /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:Exclude="[xunit.*]*'

- task: PublishTestResults@2
displayName: 'Publish .NET Core test results'
inputs:
testRunTitle: NETCore
testResultsFormat: 'XUnit'
testResultsFiles: '**/TestResults.xml'

# Angular APP's
- job: 'angular'
Expand All @@ -54,13 +63,42 @@ jobs:
command: install
workingDir: src/Frontend/Jp.UserManagement

- task: Npm@1
displayName: 'NPM - Test - UserManagement'
inputs:
command: custom
customCommand: 'run test -- --watch=false --code-coverage'
workingDir: src/Frontend/Jp.UserManagement

- task: Npm@1
displayName: 'NPM - E2E - UserManagement'
inputs:
command: custom
customCommand: 'run e2e'
workingDir: src/Frontend/Jp.UserManagement

- task: Npm@1
displayName: 'NPM - Build Prod - UserManagement'
inputs:
command: custom
customCommand: 'run build'
workingDir: src/Frontend/Jp.UserManagement

- task: PublishTestResults@2
displayName: 'Publish Angular test results'
inputs:
testRunTitle: Angular
testResultsFormat: JUnit
testResultsFiles: "**/TESTS*.xml"

- task: PublishTestResults@2
displayName: 'Publish Angular E2E test results'
inputs:
testRunTitle: Angular_E2E
testResultsFormat: JUnit
testResultsFiles: "**/junit*.xml"


- job: 'docker'
displayName: 'Docker files'
pool:
Expand Down
37 changes: 37 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@ jobs:
inputs:
command: 'test'
projects: './src'
publishTestResults: false
arguments: '--configuration $(BuildConfiguration) --logger "trx;LogFileName=TestResults.trx" --logger "xunit;LogFileName=TestResults.xml" --results-directory ./BuildReports/UnitTests /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:Exclude="[xunit.*]*'

- task: PublishTestResults@2
displayName: 'Publish .NET Core test results'
inputs:
testRunTitle: NETCore
testResultsFormat: 'XUnit'
testResultsFiles: '**/TestResults.xml'

- task: DotNetCoreCLI@2
displayName: 'Publish - SSO'
Expand Down Expand Up @@ -112,13 +121,41 @@ jobs:
command: install
workingDir: src/Frontend/Jp.UserManagement

- task: Npm@1
displayName: 'NPM - Test - UserManagement'
inputs:
command: custom
customCommand: 'run test -- --watch=false --code-coverage'
workingDir: src/Frontend/Jp.UserManagement

- task: Npm@1
displayName: 'NPM - E2E - UserManagement'
inputs:
command: custom
customCommand: 'run e2e'
workingDir: src/Frontend/Jp.UserManagement

- task: Npm@1
displayName: 'NPM - Build Prod - UserManagement'
inputs:
command: custom
customCommand: 'run build -- --configuration=production'
workingDir: src/Frontend/Jp.UserManagement

- task: PublishTestResults@2
displayName: 'Publish Angular test results'
inputs:
testRunTitle: Angular
testResultsFormat: JUnit
testResultsFiles: "**/TESTS*.xml"

- task: PublishTestResults@2
displayName: 'Publish Angular E2E test results'
inputs:
testRunTitle: Angular_E2E
testResultsFormat: JUnit
testResultsFiles: "**/junit*.xml"

- task: ArchiveFiles@2
displayName: 'ZIP - UserManagement'
inputs:
Expand Down
3 changes: 3 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 12 additions & 1 deletion src/Frontend/Jp.UserManagement/e2e/protractor.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@
// https://github.com/angular/protractor/blob/master/lib/config.ts

const { SpecReporter } = require('jasmine-spec-reporter');
const { JUnitXmlReporter } = require('jasmine-reporters');
process.env.CHROME_BIN = require("puppeteer").executablePath();

exports.config = {
allScriptsTimeout: 30000,
specs: [
'./*.e2e-spec.ts'
],
capabilities: {
'browserName': 'chrome'
'browserName': 'chrome',
chromeOptions: {
args: ["--headless", "--disable-gpu", "--window-size=1200,900"],
binary: process.env.CHROME_BIN
}
},
directConnect: true,
baseUrl: 'http://localhost:4200/',
Expand All @@ -24,5 +30,10 @@ exports.config = {
project: 'e2e/tsconfig.e2e.json'
});
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
var junitReporter = new JUnitXmlReporter({
savePath: require('path').join(__dirname, './junit'),
consolidateAll: true
});
jasmine.getEnv().addReporter(junitReporter);
}
};
15 changes: 11 additions & 4 deletions src/Frontend/Jp.UserManagement/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// https://karma-runner.github.io/1.0/config/configuration-file.html

module.exports = function (config) {
const puppeteer = require('puppeteer');
process.env.CHROME_BIN = puppeteer.executablePath();

config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
Expand All @@ -10,24 +13,28 @@ module.exports = function (config) {
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
require('@angular-devkit/build-angular/plugins/karma'),
require('karma-junit-reporter')
],
client:{
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, 'coverage'), reports: [ 'html', 'lcovonly', 'text-summary' ],
dir: require('path').join(__dirname, 'coverage'), reports: [ 'html', 'lcovonly', 'text-summary', 'cobertura' ],
fixWebpackSourcePaths: true
},
angularCli: {
environment: 'dev'
},
reporters: ['progress', 'kjhtml'],
reporters: ['progress', 'kjhtml', 'junit'],
junitReporter: {
outputDir: '../junit'
},
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
browsers: ['ChromeHeadless'],
singleRun: false,
restartOnFileChange: true
});
Expand Down

0 comments on commit 8953526

Please sign in to comment.