{"id":17151131,"url":"https://github.com/hpidcock/gophertest","last_synced_at":"2025-03-24T12:23:15.551Z","repository":{"id":95437226,"uuid":"198587756","full_name":"hpidcock/gophertest","owner":"hpidcock","description":"Run go tests with speed","archived":false,"fork":false,"pushed_at":"2023-04-04T10:13:19.000Z","size":125,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-16T00:13:57.212Z","etag":null,"topics":["golang","testing"],"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/hpidcock.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":"2019-07-24T08:03:01.000Z","updated_at":"2020-09-14T23:22:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"3210398f-f871-4146-88c1-54adb170ede7","html_url":"https://github.com/hpidcock/gophertest","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/hpidcock%2Fgophertest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hpidcock%2Fgophertest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hpidcock%2Fgophertest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hpidcock%2Fgophertest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hpidcock","download_url":"https://codeload.github.com/hpidcock/gophertest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245267768,"owners_count":20587501,"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":["golang","testing"],"created_at":"2024-10-14T21:37:18.974Z","updated_at":"2025-03-24T12:23:15.528Z","avatar_url":"https://github.com/hpidcock.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gophertest :fire:\n\nGo-for-test speeds up testing large Go projects by building once and running tests concurrently.\n\n## Who is this for\n\n- Projects that have a lot of test packages :ant:\n- Projects that have a lot of long running tests :snail:\n- Projects that have a lot of shared dependencies :deciduous_tree:\n\n## Requirements\n\nTo be able to test your project it must currently conform to these requirements:\n- Build without Cgo (pure go)\n\n## Installing\n\n`go get github.com/hpidcock/gophertest`\n\n## Running\n\nGophertest tool builds a test binary similar to `go test -c` but the difference is that it shares a single binary across multiple test packages.\n\nTo build and run a test binary for project `github.com/x/y`:\n- change working directory to the project root\n- `$ gophertest github.com/x/y/first github.com/x/y/second`\n- `$ ./gopher.test`\n\n### Passing test packages to gophertest\n\nYou can pass test package paths to `gophertest` three ways.\nEither by trailing command line args, a file or via stdin.\n```\n$ gophertest\nonly one of -f or -stdin or command line packages can be passed\n  -f string\n    \tRead package names from file\n  -o string\n    \tOutput binary (default \"gopher.test\")\n  -p string\n    \tGroup package directory (default is working directory)\n  -stdin\n    \tRead package names from stdin\n```\n\nTo pass all packages of a project you can use `go list` and pipe that to `gophertest`.\n```\n$ go list github.com/x/y/... | gophertest\n```\n\n### Passing arguments to built test binary\n\nAll arguments passed to the test binary are used in invocations to each test. You can use all the flags your test package wants or even the standard flags usable when compiling a test package with `go test -c`.\n\n### Running a single test package\n\nYou can still and should use `go test` when you want to run a single package. In the case you want to run a single package you can use the `GOPHERTEST_PKG` environment variable to pass the package you want to run.\n\n```\n$ GOPHERTEST_PKG=\"github.com/x/y/first\" ./gopher.test\n```\n\n### Concurrent test running\n\nBy default test binaries produced by `gophertest` will not run concurrently. To do this pass the `GOPHERTEST_CONCURRENT` environment variable when running tests. It can be any number, but its recommended to use small numbers close to the number of CPU cores or threads available.\n\n```\n$ GOPHERTEST_CONCURRENT=8 ./gopher.test\n```\n\n*NOTE: When running tests in concurrent mode, test output will be buffered in memory and written to stdout when the test completes. For this reason all stderr will be blended with stdout. It should be kept in mind that test output in this mode is buffered to memory, so large test ouput may consume too much memory and should be avoided.*\n\n## Todo :squirrel:\n\n- Support cgo and cross-compilation\n- Embedding source and testdata\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhpidcock%2Fgophertest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhpidcock%2Fgophertest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhpidcock%2Fgophertest/lists"}