I've got an api project that I'd like to run some integration tests on in the Azure release pipeline.
- Build project.
- Create release.
- Deploy release to slot.
- Run NUnit integration tests against slot. This entails http requests to the slot.
- If tests pass, swap production slot with the tested slot.
I'm stuck on step 4. It's easy to pass arguments to a test fixture in Visual Studio.
[TestFixture(arguments: "https://urltomyslot.azurewebsites.net")]
public class CachedClientApiTokenManagerTests
{
public CachedClientApiTokenManagerTests(string authority)
{
_authority = authority;
}
private readonly string _authority;
// Runs tests using the url
}
What I don't know how to do is passing arguments from Azure Devops based on environment. I'm using the NUnit3TestAdapter package and it runs fine, but the args is the sticking point. If we're doing this in our lab environment, the url passed is different from the staging or production urls.
How do we configure this in Azure DevOps with args?