{"id":16056528,"url":"https://github.com/markbates/tt","last_synced_at":"2025-07-04T23:08:47.893Z","repository":{"id":57513805,"uuid":"60382080","full_name":"markbates/tt","owner":"markbates","description":"T.T. The Test Running Bear!","archived":false,"fork":false,"pushed_at":"2020-02-22T22:16:23.000Z","size":45,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-07T14:39:24.438Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","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/markbates.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-06-03T22:47:35.000Z","updated_at":"2024-08-19T23:07:36.000Z","dependencies_parsed_at":"2022-08-31T22:51:43.213Z","dependency_job_id":null,"html_url":"https://github.com/markbates/tt","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/markbates/tt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markbates%2Ftt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markbates%2Ftt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markbates%2Ftt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markbates%2Ftt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markbates","download_url":"https://codeload.github.com/markbates/tt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markbates%2Ftt/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263632057,"owners_count":23491530,"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":[],"created_at":"2024-10-09T03:00:20.308Z","updated_at":"2025-07-04T23:08:47.876Z","avatar_url":"https://github.com/markbates.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# T.T. (The Bear)\n\n ![](http://images.buycostumes.com/mgen/merchandiser/grateful-dead-blue-dancing-bear-deluxe-adult-costume-bc-805288.jpg?zm=250,250,1,0,0)\n\n__T.T. is smarter than you. I know this because he is smarter than me. He knows how to run my tests. He helps me when I'm tired. He helps me when I can't think for my self. T.T. wants to help you.__\n\n## What is T.T?\n\nT.T. is a tool that runs the tests for you application in a unified way. You don't have to remember if it's a `go` or a `ruby` project, or any other type of project for that matter. T.T. just knows, and all you have to do is type `tt`, and he'll do the rest! T.T. will even remember what you ran, when you ran it, what the output was! He's a genius!!\n\n## Installation\n\n```\n$ go get github.com/markbates/tt\n```\n\n### Usage\n\nAll you should really need to do is let T.T. loose on your test suite:\n\n```\n$ tt\n```\n\nAny arguments you pass to T.T. will be thoughtfully passed along to the appropriate test runner underneath. You can also run a specific test runner, should you desire, see the \"Supported Test Runners\" section for more details.\n\n## Supported Test Runners\n\nRight now T.T. only supports a handful of test runners, but with your help we'll get more!\n\n### Rake\n\n__Key file:__ *Rakefile*\n\nIf you're project contains a `Rakefile`, than T.T. will assume you want to run that suite using `rake`. Oh, but wait, there's a `Gemfile` too? Oh man, T.T. knows just what to do with that! He'll run rake for you using `bundle exec rake`, he's just that nice of a bear!\n\n```\n$ tt \u003cany flags/args the rake command takes\u003e\n// or\n$ tt rake \u003cany flags/args the rake command takes\u003e\n```\n\n### Go\n\n__Key file:__ **_.test.go*\n\nIf you're project contains any `_test.go` files, than T.T. will run `go test` for you. Oh, and yes, he is very aware of that pesky `vendor` folder and knows enough to stay well and truly away from it!\n\n```\n$ tt \u003cany flags/args the go test command takes\u003e\n// or\n$ tt go \u003cany flags/args the go test command takes\u003e\n```\n\n#### The `-run` flag\n\nYes, T.T. knows about the `-run` flag. If you tell him to run a particular test of tests, he will!\n\n```\n$ tt go -run Hello ./models\n```\n\n### Make\n\n__Key file:__ *Makefile*\n\nAre you a masochist? Do you love your old `make` files? Well, you want to know a secret? T.T. loves them too. They remind him of a simplier time.\n\n```\n$ tt \u003cany flags/args your Makefile takes\u003e\n// or\n$ tt make\n```\n\nIf you do want to use a `Makefile`, than T.T. asked me to let you know that you have a `test` target in the `Makefile`, otherwise, he'll just be down right confused and won't know what to do!\n\n### NPM\n\n__Key file:__ *package.json*\n\nT.T. knows that you young kids like to use NPM for everything. He doesn't quite understand why, but he has your back. If there is a `package.json` file in your app then `T.T.` will respond by running `npm test` for you.\n\n```\n$ tt \u003cany flags/args your ./test.sh file takes\u003e\n// or\n$ tt npm \u003cany flags/args your ./test.sh file takes\u003e\n```\n\n### Ruby (individual files)\n\nT.T. knows that sometimes when you're running a Rails/Ruby application that you sometimes just want to run a very specific test file. That's super easy for T.T.!\n\n```\n$ tt ruby \u003cpath/to/file.rb\u003e\n```\n\nT.T. is such a clever bear that he even knows when you're not on a test file, and will try and find the test file for you. For example, if you try to run `app/models/user.rb` T.T. will look for either `test/models/user_test.rb` or `spec/models/user_spec.rb` and try to run that for you. I told you, he's a very, very clever bear. :)\n\n### Custom (`./test.sh`)\n\n__Key file:__ *./test.sh*\n\nIt is hard for poor old T.T. to keep up with all of the latest and greatest new testing tools, programming languages, and reality TV stars out there. So, if T.T. doesn't know how to handle you're favorite way of running tests, don't worry! Just drop a `./test.sh` file in your app and you are good to go!\n\n```\n$ tt \u003cany flags/args your ./test.sh file takes\u003e\n// or\n$ tt sh \u003cany flags/args your ./test.sh file takes\u003e\n```\n\n## History\n\nT.T. has an incredible memory! He can remember all of the different test runs you've done! Seriously, it's a pretty cool party trick.\n\n### Listing History\n\n```\n$ tt history\n// or\n$ tt h\n```\n\nThis will output something along the lines of the following:\n\n```bash\n1)  Tue Jun 07 17:14:35 -0400 2016  | PASS\n2)  Tue Jun 07 17:15:47 -0400 2016  | PASS\n3)  Tue Jun 07 17:16:26 -0400 2016  | FAIL\n4)  Tue Jun 07 17:16:33 -0400 2016  | PASS\n```\n\n#### Verbose\n\nYou can also pass the `-v` flag to get more verbose details on what was ran:\n\n```bash\n$ tt h -v\n1)  Tue Jun 07 17:14:35 -0400 2016  | PASS\n    go test github.com/markbates/tt github.com/markbates/tt/cmd github.com/markbates/tt/cmd/models\n2)  Tue Jun 07 17:15:47 -0400 2016  | PASS\n    go test github.com/markbates/tt github.com/markbates/tt/cmd github.com/markbates/tt/cmd/models\n3)  Tue Jun 07 17:16:26 -0400 2016  | FAIL\n    go test github.com/markbates/tt github.com/markbates/tt/cmd github.com/markbates/tt/cmd/models\n4)  Tue Jun 07 17:16:33 -0400 2016  | PASS\n    go test github.com/markbates/tt github.com/markbates/tt/cmd github.com/markbates/tt/cmd/models\n```\n\n### Replay History\n\n```\n$ tt history \u003cn\u003e\n// or\n$ tt h \u003cn\u003e\n```\n\nThis command will not actually run the commands again, but will rather show you the output from when the command was originally run. This is really useful for recalling what tests failed.\n\n### Replay Last Run\n\n```\n$ tt history last\n// or\n$ tt h last\n```\nThis command will not actually run the last command again, but will rather show you the output from when the command was originally run. This is really useful for recalling what tests failed.\n\n### Clear History\n\n```\n$ tt history clear\n// or\n$ tt h clear\n```\n\n### History as JSON\n\nAlmost all of the History commands, with the exception of `clear` accept the `-j` flag which will output the history as JSON instead of plain text.\n\n```text\n$ tt h -j\n[\n  {\n    \"id\": 3,\n    \"time\": \"2016-06-07T17:16:26.867353264-04:00\",\n    \"cmd\": [\n      \"go\",\n      \"test\",\n      \"github.com/markbates/tt\",\n      \"github.com/markbates/tt/cmd\",\n      \"github.com/markbates/tt/cmd/models\"\n    ],\n    \"results\": \"?   \\tgithub.com/markbates/tt\\t[no test files]\\nok  \\tgithub.com/markbates/tt/cmd\\t0.078s\\n--- FAIL: Test_History_Save (0.00s)\\n\\tassertions.go:225: \\r                        \\r\\tError Trace:\\thistory_test.go:39\\n\\t\\t\\r\\tError:\\t\\tShould be false\\n\\t\\t\\r\\nFAIL\\nFAIL\\tgithub.com/markbates/tt/cmd/models\\t0.023s\\n\",\n    \"error\": \"exit status 1\",\n    \"exit_code\": 1\n  },\n  {\n    \"id\": 4,\n    \"time\": \"2016-06-07T17:16:33.761527184-04:00\",\n    \"cmd\": [\n      \"go\",\n      \"test\",\n      \"github.com/markbates/tt\",\n      \"github.com/markbates/tt/cmd\",\n      \"github.com/markbates/tt/cmd/models\"\n    ],\n    \"results\": \"?   \\tgithub.com/markbates/tt\\t[no test files]\\nok  \\tgithub.com/markbates/tt/cmd\\t0.075s\\nok  \\tgithub.com/markbates/tt/cmd/models\\t0.015s\\n\",\n    \"error\": \"\",\n    \"exit_code\": 0\n  }\n]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkbates%2Ftt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkbates%2Ftt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkbates%2Ftt/lists"}