{"id":17951920,"url":"https://github.com/tpaschalis/hop","last_synced_at":"2025-07-14T09:10:46.134Z","repository":{"id":57537431,"uuid":"283306731","full_name":"tpaschalis/hop","owner":"tpaschalis","description":"An interactive test runner for Go","archived":false,"fork":false,"pushed_at":"2020-08-06T19:39:22.000Z","size":207,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-09T04:45:53.398Z","etag":null,"topics":["go","golang","interactive-test-runner","testing","testing-tool"],"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/tpaschalis.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":"2020-07-28T19:21:21.000Z","updated_at":"2025-01-03T05:12:38.000Z","dependencies_parsed_at":"2022-09-04T13:51:09.336Z","dependency_job_id":null,"html_url":"https://github.com/tpaschalis/hop","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpaschalis%2Fhop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpaschalis%2Fhop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpaschalis%2Fhop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpaschalis%2Fhop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tpaschalis","download_url":"https://codeload.github.com/tpaschalis/hop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247033896,"owners_count":20872553,"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":["go","golang","interactive-test-runner","testing","testing-tool"],"created_at":"2024-10-29T09:51:43.047Z","updated_at":"2025-04-03T16:21:36.894Z","avatar_url":"https://github.com/tpaschalis.png","language":"Go","readme":"# hop\n\n*This is a work-in-progress. Things are likely to change (a lot). Hopefully for the best.*\n\n![gopher logo](gopher.png)\n\nHop is an interactive test runner for Go. It was inspired by Jest's [*--watch*](https://jestjs.io/docs/en/cli#--watch) mode and [this](https://twitter.com/felixge/status/1286359708799062016) tweet. It's called Hop, because well, you just hop in and start running your tests! Coffee and music are optional, but recommended!\n\n## Installation and Usage\n\nYou can get `hop` by running.\n```bash\n$ go get -u github.com/tpaschalis/hop\n    # or\n$ git clone https://github.com/tpaschalis/hop.git\n$ cd hop\n$ go install .\n```\n\nIt comes with two modes; the default plain old boring B\u0026W, as well as fabulous 🌈🎨🎆🍭colourized output.  \nJust provide the `--colour` flag!\n\n## Here's Hop in action!\n\n*Monochrome mode*\n[![asciicast](https://asciinema.org/a/UenZ2mIRGR2el929n0TYwRWt4.svg)](https://asciinema.org/a/UenZ2mIRGR2el929n0TYwRWt4)\n\n## Are you just wrapping some commands?\n\nYes, I'm candy wrapping the following commands in a for-loop. Plus colours! You could probably do this yourself using some bash + aliases, but where's the fun in that?!\n```\ngo test -v ./...\ngo test -v ./... -count=1\ngo test -v ./... -list .\ngo test -v ./... -list \u003cpattern\u003e\ngo test -v ./... -run \u003cpattern\u003e\ngo test -v ./... -bench=. -run ^Benchmark\n```\n\n## How does it work?\nHop is a simple REPL, which runs the aforementioned `go test` commands. As we mentioned, it features two modes, monochrome (by default) which displays the stdout/stderr, and colourful (enabled by using `--colour`).\n\nHop uses two custom `io.Writer` types, *monochromeWriter* and *colourizedWriter*. After that, it's just using [`exec.Command`](https://golang.org/pkg/os/exec/#Command), and `io.MultiWriter` to stream the output to our custom writer.\n\nThe inspiration, Jest, works a little bit different. It watches for files for changes and reruns tests related to changed files only. I tried using [fsnotify](https://github.com/fsnotify/fsnotify) for the same effect, but ultimately I decided it isn't worth it. \n\nChanges to a specific file might have effects on a different package, so something like fsnotify would not catch all the cases. The good news is that the `go test` tool takes care of all this, by caching tests that wouldn't change, and rerunning any tests that are affected by changes, which is what we'd ultimately want! \n\n## These colors suck!\nFirst off, I'm using *colour*, with an 'ou'. Mainly because 'monochrome' and 'colourized' have the same number of letters.\n\nSecondly, that's very probable! You could change them by tinkering with the `colors.go` file (see the irony?).\n\nI'm probably going to add some easy way to configure them from a text file. I'm a below average designer, so feel free to propose changes!\n\n## Roadmap\n- Show pretty-printed coverage\n- Run tests with specific tags\n- Run previously failed tests\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftpaschalis%2Fhop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftpaschalis%2Fhop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftpaschalis%2Fhop/lists"}