I can able to run the VS integration tests from the build on the build machine in TFS Azure Release pipelines.
C:\ci\vstest.console.exe C:\ci\netcoreapp3.1\API.Smartbox.dll /TestCaseFilter:"Category=Repo1" /inIsolation
Here I want to filter out any required tests that I want to execute on a certain environment with /TestCaseFilter option by passing the repository details parameter:
/TestCaseFilter:"Category=passParameter"
Here I am trying to pass the parameter to the Category automatically as a RepositoryName in the TFS Azure Release pipelines.
Eg. If a build is triggered from a Repo1 then this name should be pass to the Category field and only Repo1 related tests should gets run, like wise if the build is triggered from Repo2 then this name should gets pass to the field Category and its related tests will get trigger.
To pass the triggering repository details to test parameter, you can use the predefined variable:
$(BUILD.REPOSITORY.NAME).This variable will contain the repo name information. You can use the variable in your command.
For example:
For more detailed info, you can refer to this doc: Predefined variable