{"id":18384884,"url":"https://github.com/allegro/swift-junit","last_synced_at":"2025-06-29T15:03:46.107Z","repository":{"id":36209693,"uuid":"180737556","full_name":"allegro/swift-junit","owner":"allegro","description":"A Swift library for creating JUnit XML test results that can be interpreted by tools such as Bamboo or Jenkins. Macos and Linux ready.","archived":false,"fork":false,"pushed_at":"2024-10-16T12:47:33.000Z","size":289,"stargazers_count":29,"open_issues_count":3,"forks_count":13,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-12T04:07:37.140Z","etag":null,"topics":["hacktoberfest","junit","junit-report","junit-xml","server-side-swift","swift","xctest","xctest-linux","xml"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/allegro.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,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-11T07:23:40.000Z","updated_at":"2025-03-06T08:46:08.000Z","dependencies_parsed_at":"2024-10-18T02:46:12.854Z","dependency_job_id":null,"html_url":"https://github.com/allegro/swift-junit","commit_stats":{"total_commits":17,"total_committers":8,"mean_commits":2.125,"dds":0.7647058823529411,"last_synced_commit":"f093c446dd280ec726e8102effd9662bb0f5465b"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/allegro/swift-junit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allegro%2Fswift-junit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allegro%2Fswift-junit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allegro%2Fswift-junit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allegro%2Fswift-junit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/allegro","download_url":"https://codeload.github.com/allegro/swift-junit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allegro%2Fswift-junit/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262614457,"owners_count":23337277,"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":["hacktoberfest","junit","junit-report","junit-xml","server-side-swift","swift","xctest","xctest-linux","xml"],"created_at":"2024-11-06T01:15:47.868Z","updated_at":"2025-06-29T15:03:46.076Z","avatar_url":"https://github.com/allegro.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Swift Test Reporter\n\n[![CI](https://github.com/allegro/swift-junit/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/allegro/swift-junit/actions/workflows/ci.yml)\n\n\nA Swift library for creating JUnit XML test results that can be interpreted by tools such as Bamboo or Jenkins.\n\nSample output:\n\n```\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003ctestsuites\u003e\n  \u003ctestsuite tests=\"2\" failures=\"0\" disabled=\"0\" errors=\"0\" time=\"0.0013051033020019531\" name=\"JUnitReporterTests\"\u003e\n    \u003ctestcase classname=\"SwiftTestReporterTests.JUnitReporterTests\" name=\"testReporterShouldReturnXMLForEmptySuite\" time=\"0.0007890462875366211\"\u003e\u003c/testcase\u003e\n    \u003ctestcase classname=\"SwiftTestReporterTests.JUnitReporterTests\" name=\"testReporterShouldReturnXMLForFailedTest\" time=\"0.000516057014465332\"\u003e\u003c/testcase\u003e\n  \u003c/testsuite\u003e\n  \u003ctestsuite tests=\"1\" failures=\"1\" disabled=\"0\" errors=\"0\" time=\"0.00021898746490478516\" name=\"UtilsTests\"\u003e\n    \u003ctestcase classname=\"SwiftTestReporterTests.UtilsTests\" name=\"testShouldReturnProperlyClassName\" time=\"0.00021898746490478516\"\u003e\n      \u003cfailure message=\"Oh no!!\"\u003e\u003c/failure\u003e\n    \u003c/testcase\u003e\n  \u003c/testsuite\u003e\n\u003c/testsuites\u003e\n```\n\n# How to use it?\n## Linux\nAdd ``SwiftTestReporter`` to ``Package.swift``:\n\n```\nimport PackageDescription\n\nlet package = Package(\n  dependencies: [\n    ...\n    .package(url: \"https://github.com/allegro/swift-junit.git\", from: \"2.0.0\"),\n    // or for Swift 4.x\n    // .package(url: \"https://github.com/allegro/swift-junit.git\", from: .upToNextMajor(from: \"1.0.0\")),\n                \n  ]\n  ...\n  targets: [\n    ...\n    .testTarget(\n      name: \"AppTests\",\n      dependencies: [\n        \"App\",\n        \"SwiftTestReporter\"\n      ]\n    ),\n  ]\n)\n```\n\nNext, add:\n```\nimport SwiftTestReporter\n\n_ = TestObserver()\n```\nTo ``LinuxMain.swift``. Done.\n\n## XCode\nIn ``Project Navigator``, select particular project:\n\n![test](doc/intro-mac-1.png)\n\nNext, select test target:\n\n![test](doc/intro-mac-2.png)\n\nAdd a new property named ``Principal class`` and set it to ``SwiftTestReporter.TestObserver``\n\n![test](doc/intro-mac-3.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallegro%2Fswift-junit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fallegro%2Fswift-junit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallegro%2Fswift-junit/lists"}