Developer Note: Test an Asterisk PR against a Testsuite PR

One of the historical issues we’ve had with Asterisk and the Asterisk Testsuite has been that if you’ve created an Asterisk pull request for some new feature and a corresponding Testsuite test, there was no way to test the Asterisk PR against the Testsuite PR before the Testsuite PR was merged.  While you should always test both PRs locally before you submit them,  you might not catch some issues.  For instance, the GitHub environment can introduce timing variability in test execution or maybe you have something installed in your own environment that the GitHub environment doesn’t have.   Of course, one solution is to go ahead and merge the Testsuite PR early but that has several issues.  One is that unrelated PRs will also be tested against the new Testsuite PR and probably fail.  Another is that you may find issues with the test itself that might require a brand new Testsuite PR to correct.  Thankfully, the solution is fairly easy…

One of the benefits of moving to the GitHub platform for our Continuous Integration was the rich set of APIs available for interacting with issues, pull requests, workflows, etc.  If you’ve submitted PR to Asterisk before, you’ll be familiar with the process for telling the automation to make sure your PR will cherry-pick to other branches successfully.  Basically, you add a PR comment with cherry-pick-to: entries that indicate the branches you want tested.  Behind the scenes there’s a quick automation that searches the PR comments for those lines and generates a list of branches.  We’re now doing something similar for indicating which Testsuite PR you want your Asterisk PR tested against.  You just add a comment with: testsuite-test-pr: <testsuite_pr_number>.   In fact, you an add that entry to the same comment you have your cherry-pick-to: entries in.

Full details are at Development/Policies-and-Procedures/Code-Contribution on the Asterisk Documentation website.  Scroll down to the “Test against a Testsuite PR” section.

 

About the Author

What can we help you find?