{"id":13446837,"url":"https://github.com/lynchborg/ezdc","last_synced_at":"2025-10-16T06:13:08.045Z","repository":{"id":45732552,"uuid":"514259813","full_name":"lynchborg/ezdc","owner":"lynchborg","description":"Easy Testing With Docker Compose in Go.","archived":false,"fork":false,"pushed_at":"2024-02-12T08:42:24.000Z","size":52,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T13:45:04.581Z","etag":null,"topics":["docker-compose","go","harness","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/lynchborg.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}},"created_at":"2022-07-15T12:22:11.000Z","updated_at":"2024-09-22T06:42:19.000Z","dependencies_parsed_at":"2024-01-07T10:50:57.604Z","dependency_job_id":"6f5070bf-1e28-4c1a-8bf9-78b95469d33b","html_url":"https://github.com/lynchborg/ezdc","commit_stats":null,"previous_names":["byrnedo/dctest","byrnedo/ezdc"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/lynchborg/ezdc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lynchborg%2Fezdc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lynchborg%2Fezdc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lynchborg%2Fezdc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lynchborg%2Fezdc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lynchborg","download_url":"https://codeload.github.com/lynchborg/ezdc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lynchborg%2Fezdc/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259913662,"owners_count":22931251,"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":["docker-compose","go","harness","testing"],"created_at":"2024-07-31T05:01:01.178Z","updated_at":"2025-10-16T06:13:02.988Z","avatar_url":"https://github.com/lynchborg.png","language":"Go","readme":"# EZDC - Easy Testing With Docker Compose\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/lynchborg/ezdc/blob/master/LICENSE)\n[![Go Reference](https://pkg.go.dev/badge/github.com/lynchborg/ezdc.svg)](https://pkg.go.dev/github.com/lynchborg/ezdc)\n[![Go Coverage](https://github.com/lynchborg/ezdc/wiki/coverage.svg)](https://raw.githack.com/wiki/lynchborg/ezdc/coverage.html)\n[![Go Report Card](https://goreportcard.com/badge/github.com/lynchborg/ezdc)](https://goreportcard.com/report/github.com/lynchborg/ezdc)\n\nFor easily setting up tests that rely on services in a docker-compose.yml\n\nDo you want your tests to be setup with:\n\n- `docker compose pull`\n- `docker compose build`\n- `docker compose up`\n- Some logic to know containers are ready\n- YOUR TESTS HERE\n\n  Followed by\n- `docker compose down` ?\n\nYes? Then we've got you covered. No? Make a P.R. ⌨️ ❤️\n\nWrap you `m.Run()` and `ezdc` will take care of spinning up your containers and checking that they're ready before\nrunning your tests.\n\nHave a look in the [./examples](./examples) dir for runnable tests.\n\n## Usage\n\n```go\npackage my_test\n\nimport (\n\t\"os\"\n\t\"testing\"\n\t\"github.com/lynchborg/ezdc\"\n)\n\nfunc TestMain(m *testing.M) {\n\n\th := ezdc.Harness{\n\t\tProjectName: \"ezdc-example\",\n\t\tServices: []ezdc.Service{\n\t\t\t{\n\t\t\t\tName: \"nats\",\n\t\t\t\t// will pull before starting tests\n\t\t\t\tPull: true,\n\t\t\t\t// will wait for nats to listen on localhost:4222\n\t\t\t\tWaiter: ezdc.TcpWaiter{\n\t\t\t\t\tPort: 4222,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\t// h.Run does\n\t// - down (removes volumes)\n\t// - pull (for any configured services with Pull = TRUE)\n\t// - build\n\t// - up\n\t// And when the callback is finished, will run down\n\tc, err := h.Run(context.Background(), m.Run)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tos.Exit(c)\n}\n```\n\n## Configuration\n\n### Harness\n\n| Setting     |                                                                 |\n|-------------|-----------------------------------------------------------------|\n| ProjectName | The project name to give to docker-compose. Required            | \n| File        | Path to docker-compose file. Defaults to ./docker-compose.yml   |\n| Services    | Configuration of services. Optional.                            |\n| Logs        | Where to send the docker-compose output. Defaults to os.Stdout. |\n\n### Services\n\n| Setting |                                                                                                                   |\n|---------|-------------------------------------------------------------------------------------------------------------------|\n| Name    | Name of the service. Doesn't necessarily have to match any in the docker compose file, but does if `Pull` is TRUE |\n| Pull    | Pull the image before running tests. Default is false.                                                            |\n| Waiter  | Configures how to declare your service 'ready'. Optional.                                                         |\n\n## Waiters\n\nCurrently supports\n\n- Http (`HttpWaiter`)\n- Tcp (`TcpWaiter`)\n","funding_links":[],"categories":["Development with Docker"],"sub_categories":["Testing"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flynchborg%2Fezdc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flynchborg%2Fezdc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flynchborg%2Fezdc/lists"}