{"id":2124,"url":"https://github.com/fastlane-community/trainer","last_synced_at":"2026-02-04T16:42:13.497Z","repository":{"id":40685893,"uuid":"63801817","full_name":"fastlane-community/trainer","owner":"fastlane-community","description":"Convert xcodebuild plist and xcresult files to JUnit reports","archived":false,"fork":false,"pushed_at":"2022-03-15T15:28:37.000Z","size":287,"stargazers_count":249,"open_issues_count":19,"forks_count":50,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-12-01T03:37:12.407Z","etag":null,"topics":["fastlane","fastlane-plugin","ios","junit-report","plist-files"],"latest_commit_sha":null,"homepage":"https://krausefx.com","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fastlane-community.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-20T17:42:54.000Z","updated_at":"2024-10-21T17:50:34.000Z","dependencies_parsed_at":"2022-08-25T07:50:24.466Z","dependency_job_id":null,"html_url":"https://github.com/fastlane-community/trainer","commit_stats":null,"previous_names":["krausefx/trainer","krausefx/xcode_log_parser"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastlane-community%2Ftrainer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastlane-community%2Ftrainer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastlane-community%2Ftrainer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastlane-community%2Ftrainer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fastlane-community","download_url":"https://codeload.github.com/fastlane-community/trainer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228503095,"owners_count":17930509,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fastlane","fastlane-plugin","ios","junit-report","plist-files"],"created_at":"2024-01-05T20:16:05.225Z","updated_at":"2026-02-04T16:42:08.443Z","avatar_url":"https://github.com/fastlane-community.png","language":"Ruby","funding_links":[],"categories":["Testing","Ruby"],"sub_categories":["Other Testing"],"readme":"# trainer\n\n[![Twitter: @KrauseFx](https://img.shields.io/badge/contact-@KrauseFx-blue.svg?style=flat)](https://twitter.com/KrauseFx)\n[![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://github.com/KrauseFx/trainer/blob/master/LICENSE)\n[![Gem](https://img.shields.io/gem/v/trainer.svg?style=flat)](http://rubygems.org/gems/trainer)\n\nThis is an alternative approach to generate JUnit files for your CI (e.g. Jenkins) without parsing the `xcodebuild` output, but using the Xcode `plist` or `xcresult` files instead.\n\nSome Xcode versions has a known issue around not properly closing `stdout` ([Radar](https://openradar.appspot.com/27447948)), so you [can't use xcpretty](https://github.com/supermarin/xcpretty/issues/227).\n\n`trainer` is a more robust and faster approach to generate JUnit reports for your CI system. \n\n\u003e By using `trainer`, the Twitter iOS code base now generates JUnit reports 10 times faster.\n\n| | [xcpretty](https://github.com/supermarin/xcpretty) |  trainer\n--------------------------|------------------------------|------------------------------\nPrettify the `xcodebuild` output | :white_check_mark: | :no_entry_sign:\nGenerate JUnit reports | :white_check_mark: | :white_check_mark:\nGenerate HTML reports | :white_check_mark: | :no_entry_sign:\nWorks when the `xcodebuild` output format changed | :no_entry_sign: | :white_check_mark:\nShow test execution duration | :white_check_mark: | :white_check_mark:\nSpeed | :car: | :rocket:\n\n[xcpretty](https://github.com/supermarin/xcpretty) is a great piece of software that is used across all [fastlane tools](https://fastlane.tools). `trainer` was built to have the minimum code to generate JUnit reports for your CI system.\n\nMore information about the why `trainer` is useful can be found on [my blog](https://krausefx.com/blog/trainer-the-simplest-way-to-generate-a-junit-report-of-your-ios-tests).\n\n## Use with [fastlane](https://fastlane.tools)\n\nUpdate to the latest [fastlane](https://fastlane.tools) and run\n\n```bash\nfastlane add_plugin trainer\n```\n\nNow add the following to your `Fastfile`\n\n```ruby\nlane :test do\n  scan(scheme: \"ThemojiUITests\", \n       output_types: \"\", \n       fail_build: false)\n\n  trainer(output_directory: \".\")\nend\n```\n\nThis will generate the JUnit file in the current directory. You can specify any path you want, just make sure to have it clean for every run so that your CI system knows which one to pick.\n\nIf you use circle, use the following to automatically publish the JUnit reports\n\n```ruby\ntrainer(output_directory: ENV[\"CIRCLE_TEST_REPORTS\"])\n```\n\nFor more information, check out the [fastlane plugin docs](fastlane-plugin-trainer#readme).\n\n## Without [fastlane](https://fastlane.tools)\n\n### Installation\n\nAdd this to your `Gemfile` \n```\ngem trainer\n```\nand run\n```\nbundle install\n```\n\nAlternatively you can install the gem system-wide using `sudo gem install trainer`.\n\n### Usage\n\nIf you use `fastlane`, check out the official [fastlane plugin](fastlane-plugin-trainer#readme) on how to use `trainer` in `fastlane`.\n\n#### Run tests\n\n```\ncd [project]\nfastlane scan --derived_data_path \"output_dir\"\n```\n\n#### Convert the plist or xcresult files to junit\n\n```\ntrainer\n```\n\nYou can also pass a custom directory containing the plist or xcresult files\n\n```\ntrainer --path ./something\n```\n\nFor more information run\n\n```\ntrainer --help\n````\n\n### Show the test results right in your pull request\n\nTo make it easier for you and your contributors to see the test failures, you can use [danger](http://danger.systems) with the [danger-junit](https://github.com/orta/danger-junit) plugin to automatically post the test failures on the GitHub PR. \n\n![](assets/danger-output.png)\n\n### Thanks\n\nAfter the [lobbying of @steipete](https://twitter.com/steipete/status/753662170848690176) and the comment\n\n\u003e How does Xcode Server parse the results?\n\nI started investigating alternative approaches on how to parse test results.\n\nFor more information about the plist files that are being used, check out [Michele's blog post](http://michele.io/test-logs-in-xcode).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffastlane-community%2Ftrainer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffastlane-community%2Ftrainer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffastlane-community%2Ftrainer/lists"}