I have some integration and ui test projects (*.csproj) in my repository.
I understand I need to publish the test assemblies to build artifacts in order to run them later in Release pipeline.
My question is:
How should I pickup the test assemlies?
- from a build output
- or should run
dotnet publish tests/MyE2ETests.csproj --output $(Build.ArtifactStagingDirectory)/tests
See last step of this build pipeline
- task: DotNetCoreCLI@2
displayName: 'dotnet build $(buildConfiguration)'
inputs:
command: 'build'
arguments: '--configuration $(buildConfiguration)'
- task: DotNetCoreCLI@2
displayName: 'dotnet publish web app'
inputs:
command: publish
publishWebProjects: True
arguments: '--configuration $(BuildConfiguration) --output $(Build.ArtifactStagingDirectory)/app'
zipAfterPublish: True
- task: PublishBuildArtifacts@1
displayName: 'Publish web app artifacts'
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)/app'
artifactName: 'App'
- task: PublishBuildArtifacts@1
displayName: 'Publish tests artifacts'
inputs:
pathtoPublish: ???
artifactName: 'Tests'

