{"id":16655046,"url":"https://github.com/mtreinish/subunit-rust","last_synced_at":"2025-09-07T19:31:41.199Z","repository":{"id":32429150,"uuid":"131727285","full_name":"mtreinish/subunit-rust","owner":"mtreinish","description":"A subunit v2 protocol implementation in Rust","archived":false,"fork":false,"pushed_at":"2025-05-28T13:03:19.000Z","size":139,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-30T15:52:05.631Z","etag":null,"topics":["rust","subunit","subunit-packet","subunit-rust","subunit-stream"],"latest_commit_sha":null,"homepage":"","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/mtreinish.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":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-01T15:08:17.000Z","updated_at":"2025-05-28T13:03:23.000Z","dependencies_parsed_at":"2024-07-30T02:49:18.611Z","dependency_job_id":"fb60e15e-32a1-4aa8-92ca-25052de87c77","html_url":"https://github.com/mtreinish/subunit-rust","commit_stats":{"total_commits":64,"total_committers":3,"mean_commits":"21.333333333333332","dds":0.28125,"last_synced_commit":"07c9e2cdec106bbb758b6fcd4f40240cc891cf42"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/mtreinish/subunit-rust","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtreinish%2Fsubunit-rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtreinish%2Fsubunit-rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtreinish%2Fsubunit-rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtreinish%2Fsubunit-rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mtreinish","download_url":"https://codeload.github.com/mtreinish/subunit-rust/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtreinish%2Fsubunit-rust/sbom","scorecard":{"id":666773,"data":{"date":"2025-08-11","repo":{"name":"github.com/mtreinish/subunit-rust","commit":"5916a228f312ec49bbee64d2085d062ad7848d62"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.3,"checks":[{"name":"Code-Review","score":7,"reason":"Found 10/13 approved changesets -- score normalized to 7","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/main.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":2,"reason":"3 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/mtreinish/subunit-rust/main.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/mtreinish/subunit-rust/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/mtreinish/subunit-rust/main.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-21T18:19:23.317Z","repository_id":32429150,"created_at":"2025-08-21T18:19:23.317Z","updated_at":"2025-08-21T18:19:23.317Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274087657,"owners_count":25220252,"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","status":"online","status_checked_at":"2025-09-07T02:00:09.463Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["rust","subunit","subunit-packet","subunit-rust","subunit-stream"],"created_at":"2024-10-12T09:51:48.270Z","updated_at":"2025-09-07T19:31:41.191Z","avatar_url":"https://github.com/mtreinish.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"Subunit Rust\n============\n[![subunit-rust CI][ci-image]][ci]\n[![subunit on crates.io][cratesio-image]][cratesio]\n\n[ci-image]: https://github.com/mtreinish/subunit-rust/actions/workflows/main.yml/badge.svg\n[ci]: https://github.com/mtreinish/subunit-rust/actions/workflows/main.yml\n[cratesio-image]: https://img.shields.io/crates/v/subunit.svg\n[cratesio]: https://crates.io/crates/subunit\n\nThis repo contains a implementation of the subunit v2 protocol in Rust. It\nprovides an interface for both writing and reading subunit streams natively in\nrust. The subunit v2 protocol is documented in the\n[testing-cabal/subunit](https://github.com/testing-cabal/subunit/blob/master/README.rst#version-2)\nrepository.\n\n## Reading subunit packets\n\nReading subunit packets first requires an object implementing the Read trait\ncontaining the subunit stream. The parse_subunit() function is used to first\nbuffer the entire stream in memory, and then parse the contents and return\na vector of Event structs. For example, parsing a subunit stream from a file:\n```rust\n    let mut f = File::open(\"results.subunit\")?;\n    let events = parse_subunit(f).unwrap();\n```\nIn this example, the `results.subunit` file will be opened and parsed with an\nEvent struct in the events vector for each subunit packet in the file.\n\n\n## Writing subunit packets\n\nWriting a subunit packet first requires creating an event structure to describe\nthe contents of the packet. For example:\n\n```rust\n    let mut event_start = Event {\n        status: Some(\"inprogress\".to_string()),\n        test_id: Some(\"A_test_id\".to_string()),\n        timestamp: Some(Utc.ymd(2014, 7, 8).and_hms(9, 10, 11)),\n        tags: Some(vec![\"tag_a\".to_string(), \"tag_b\".to_string()]),\n        file_content: None,\n        file_name: None,\n        mime_type: None,\n        route_code: None\n    };\n```\n\nA typical test event normally involves 2 packets though, one to mark the start\nand the other to mark the finish of a test:\n```rust\n    let mut event_end = Event {\n        status: Some(\"success\".to_string()),\n        test_id: Some(\"A_test_id\".to_string()),\n        timestamp: Some(Utc.ymd(2014, 7, 8).and_hms(9, 12, 0)),\n        tags: Some(vec![\"tag_a\".to_string(), \"tag_b\".to_string()]),\n        file_content: Some(\"stdout content\".to_string().into_bytes()),\n        file_name: Some(\"stdout:''\".to_string()),\n        mime_type: Some(\"text/plain;charset=utf8\".to_string()),\n        route_code: None\n    };\n```\nThen you'll want to write the packet out to something. Anything that implements\nthe std::io::Write trait can be used for the packets, including things like a\nFile and a TCPStream. In this case we'll use Vec\u003cu8\u003e to keep it in memory:\n```rust\n    let mut subunit_stream: Vec\u003cu8\u003e = Vec::new();\n\n    subunit_stream = event_start.write(subunit_stream)?;\n    subunit_stream = event_end.write(subunit_stream)?;\n```\nWith this the subunit_stream buffer will contain the contents of the subunit\nstream for that test event.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmtreinish%2Fsubunit-rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmtreinish%2Fsubunit-rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmtreinish%2Fsubunit-rust/lists"}