Skip to content

Instantly share code, notes, and snippets.

@ugnb
Last active November 21, 2018 12:01
Show Gist options
  • Save ugnb/a6ca7df09abcdd64eaf6e91a98640e3b to your computer and use it in GitHub Desktop.
Save ugnb/a6ca7df09abcdd64eaf6e91a98640e3b to your computer and use it in GitHub Desktop.
DotNet Core tests reporting with JUnitTestLogger in Bitbucket Pipelines
image: microsoft/dotnet:2.1-sdk-alpine
pipelines:
default:
- step: &testsStep
name: Tests
caches:
- dotnetcore
script:
- export PROJECT_NAME=relative/path/to/tests/project
- export REPORTS_REL_PATH=./test-reports/build_${BITBUCKET_BUILD_NUMBER}
- export REPORTS_PATH=./${PROJECT_NAME}/test-reports/build_${BITBUCKET_BUILD_NUMBER}
- dotnet restore
- dotnet build --no-restore $PROJECT_NAME
- dotnet test --no-build $PROJECT_NAME --test-adapter-path:. --logger:"junit;LogFilePath=$REPORTS_REL_PATH/junit.xml"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment