{"id":13685749,"url":"https://github.com/alexrios/ztests","last_synced_at":"2025-10-23T06:30:17.807Z","repository":{"id":55137833,"uuid":"201686798","full_name":"alexrios/ztests","owner":"alexrios","description":"Easy integrations tests with containers","archived":false,"fork":false,"pushed_at":"2021-01-07T17:50:05.000Z","size":60,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-07T14:02:04.290Z","etag":null,"topics":["containers","docker","docker-container","feedback","go","golang","hacktoberfest","pool","postgres","pq","sqlx","test-automation","test-containers","testing","testing-tools"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexrios.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-10T21:54:11.000Z","updated_at":"2021-01-07T17:50:08.000Z","dependencies_parsed_at":"2022-08-14T13:10:23.190Z","dependency_job_id":null,"html_url":"https://github.com/alexrios/ztests","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexrios%2Fztests","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexrios%2Fztests/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexrios%2Fztests/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexrios%2Fztests/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexrios","download_url":"https://codeload.github.com/alexrios/ztests/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237784844,"owners_count":19365940,"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":["containers","docker","docker-container","feedback","go","golang","hacktoberfest","pool","postgres","pq","sqlx","test-automation","test-containers","testing","testing-tools"],"created_at":"2024-08-02T14:00:56.914Z","updated_at":"2025-10-23T06:30:17.426Z","avatar_url":"https://github.com/alexrios.png","language":"Go","funding_links":[],"categories":["Conteúdo"],"sub_categories":["Projetos"],"readme":"# Z Tests\nGolang tests with containers without friction\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/alexrios/ztests)](https://goreportcard.com/report/github.com/alexrios/ztests)\n\n## Getting started\nThe purpose is to make testing docker containers easier without having to worry about managing them. \nThe main goal of this library is to be as transparent as possible when it comes to a simple suite of unit tests.\n\nTo achieve this results this project uses [Test Containers Go](https://github.com/testcontainers/testcontainers-go) and\n[Canned Containers](https://github.com/alexrios/canned-containers)\n\n#### Example\nThis example has 3 easy steps:\n* Call `Setup()` to receive a `db connection` and a `termination function`\n* `defer teardown()` to handle all the docker parts\n* The test itself \n\n```go\nimport (\n\t\"context\"\n\t\"github.com/alexrios/ztests/postgres\"\n\t\"testing\"\n)\n\nfunc Test(t *testing.T) {\n\tctx := context.Background()\n\ttestEnv, err := postgres.Setup()\n\tdefer testEnv.Teardown()\n\tconn, err := testEnv.DB.Conn(ctx)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tvar twelve int\n\trow := conn.QueryRowContext(ctx, \"select $1\", 12)\n\terr = row.Scan(\u0026twelve)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif twelve != 12 {\n\t\tt.FailNow()\n\t}\n}\n\n```\n\n### TODO\n[x] support for Postgres canned container \n\n[ ] support for Redis canned container \n\n[ ] support for Elastic Search canned container\n\n[ ] support for MySQL Search canned container\n\n[ ] support for nginx Search canned container\n\n[ ] and many more...\n\n## Contributing\nIf you have any questions or feedback regarding ztests, bring it!\nYour feedback is always welcome.\n\n#### Getting help?\nHit me on twitter [@alextrending](https://twitter.com/alextrending)!\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexrios%2Fztests","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexrios%2Fztests","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexrios%2Fztests/lists"}