Welcome to XCTestMetrics, a command-line tool that provides metrics about your project tests.
- Get metrics about your project tests, like the number of failures, when it happened, the percentage of flakiness.
- Identify flaky tests.
- Easy and fast setup.
- Xcode 11
$ brew tap serralvo/XCTestMetrics https://github.com/serralvo/XCTestMetrics.git
$ brew install serralvo/XCTestMetrics/xctestmetrics
pod 'XCTestMetrics'
The usage of XCTestMetrics is based on two steps: the first one is to register each test result, the second one is to display all results using a report.
- Run project tests.
- Get the path of your project inside
DerivedData
folder.- Will be something like this:
~/Library/Developer/Xcode/DerivedData/YourProject-gybqxixuerfernzjaklbxkwwstqj
- Will be something like this:
- Call
log
command using derived data path:
$ xctestmetrics log path-to-derived-data
- The log will be added to
xctestmetrics-output
folder. - Commit the log file.
$ git add xctestmetrics-output/.
$ git commit -m "Adds xctestmetrics log"
- You will need to input a webhook URL:
- Will be something like this:
https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX
- Check here how to create a webhook.
- Will be something like this:
- Run:
$ xctestmetrics report slack your-web-hook-url
- That's it! The message with metrics will be sent to Slack.
- Run:
$ xctestmetrics report html
- That's it! The report file (index.html) will be stored into
xctestmetrics-report
folder.
If you want remove xctestmetrics-output
after report generation:
$ git rm -r xctestmetrics-output/
$ git add .
$ git commit -m "Removes xctestmetrics-output folder"
XCTestMetrics is released under the MIT License.
Made with ❤️ by Fabrício Serralvo