https://github.com/Subito-it/Cachi
Parse and visualize .xcresult tests on a web interface
https://github.com/Subito-it/Cachi
Last synced: 11 months ago
JSON representation
Parse and visualize .xcresult tests on a web interface
- Host: GitHub
- URL: https://github.com/Subito-it/Cachi
- Owner: Subito-it
- License: other
- Created: 2019-11-11T13:11:15.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2025-04-16T16:22:01.000Z (about 1 year ago)
- Last Synced: 2025-04-17T00:21:34.384Z (about 1 year ago)
- Language: Swift
- Size: 2.1 MB
- Stars: 61
- Watchers: 11
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🌵 Cachi
Cachi is a swift tool to parse and visualize test results contained in Xcode's .xcresult files on a web interface. It additionally offers a set of APIs that can be queried to extract information in json format from previously parsed test results.
Automatic screen recording (Xcode 15) and screenshot based xcresults are supported.

# Installation
```
brew install Subito-it/made/cachi
```
Or you can build manually using swift build.
# Usage
Cachi can be launched by passing the port for the web interface and the location where it should search for the .xcresult bundles.
You can optionally pass:
- `--search_depth` to specify how deep Cachi should traverse the location path. Default is 2, larger values may impact parsing speed.
- `--merge` to merge multiple xcresults in the same folder as if they belong to the same test run. This can be used in advanced scenarios like for example test sharding on on multiple machines.
```bash
$ cachi --port number [--search_depth level] [--merge] path
```
## Endpoint documentation
http://local.host:port/v1/help will return a list of available endpoint with a short overview.
# Test result customization
The following keys can be added to the Info.plist in the .xcresult bundle which will be used when showing results:
- `branchName`
- `commitHash`
- `commitMessage`
- `githubBaseUrl`: used to generate links to specific code lines within GitHub repositories. This allows to easily navigate to specific code segments associated to test failures. Example: https://github.com/Subito-it/Cachi
- `sourceBasePath`: used to cleanup file paths removing compilation base paths from source code locations. Example: /Users/someuser/path/to/repository will convert locations such as /Users/someuser/path/to/repository/modules/Somefile.swift into /modules/Somefile.swift.
- `xcresultPathToFailedTestName`: This parameter helps to clean up **System Failures** that occur when UI tests fail early in the execution process which results in test name not being included in the .xcresult bundle. Provide a dictionary where the key represents the `.xcresult` file paths, relative to the `sourceBasePath` and the value corresponds to the failed test name in the format `testSuiteName/testName`. Note: this can be used only when having a single `.xcresult` file generated per test.
# Contributions
Contributions are welcome! If you have a bug to report, feel free to help out by opening a new issue or sending a pull request.
## Authors
[Tomas Camin](https://github.com/tcamin) ([@tomascamin](https://twitter.com/tomascamin))
## License
Cachi is available under the Apache License, Version 2.0. See the LICENSE file for more info.