Skip to content

Commit

Permalink
Merge pull request #8327 from DavidStaheli/users/davidstaheli/publish…
Browse files Browse the repository at this point in the history
…-test-results

Publish test results from Azure Pipelines builds
  • Loading branch information
sokra committed Nov 4, 2018
2 parents eb68316 + 1b23c1e commit 10ff7a5
Show file tree
Hide file tree
Showing 3 changed files with 251 additions and 44 deletions.
68 changes: 55 additions & 13 deletions azure-pipelines.yml
Expand Up @@ -4,9 +4,9 @@ jobs:
vmImage: ubuntu-16.04
steps:
- task: NodeTool@0
displayName: "Install Node.js"
inputs:
versionSpec: "^10.10.0"
displayName: "Install Node.js"
- script: |
curl -o- -L https://yarnpkg.com/install.sh | bash
displayName: "Install Yarn"
Expand All @@ -26,17 +26,32 @@ jobs:
- script: |
set -e
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
yarn test:basic --ci
yarn test:unit --ci
export JEST_JUNIT_OUTPUT=./basic-junit.xml
yarn test:basic --ci --reporters=jest-junit
export JEST_JUNIT_OUTPUT=./unit-junit.xml
yarn test:unit --ci --reporters=jest-junit
displayName: "Run basic tests"
- task: PublishTestResults@2
inputs:
testRunTitle: "basic"
testResultsFiles: "**/basic-junit.xml"
condition: succeededOrFailed()
displayName: "Publish basic test results"
- task: PublishTestResults@2
inputs:
testRunTitle: "unit"
testResultsFiles: "**/unit-junit.xml"
condition: succeededOrFailed()
displayName: "Publish unit test results"

- job: lint
pool:
vmImage: ubuntu-16.04
steps:
- task: NodeTool@0
displayName: "Install Node.js"
inputs:
versionSpec: "^10.10.0"
displayName: "Install Node.js"
- script: |
curl -o- -L https://yarnpkg.com/install.sh | bash
displayName: "Install Yarn"
Expand All @@ -58,7 +73,14 @@ jobs:
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
yarn lint
displayName: "Run linting"
- job: linux
- task: PublishTestResults@2
inputs:
testRunTitle: "lint"
testResultsFiles: "**/junit.xml"
condition: succeededOrFailed()
displayName: "Publish lint results"

- job: Linux
dependsOn:
- basic
- lint
Expand All @@ -75,9 +97,9 @@ jobs:
node_version: ^6.14.4
steps:
- task: NodeTool@0
displayName: "Install Node.js"
inputs:
versionSpec: $(node_version)
displayName: "Install Node.js $(node_version)"
- script: |
curl -o- -L https://yarnpkg.com/install.sh | bash
displayName: "Install Yarn"
Expand All @@ -98,9 +120,16 @@ jobs:
set -e
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
yarn cover:init
yarn cover:integration --ci --maxWorkers=2
yarn cover:integration --ci --maxWorkers=2 --reporters=jest-junit
displayName: "Run tests with coverage"
- job: macos
- task: PublishTestResults@2
inputs:
testRunTitle: "Linux with Node.js $(node_version)"
testResultsFiles: "**/junit.xml"
condition: succeededOrFailed()
displayName: "Publish test results"

- job: macOS
dependsOn:
- basic
- lint
Expand All @@ -117,9 +146,9 @@ jobs:
node_version: ^6.14.4
steps:
- task: NodeTool@0
displayName: "Install Node.js"
inputs:
versionSpec: $(node_version)
displayName: "Install Node.js $(node_version)"
- script: |
curl -o- -L https://yarnpkg.com/install.sh | bash
displayName: "Install Yarn"
Expand All @@ -140,9 +169,16 @@ jobs:
set -e
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
yarn cover:init
yarn cover:integration --ci
yarn cover:integration --ci --reporters=jest-junit
displayName: "Run tests with coverage"
- job: windows
- task: PublishTestResults@2
inputs:
testRunTitle: "macOS with Node.js $(node_version)"
testResultsFiles: "**/junit.xml"
condition: succeededOrFailed()
displayName: "Publish test results"

- job: Windows
dependsOn:
- basic
- lint
Expand All @@ -159,9 +195,9 @@ jobs:
node_version: ^6.14.4
steps:
- task: NodeTool@0
displayName: "Install Node.js"
inputs:
versionSpec: $(node_version)
displayName: "Install Node.js $(node_version)"
- script: |
npm install --global yarn
displayName: "Install Yarn"
Expand All @@ -178,5 +214,11 @@ jobs:
displayName: "Install dependencies"
- script: |
set -e
yarn cover:init && yarn cover:integration --ci --maxWorkers=2
yarn cover:init && yarn cover:integration --ci --maxWorkers=2 --reporters=jest-junit
displayName: "Run tests with coverage"
- task: PublishTestResults@2
inputs:
testRunTitle: "Windows with Node.js $(node_version)"
testResultsFiles: "**/junit.xml"
condition: succeededOrFailed()
displayName: "Publish test results"
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -56,6 +56,7 @@
"jade": "^1.11.0",
"jade-loader": "~0.8.0",
"jest": "24.0.0-alpha.1",
"jest-junit": "^5.2.0",
"json-loader": "^0.5.7",
"json-schema-to-typescript": "^6.0.1",
"less": "^2.5.1",
Expand Down Expand Up @@ -120,7 +121,7 @@
"pretest": "yarn lint",
"prelint": "yarn setup",
"lint": "yarn code-lint && yarn schema-lint && yarn type-lint && yarn special-lint",
"code-lint": "eslint --cache \"{setup,lib,bin,hot,buildin,benchmark,tooling,schemas}/**/*.js\" \"test/*.js\" \"test/{configCases,watchCases,statsCases,hotCases}/**/webpack.config.js\" \"examples/**/webpack.config.js\"",
"code-lint": "eslint --format junit --cache \"{setup,lib,bin,hot,buildin,benchmark,tooling,schemas}/**/*.js\" \"test/*.js\" \"test/{configCases,watchCases,statsCases,hotCases}/**/webpack.config.js\" \"examples/**/webpack.config.js\" > junit.xml",
"type-lint": "tsc --pretty",
"special-lint": "node tooling/inherit-types && node tooling/format-schemas && node tooling/compile-to-definitions",
"special-lint-fix": "node tooling/inherit-types --write --override && node tooling/format-schemas --write && node tooling/compile-to-definitions --write",
Expand Down

0 comments on commit 10ff7a5

Please sign in to comment.