Skip to content

Instantly share code, notes, and snippets.

@safestudent
Last active September 12, 2019 09:29
Show Gist options
  • Save safestudent/db1c89e6604f5c4a8556706bc8dd3b8b to your computer and use it in GitHub Desktop.
Save safestudent/db1c89e6604f5c4a8556706bc8dd3b8b to your computer and use it in GitHub Desktop.
FSTA YAML
resources:
# The 'repo' section defines the code repository (self means 'this one' i.e. SprintTracker)
- repo: self
# The 'queue' section defines the machine on which we'll run our code and what are the tools we'll need to run the tests
queue:
# We'll use a standard machine that Azure provides for free with Visual Studio 2017
name: Hosted Windows 2019 with VS2019
# This just checks that the following software is installed on our 'Hosted VS2017' machine, as we need it to run our tests.
demands:
- msbuild
- visualstudio
- vstest
# This is our pipeline (currently one step with a series of tasks)
steps:
# Install DotNet on our hosted machine as we need it to build our app and run the unit tests
- task: DotNetCoreInstaller@0
inputs:
version: '2.1.500'
# Resolve our SprintTracker.AcceptanceTest project dependencies with NuGet
- task: NuGetCommand@2
displayName: 'NuGet restore Acceptance Tests Project'
inputs:
command: restore
restoreSolution: SprintTracker.AcceptanceTests\packages.config
restoreDirectory: ..\packages
# Resolve our SprintTracker.Pages project dependencies with NuGet
- task: NuGetCommand@2
displayName: 'NuGet restore Pages Project'
inputs:
command: restore
restoreSolution: SprintTracker.Pages\packages.config
restoreDirectory: ..\packages
# Resolve our dotnet dependencies for the SprintTracker.Tests and the SprintTrakcer.Web projects.
- script: dotnet restore
# Build our solution
- task: VSBuild@1
displayName: 'Build solution **\*.sln'
# We run our unit tests here
- task: VSTest@2
displayName: 'Run Unit Tests'
# 'SprintTracker.Tests.dll' is the project file after it has been built.
inputs:
testAssemblyVer2: |
**\SprintTracker.Tests.dll
!**\*TestAdapter.dll
!**\obj\**
# This is the folder that contains 'SprintTracker.Tests.dll' (the built project)
searchFolder: '$(System.DefaultWorkingDirectory)\SprintTracker.Tests\bin\Debug\netcoreapp2.1'
# Not running UI tests
uiTests: false
# The title of our test run
testRunTitle: 'Unit Tests'
# We run our UI selenium tests here
- task: VSTest@2
displayName: 'Run Acceptance Tests'
inputs:
# 'SprintTracker.AcceptanceTests.dll' is the project file after it has been built.
testAssemblyVer2: |
**\SprintTracker.AcceptanceTests.dll
!**\*TestAdapter.dll
!**\obj\**
# Here we apply a filter to only run scenarios tagged 'highpriority'
testFiltercriteria: (TestCategory=highpriority)
# This is the folder that contains 'SprintTracker.AcceptanceTests.dll' (the built project)
searchFolder: '$(System.DefaultWorkingDirectory)\SprintTracker.AcceptanceTests\bin\Debug'
# We are running UI tests (i.e. we need ChromeDriver etc).
uiTests: true
# This is our test run title.
testRunTitle: 'Acceptance Tests'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment