Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can we set performance test case baseline programmatically in xcode?

I have written some performance test cases using XCTest framework in my project. I was wondering is it possible to set baseline value for performance testing programmatically before the first run or is there any other way to set the baseline except from the performance result window.

like image 818
CastleErised14 Avatar asked Nov 26 '22 20:11

CastleErised14


1 Answers

I've unfortunately not found a way to set the baseline programmatically. But there are some other options for setting it.

After you have set the baseline once through Xcode you can then access the info.plist where the baseline is stored and update it that way.

To get to the stored baseline data right click on your .xcodeproj file and select "Show package contents" then go into the "xcshareddata" folder and the "xcbaselines" folder will have the data. I've verified that after updating the relevant info.plist the change is reflected in future test runs.

Alternatively, to avoid initially setting the baseline in Xcode you might try (as the article linked below suggests) to generate the baseline info.plist with a script, but I have not given that a try myself.

More info in this great article https://developer.squareup.com/blog/measureblock-how-does-performance-testing-work-in-ios/ in the "Where is the baseline stored?" and "Can I generate plists with a script?" sections.

Hope this info helps someone else out.

like image 165
CodenameDuchess Avatar answered Dec 10 '22 06:12

CodenameDuchess