{"id":19141256,"url":"https://github.com/nextest-rs/quick-junit","last_synced_at":"2025-05-06T23:32:34.147Z","repository":{"id":232081712,"uuid":"783421863","full_name":"nextest-rs/quick-junit","owner":"nextest-rs","description":"A serializer for JUnit reports, used by cargo-nextest","archived":false,"fork":false,"pushed_at":"2025-04-27T08:20:22.000Z","size":405,"stargazers_count":7,"open_issues_count":10,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-27T09:24:59.234Z","etag":null,"topics":["junit","nextest","rust","testing","xml","xunit"],"latest_commit_sha":null,"homepage":"https://docs.rs/quick-junit","language":"Rust","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/nextest-rs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"sunshowers"}},"created_at":"2024-04-07T20:49:27.000Z","updated_at":"2025-04-27T08:19:46.000Z","dependencies_parsed_at":"2024-04-21T04:27:45.403Z","dependency_job_id":"b199b3ba-b3c6-4ab8-8d45-c31bada90922","html_url":"https://github.com/nextest-rs/quick-junit","commit_stats":null,"previous_names":["nextest-rs/quick-junit"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextest-rs%2Fquick-junit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextest-rs%2Fquick-junit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextest-rs%2Fquick-junit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextest-rs%2Fquick-junit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nextest-rs","download_url":"https://codeload.github.com/nextest-rs/quick-junit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252787436,"owners_count":21804259,"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":["junit","nextest","rust","testing","xml","xunit"],"created_at":"2024-11-09T07:22:15.914Z","updated_at":"2025-05-06T23:32:34.091Z","avatar_url":"https://github.com/nextest-rs.png","language":"Rust","funding_links":["https://github.com/sponsors/sunshowers"],"categories":[],"sub_categories":[],"readme":"# quick-junit\n\n[![quick-junit on crates.io](https://img.shields.io/crates/v/quick-junit)](https://crates.io/crates/quick-junit)\n[![Documentation (latest release)](https://img.shields.io/badge/docs-latest-brightgreen.svg)](https://docs.rs/quick-junit/)\n[![Documentation (main)](https://img.shields.io/badge/docs-main-purple)](https://quick-junit.nexte.st/)\n[![Changelog](https://img.shields.io/badge/changelog-latest-blue)](CHANGELOG.md)\n[![License](https://img.shields.io/badge/license-Apache-green.svg)](LICENSE-APACHE)\n[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE-MIT)\n\n`quick-junit` is a JUnit/XUnit XML data model and serializer for Rust. This crate allows users\nto create a JUnit report as an XML file. JUnit XML files are widely supported by test tooling.\n\n This crate is built to serve the needs of [cargo-nextest](https://nexte.st).\n\n## Overview\n\nThe root element of a JUnit report is a `Report`. A `Report` consists of one or more\n`TestSuite` instances. A `TestSuite` instance consists of one or more `TestCase`s.\n\nThe status (success, failure, error, or skipped) of a `TestCase` is represented by\n`TestCaseStatus`.\n\n## Features\n\n- ✅ Serializing JUnit/XUnit to the [Jenkins format](https://llg.cubic.org/docs/junit/).\n- ✅ Including test reruns using `TestRerun`\n- ✅ Including flaky tests\n- ✅ Including standard output and error\n  - ✅ Filtering out [invalid XML\n    characters](https://en.wikipedia.org/wiki/Valid_characters_in_XML) (eg ANSI escape codes)\n    from the output\n- ✅ Automatically keeping track of success, failure and error counts\n- ✅ Arbitrary properties and extra attributes\n\nThis crate does not currently support deserializing JUnit XML. (PRs are welcome!)\n\n## Examples\n\n```rust\nuse quick_junit::*;\n\nlet mut report = Report::new(\"my-test-run\");\nlet mut test_suite = TestSuite::new(\"my-test-suite\");\nlet success_case = TestCase::new(\"success-case\", TestCaseStatus::success());\nlet failure_case = TestCase::new(\"failure-case\", TestCaseStatus::non_success(NonSuccessKind::Failure));\ntest_suite.add_test_cases([success_case, failure_case]);\nreport.add_test_suite(test_suite);\n\nconst EXPECTED_XML: \u0026str = r#\"\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003ctestsuites name=\"my-test-run\" tests=\"2\" failures=\"1\" errors=\"0\"\u003e\n    \u003ctestsuite name=\"my-test-suite\" tests=\"2\" disabled=\"0\" errors=\"0\" failures=\"1\"\u003e\n        \u003ctestcase name=\"success-case\"\u003e\n        \u003c/testcase\u003e\n        \u003ctestcase name=\"failure-case\"\u003e\n            \u003cfailure/\u003e\n        \u003c/testcase\u003e\n    \u003c/testsuite\u003e\n\u003c/testsuites\u003e\n\"#;\n\nassert_eq!(report.to_string().unwrap(), EXPECTED_XML);\n```\n\nFor a more comprehensive example, including reruns and flaky tests, see\n[`fixture_tests.rs`](https://github.com/nextest-rs/quick-junit/blob/main/tests/fixture_tests.rs).\n\n## Minimum supported Rust version (MSRV)\n\nThe minimum supported Rust version is **Rust 1.70.** At any time, Rust versions from at least\nthe last 6 months will be supported.\n\nWhile this crate is a pre-release (0.x.x) it may have its MSRV bumped in a patch release. Once a\ncrate has reached 1.x, any MSRV bump will be accompanied with a new minor version.\n\n## Alternatives\n\n- [**junit-report**](https://crates.io/crates/junit-report): Older, more mature project. Doesn't\n  appear to support flaky tests or arbitrary properties as of version 0.8.3.\n\n## Contributing\n\nSee the [CONTRIBUTING](CONTRIBUTING.md) file for how to help out.\n\n## License\n\nThis project is available under the terms of either the [Apache 2.0 license](LICENSE-APACHE) or\nthe [MIT license](LICENSE-MIT).\n\n\u003c!--\nREADME.md is generated from README.tpl by cargo readme. To regenerate, run from the repository root:\n\n./scripts/regenerate-readmes.sh\n--\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnextest-rs%2Fquick-junit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnextest-rs%2Fquick-junit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnextest-rs%2Fquick-junit/lists"}