{"id":13413893,"url":"https://github.com/pavlo/gosuite","last_synced_at":"2026-03-12T15:04:59.243Z","repository":{"id":57496922,"uuid":"71008857","full_name":"pavlo/gosuite","owner":"pavlo","description":"Test suites support for standard Go1.7 \"testing\" by leveraging Subtests feature","archived":false,"fork":false,"pushed_at":"2016-10-18T16:53:21.000Z","size":20,"stargazers_count":12,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-17T07:18:32.024Z","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/pavlo.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-10-15T19:28:14.000Z","updated_at":"2024-02-26T10:47:10.000Z","dependencies_parsed_at":"2022-09-03T02:30:53.376Z","dependency_job_id":null,"html_url":"https://github.com/pavlo/gosuite","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pavlo/gosuite","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pavlo%2Fgosuite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pavlo%2Fgosuite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pavlo%2Fgosuite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pavlo%2Fgosuite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pavlo","download_url":"https://codeload.github.com/pavlo/gosuite/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pavlo%2Fgosuite/sbom","scorecard":{"id":724097,"data":{"date":"2025-08-11","repo":{"name":"github.com/pavlo/gosuite","commit":"d5a3671820d501f293e3d869479251befb8586ef"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":-1,"reason":"no workflows found","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":"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":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"Code-Review","score":0,"reason":"Found 0/20 approved changesets -- score normalized to 0","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":"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":"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":"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: MIT License: 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":"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"}}]},"last_synced_at":"2025-08-22T12:14:27.992Z","repository_id":57496922,"created_at":"2025-08-22T12:14:27.992Z","updated_at":"2025-08-22T12:14:27.992Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30429354,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T14:34:45.044Z","status":"ssl_error","status_checked_at":"2026-03-12T14:09:33.793Z","response_time":114,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-07-30T20:01:52.153Z","updated_at":"2026-03-12T15:04:59.224Z","avatar_url":"https://github.com/pavlo.png","language":"Go","funding_links":[],"categories":["Testing","测试","Template Engines","测试相关","测试相关`测试库和测试数据集生成库`","\u003cspan id=\"测试-testing\"\u003e测试 Testing\u003c/span\u003e","Testing Frameworks"],"sub_categories":["HTTP Clients","Testing Frameworks","HTTP客户端","Advanced Console UIs","交流","查询语","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e"],"readme":"# Go Suite\n\n[![Build Status](https://semaphoreci.com/api/v1/pavlikus/gosuite/branches/master/badge.svg)](https://semaphoreci.com/pavlikus/gosuite) [![codecov](https://codecov.io/gh/pavlo/gosuite/branch/master/graph/badge.svg)](https://codecov.io/gh/pavlo/gosuite)\n\n\nThe support for test suites for Golang 1.7 and later.\n \nGolang 1.7 featured [Subtests](https://golang.org/pkg/testing/) that allowed you to group tests in order to share common setup and teardown logic. While that was a great addition to the `testing` package, it was a bit clunky syntactically. The GoSuite package leverages Golang's 1.7 Subtests feature, defines a simple `TestSuite` interface and runs test cases inside of them keeping setup/teardown logic for the whole suite and for single cases in place.\n\n## Quick Start\n\nTo start with, create a struct with the four methods implemented:\n\n```go\ntype MyTestSuite struct {\n    // DB connection\n    // etc\n}\n\n// SetUpSuite is called once before the very first test in suite runs\nfunc (s *MyTestSuite) SetUpSuite() {\n}\n\n// TearDownSuite is called once after thevery last test in suite runs\nfunc (s *MyTestSuite) TearDownSuite() {\n}\n\n// SetUp is called before each test method\nfunc (s *MyTestSuite) SetUp() {\n}\n\n// TearDown is called after each test method\nfunc (s *MyTestSuite) TearDown() {\n}\n```\n \nThen add one or more test methods to it, prefixing them with `Test` prefix:\n\n```go\nfunc (s *MyTestSuite) TestMyFirstTestCase(t *testing.T) {\n    if !someJob {\n        t.Fail(\"Unexpected failure!\")\n    }\n}\n\n```\n\nAlmost done! The only piece that remains is to run the suite! You do this by calling the `Run` method. Note, the enclosing `TestIt` method is a normal testing method you usually write in Go, nothing fancy at all!\n\n```go\nfunc TestIt(t *testing.T) {\n\tRun(t, \u0026MyTestSuite{})\n}\n```\n\n## Installation\n\nTo install Go Suite, use `go get`:\n\n```\ngo get github.com/pavlo/gosuite\n```\n\nThe import the `pavlo/gosuite` package into your code like this:\n\n```go\npackage yours\n\nimport (\n  \"testing\"\n  \"github.com/pavlo/gosuite\"\n)\n\n...\n```\n\n## Complete Example\n\nThe complete example is shown to help you to see the whole thing on the same page. Note, it leverages the [Is](https://github.com/tylerb/is) package for assertions... the package is great though indeed it is not required to use with Go Suite. *The example however demonstrates a slick technique making the assertion methods available on the suite itself!* \n\n```go\n\nimport (\n  \"testing\"\n  \"github.com/pavlo/gosuite\"\n)\n\ntype Suite struct {\n\t*is.Is\n\tsetUpSuiteCalledTimes    int\n\ttearDownSuiteCalledTimes int\n\tsetUpCalledTimes         int\n\ttearDownUpCalledTimes    int\n}\n\nfunc (s *Suite) SetUpSuite() {\n\ts.setUpSuiteCalledTimes++\n}\n\nfunc (s *Suite) TearDownSuite() {\n\ts.tearDownSuiteCalledTimes++\n}\n\nfunc (s *Suite) SetUp() {\n\ts.setUpCalledTimes++\n}\n\nfunc (s *Suite) TearDown() {\n\ts.tearDownUpCalledTimes++\n}\n\nfunc TestIt(t *testing.T) {\n    s := \u0026Suite{Is: is.New(s.t)}\n\tgosuite.Run(t, s)\n\t\n\ts.Equal(1, s.setUpSuiteCalledTimes)\n\ts.Equal(1, s.tearDownSuiteCalledTimes)\n\ts.Equal(2, s.setUpCalledTimes)\n\ts.Equal(2, s.tearDownUpCalledTimes)\n}\n\nfunc (s *Suite) TestFirstTestMethod(t *testing.T) {\n\ts.Equal(1, s.setUpSuiteCalledTimes)\n\ts.Equal(0, s.tearDownSuiteCalledTimes)\n\ts.Equal(1, s.setUpCalledTimes)\n\ts.Equal(0, s.tearDownUpCalledTimes)\n}\n\nfunc (s *Suite) TestSecondTestMethod(t *testing.T) {\n\ts.Equal(1, s.setUpSuiteCalledTimes)\n\ts.Equal(0, s.tearDownSuiteCalledTimes)\n\ts.Equal(2, s.setUpCalledTimes)\n\ts.Equal(1, s.tearDownUpCalledTimes)\n}\n\n```\n\nRunning it with `go test -v` would emit this:\n\n```\n\u003e go test -v\n\n=== RUN   TestIt\n=== RUN   TestIt/TestFirstTestMethod\n=== RUN   TestIt/TestSecondTestMethod\n--- PASS: TestIt (0.00s)\n    --- PASS: TestIt/TestFirstTestMethod (0.00s)\n    --- PASS: TestIt/TestSecondTestMethod (0.00s)\nPASS\nok  \tgithub.com/pavlo/gosuite\t0.009s\nSuccess: Tests passed.\n```\n\n\n## License\n\n`Go Suite` is released under the [MIT License](http://www.opensource.org/licenses/MIT).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpavlo%2Fgosuite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpavlo%2Fgosuite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpavlo%2Fgosuite/lists"}