1
votes

We have a process set in our project to create a pull request (PR) while merging code from feature branch to dev or master branch. PR won't complete unless & until CI is successful & all the test cases in an application run successfully. Test case execution report is then used by SonarQube to publish code coverage. SonarQube is configured to publish report only for new lines of code.

Right now these test cases (unit test cases) take around 2-2.5 hrs to complete effectively delaying PR completion. Hence we are thinking of some workaround where we can run only impacted test cases as part of PR CI. Is this possible in Azure DevOps ?

1
Hi, is there any update for this issue? Please check if answer below resolves your issue. - Jane Ma-MSFT

1 Answers

1
votes

You are looking for Test Impact Analysis. Please read the docs, but basically:

TIA performs incremental validation by automatic test selection. It will automatically select only the subset of tests required to validate the code being committed. For a given code commit entering the CI/CD pipeline, TIA will select and run only the relevant tests required to validate that commit. Therefore, that test run will complete more quickly, if there is a failure you will get to know about it sooner, and because it is all scoped by relevance, analysis will be faster as well.

And you just need enable it in Visual Studio Test task:

enter image description here