{"id":18684988,"url":"https://github.com/h1alexbel/tagrs","last_synced_at":"2025-04-12T04:32:43.282Z","repository":{"id":258955243,"uuid":"864110289","full_name":"h1alexbel/tagrs","owner":"h1alexbel","description":"Rust test tagging","archived":false,"fork":false,"pushed_at":"2025-03-15T17:20:49.000Z","size":29,"stargazers_count":5,"open_issues_count":5,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-26T00:11:16.236Z","etag":null,"topics":["rust","test-run","testing"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/h1alexbel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2024-09-27T14:07:39.000Z","updated_at":"2024-11-15T07:37:33.000Z","dependencies_parsed_at":"2024-10-21T10:52:29.915Z","dependency_job_id":null,"html_url":"https://github.com/h1alexbel/tagrs","commit_stats":null,"previous_names":["h1alexbel/tagrs"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h1alexbel%2Ftagrs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h1alexbel%2Ftagrs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h1alexbel%2Ftagrs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h1alexbel%2Ftagrs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/h1alexbel","download_url":"https://codeload.github.com/h1alexbel/tagrs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248517348,"owners_count":21117435,"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":["rust","test-run","testing"],"created_at":"2024-11-07T10:19:57.186Z","updated_at":"2025-04-12T04:32:38.272Z","avatar_url":"https://github.com/h1alexbel.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tagrs. Rust test tagging\n\n[![EO principles respected here](https://www.elegantobjects.org/badge.svg)](https://www.elegantobjects.org)\n[![DevOps By Rultor.com](http://www.rultor.com/b/h1alexbel/tagrs)](http://www.rultor.com/p/h1alexbel/tagrs)\n[![We recommend IntelliJ IDEA](https://www.elegantobjects.org/intellij-idea.svg)](https://www.jetbrains.com/idea/)\n\n[![just](https://github.com/h1alexbel/tagrs/actions/workflows/just.yml/badge.svg)](https://github.com/h1alexbel/tagrs/actions/workflows/just.yml)\n[![Crates.io Version](https://img.shields.io/crates/v/tagrs)](https://crates.io/crates/tagrs)\n[![codecov](https://codecov.io/github/h1alexbel/tagrs/graph/badge.svg?token=GXcsA2ffuN)](https://codecov.io/github/h1alexbel/tagrs)\n[![PDD status](http://www.0pdd.com/svg?name=h1alexbel/tagrs)](http://www.0pdd.com/p?name=h1alexbel/tagrs)\n[![Hits-of-Code](https://hitsofcode.com/github/h1alexbel/tagrs)](https://hitsofcode.com/view/github/h1alexbel/tagrs)\n[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/h1alexbel/tagrs/blob/master/LICENSE.txt)\n\n`tagrs` is a tool for [Rust test] tagging.\n\n**Motivation**. There was no such tool for Rust, that can run tests\nconditionally, based on tags, similarly to JUnit's [@Tag][JUnit Tag].\n\n## How to use\n\nHere is an example:\n\n```rust\n#[cfg(test)]\nmod tests {\n    use anyhow::Result;\n    use tagrs::tag;\n    use std::thread;\n    use std::time::Duration;\n    \n    #[tag(\"fast\")]\n    #[test]\n    fn runs_fast() -\u003e Result\u003c()\u003e {\n        assert_eq!(1 + 1, 2);\n        Ok(())\n    }\n    \n    #[tag(\"slow\")]\n    #[test]\n    fn runs_slow() -\u003e Result\u003c()\u003e {\n        thread::sleep(Duration::from_secs(2));\n        assert_eq!(2 + 2, 4);\n        Ok(())\n    }\n\n    #[tag(\"nightly\")]\n    #[test]\n    fn runs_very_slow() -\u003e Result\u003c()\u003e {\n        thread::sleep(Duration::from_mins(2));\n        assert_eq!(4 + 4, 8);\n        Ok(())\n    }\n}\n```\n\nthen run:\n\n```bash\nTTAG=fast cargo test\n```\n\nIt should run only `runs_fast` test, while `runs_slow`, `runs_very_slow` will\nbe ignored.\n\nYou can run a group of tags as well. Either with:\n\n```bash\nTTAG=slow,fast cargo test\n```\n\nor with `*`:\n\n```bash\nTTAG=* cargo test\n```\n\nThe former will run only tests that have `slow` or `fast` tag, while the latter\nwill run all tests.\n\n## How to contribute?\n\nMake sure that you have [Rust] and [just] installed on your system, then fork\nthis repository, make changes, send us a [pull request][guidelines]. We will\nreview your changes and apply them to the `master` branch shortly, provided\nthey don't violate our quality standards. To avoid frustration, before sending\nus your pull request please run full build:\n\n```bash\njust full\n```\n\n[Rust test]: https://doc.rust-lang.org/book/ch11-01-writing-tests.html\n[JUnit Tag]: https://junit.org/junit5/docs/5.0.2/api/org/junit/jupiter/api/Tag.html\n[guidelines]: https://www.yegor256.com/2014/04/15/github-guidelines.html\n[Rust]: https://www.rust-lang.org/tools/install\n[just]: https://just.systems/man/en/chapter_4.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fh1alexbel%2Ftagrs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fh1alexbel%2Ftagrs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fh1alexbel%2Ftagrs/lists"}