Test Case Association Manager
Azure DevOps extension for managing the associations between Test Methods (code) and Test Cases (Azure DevOps). It uses the Azure DevOps Services REST API to achieve this. The Test Method loading happens through its assemblies. These assemblies will be detected by using minimatch patterns which are provided by the user.
- Associations: associates Test Methods (code) with Test Cases (Azure DevOps) by name.
- Validation only: if this option is selected the Association manager will only validate the associations without persisting the changes. It is advised to use this option in a pull request build definition.
- Fixing broken associations: outdated associations will be fixed.
- Run Association manager: associates Test Method 'Test29' with Test Case 'Test29'.
- User removes Test Method 'Test29' and creates Test Method 'Test30', renames Test Case 'Test29' to 'Test30'. (Test Case 'Test30' is now still associated to the missing Test Method 'Test29').
- Run Association manager: fixes the association by removing/overwriting the outdated association.
- Test Case 'Test30' is now associated with Test Method 'Test30'.
- Pipeline reporting & flow handling: outputs every status to the console in real-time. Any error (reading/loading/associating) will cause the pipeline job to fail.
- Verbose logging: once enabled, the manager will also output the successful matchings next to the warnings/errors/fixes.
- Missing Test cases (warning): detects missing Test Cases.
- Duplicate Test Methods (warning): detects duplicate Test Methods.
- Duplicate Test Cases (warning): detects duplicate Test Cases.
- Deprecated Test Methods (warning): detects deprecated Test Methods (outdated).
- Association overview: outputs an overview of the association process at the end.
- Personal Access Token
The Azure DevOps Services REST API requires user authentication. For security reasons the authentication happens through a Personal Access Token only. For the creation of this token, please see chapter 3.1 Personal Access Token.
3.1 Personal Access Token
To create a Personal Access Token please read chapter 'Create personal access tokens to authenticate access' of this guide. When you're creating the PAT it is important to select 'All accessible organizations' under Organization and set the correct Custom defined scopes:
- Work items: Read & write;
- Test Management: Read & write.
||The root directory to search in.
||The minimatch patterns to search for within the directory, separated by a semicolon.
||The Azure DevOps collection Uri used for accessing the project Test Cases.
||The Personal Access Token used for accessing the Azure DevOps project.
||The Project name containing the Test Plan.
||The name of the Test Plan containing the Test Cases.
System Test Plan
||Specifies the Test Type. You could leave this field empty. As far as we know it does nothing other than filling its field in a Test Case.
||Indicates if you only want to validate the associations without persisting the changes. This makes it possible to insert this task within your pull request definition.
||When Verbose logging is turned on it also outputs the successful matchings and the fixes next to the warnings/errors.
There are two ways to create a pipeline definition: the old fashioned way or through YAML. Within this chapter the usage of this task will be explained for both methods.
Caution! The position of the task is very important. It should always be placed after the Build Task, but before the Test Run Task.
When you're setting up the Run test task, it is important to select Test plan under Select tests using. This makes it possible to link the outcome of the Test Run to the Test plan.
- task: QNH-Consulting-BV.AssociateToolTask.AssociateToolTask.AssociateTestMethodsWithTestCases@1
displayName: 'Test Case Association Manager'
testPlanName: 'System Test Plan'
When you're setting up the Run Test task, it is important to set the testSelector-property to 'testPlan'. This makes it possible to link the outcome of the Test Run to the Test plan.
- task: VSTest@2
displayName: 'Run unit tests using test plan'
5. Contribute, Feedback, Issues
If you want to contribute, have some feedback, or report any issues, don't hesitate sending us an email.
We would like to thank Flaticon for their beautiful icons created by Freepik which are used in the creation of this extension logo (CC BY 3.0).