{"id":19168423,"url":"https://github.com/bloomberg/docket","last_synced_at":"2025-05-07T14:41:32.564Z","repository":{"id":55634130,"uuid":"183077446","full_name":"bloomberg/docket","owner":"bloomberg","description":"Tool to make running test suites easier, using docker-compose.","archived":false,"fork":false,"pushed_at":"2023-10-09T16:37:03.000Z","size":166,"stargazers_count":22,"open_issues_count":7,"forks_count":5,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-19T23:31:59.725Z","etag":null,"topics":["docker","docker-compose","go","golang","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bloomberg.png","metadata":{"files":{"readme":"README.markdown","changelog":"CHANGELOG.markdown","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-04-23T18:52:52.000Z","updated_at":"2025-04-17T10:40:44.000Z","dependencies_parsed_at":"2024-06-19T01:44:25.780Z","dependency_job_id":"3933b97a-7965-47fc-9539-c58bf6328fd7","html_url":"https://github.com/bloomberg/docket","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bloomberg%2Fdocket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bloomberg%2Fdocket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bloomberg%2Fdocket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bloomberg%2Fdocket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bloomberg","download_url":"https://codeload.github.com/bloomberg/docket/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252897370,"owners_count":21821430,"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","docker-compose","go","golang","testing","testing-tools"],"created_at":"2024-11-09T09:42:37.519Z","updated_at":"2025-05-07T14:41:32.540Z","avatar_url":"https://github.com/bloomberg.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# docket\n\nDocket helps you use [Docker Compose](https://docs.docker.com/compose/overview/)\nto manage test environments.\n\n## \u0026#x26A0; **_Stability warning: API might change_** \u0026#x26A0;\n\nThis pre-1.0.0 API is subject to change as we make improvements.\n\n## Contents\n\n- [Overview](#overview)\n- [Examples](#examples)\n- [Help](#help)\n- [Testing Docket](#testing-docket)\n- [Code of Conduct](#code-of-conduct)\n- [Contributing](#contributing)\n- [License](#license)\n- [Security Policy](#security-policy)\n\n## Overview\n\nDocket helps you run a test or test suite inside a multi-container Docker\napplication using Docker Compose. If requested, docket will run bring up a\nDocker Compose app, run the test suite, and optionally shut down the app. If you\ndon't activate docket, the test will run as if you weren't using docket at all.\n\nDocket is compatible with the standard [`testing`](https://godoc.org/testing)\npackage (including [`T.Run`](https://godoc.org/testing#T.Run) subtests) as well\nas [`testgroup`](https://github.com/bloomberg/go-testgroup) and\n[`testify/suite`](https://github.com/stretchr/testify/blob/master/README.md#suite-package).\n\n### dkt\n\nDocket includes a command-line utility named [`dkt`](dkt) that helps you run\n`docker-compose` commands on your files.\n\n## Examples\n\nYou can learn how to use docket by following the examples in the `testdata`\ndirectory.\n\n| `testdata/`                                                                    | Description                                    |\n| :----------------------------------------------------------------------------- | :--------------------------------------------- |\n| \u0026nbsp;\u0026nbsp;\u0026nbsp; [`01_hello`](testdata/01_hello)                             | Read an environment variable.                  |\n| \u0026nbsp;\u0026nbsp;\u0026nbsp; [`02_ping-redis`](testdata/02_ping-redis)                   | Test a function to ping a Redis server         |\n| \u0026nbsp;\u0026nbsp;\u0026nbsp; [`03_redispinger-service`](testdata/03_redispinger-service) | Test an HTTP service that pings a Redis server |\n| \u0026nbsp;\u0026nbsp;\u0026nbsp; [`98_testgroup`](testdata/98_testgroup)                     | Use docket with a test group.                  |\n| \u0026nbsp;\u0026nbsp;\u0026nbsp; [`99_testify-suite`](testdata/99_testify-suite)             | Use docket with a testify suite.               |\n\n## Help\n\nIf your tests import docket, you can run `go test -help-docket` to get help.\n\n### DOCKET_MODE\n\nTo enable docket, you'll need to set `DOCKET_MODE` in your environment when you\nrun `go test`.\n\nFor a tutorial on docket modes, see the\n[`02_ping-redis`](testdata/02_ping-redis) example.\n\nWhen you set `DOCKET_MODE=awesome`, docket will look for YAML files (files with\na `.yaml` or `.yml` extension) with names like\n\n- `docket.yaml` (matches any mode)\n- `docket.awesome.yaml`\n- `docket.awesome.*.yaml`\n\nFor more detailed examples, refer to the\n[tests](internal/compose/files_test.go).\n\n### Optional\n\n#### DOCKET_DOWN\n\n_Default:_ `false`\n\nIf `DOCKET_DOWN` is non-empty, docket will run `docker-compose down` at the end\nof each `docket.Run()`.\n\n#### DOCKET_PULL\n\n_Default:_ `false`\n\nIf `DOCKET_PULL` is non-empty, docket will run `docker-compose pull` at the\nstart of each `docket.Run()`.\n\n#### DOCKET_PULL_OPTS\n\n_Default:_ none\n\nIf `DOCKET_PULL_OPTS` is non-empty, docket will add its contents to the\ninvocation of the `docker-compose pull` command.\n\nFor example, to avoid pulling images in parallel, you can set\n`DOCKET_PULL_OPTS=--no-parallel` so that docket will run\n`docker-compose pull --no-parallel`.\n\nSetting `DOCKET_PULL_OPTS` has no effect if you do not set `DOCKET_PULL=1`.\n\n### Using a custom file prefix\n\nIf you need to keep multiple independent docket configurations in the same\ndirectory, you can call `docket.RunPrefix()` to have docket look for YAML files\nstarting with your custom prefix instead of the default prefix (`\"docket\"`).\n\nFor more detailed examples, refer to the\n[tests](internal/compose/files_test.go).\n\n## Testing Docket\n\nDocket has unit tests as well as integration tests that run the examples in the\n`testdata` directory.\n\n### Module-aware mode and GOPATH-mode\n\nDocket works in both `GOPATH` mode and module-aware mode, but its tests only run\nin one mode at a time. As of Go 1.13, if you haven't overridden `GO111MODULE`,\nGo will run in module-aware mode.\n\nTo run tests (or other tools) in `GOPATH` mode, you can use the\n[`run_in_temp_gopath_with_go_modules_disabled`](run_in_temp_gopath_with_go_modules_disabled)\nhelper script, which creates a temporary `GOPATH` at `.TEMP_GOPATH`, sets\n`GO111MODULE=off`, and runs the script's arguments inside the corresponding\ndocket package directory (`.TEMP_GOPATH/src/github.com/bloomberg/docket`).\n\n```sh\n# module-aware mode, by default\ngo test ./...\n\n# GOPATH mode (GO111MODULE=off)\n./run_in_temp_gopath_with_go_modules_disabled go test ./...\n```\n\n### Coverage\n\nTo gather coverage, use `-coverprofile` for the main in-process tests and set\n`COVERAGE_DIR` to gather coverage from the `go test` child processes. Then, use\n[`gocovmerge`](https://github.com/wadey/gocovmerge) to merge the coverage data.\n\n```sh\nCOVERAGE_DIR=COVERAGE go test -v -coverprofile=coverage.root ./... \u0026\u0026 \\\ngo tool cover -func \u003c(gocovmerge coverage.root $(find COVERAGE -type f))\n```\n\nNote: If you're gathering coverage using\n`run_in_temp_gopath_with_go_modules_disabled`, the `COVERAGE_DIR` will be\nrelative to the temporary docket directory inside `.TEMP_GOPATH` (see above)\nunless you give an absolute path as your `COVERAGE_DIR`.\n\n## Code of Conduct\n\nDocket has adopted a\n[Code of Conduct](https://github.com/bloomberg/.github/blob/master/CODE_OF_CONDUCT.md).\nIf you have any concerns about the Code or behavior which you have experienced\nin the project, please contact us at opensource@bloomberg.net.\n\n## Contributing\n\nWe'd love to hear from you, whether you've found a bug or want to suggest how\ndocket could be better. Please\n[open an issue](https://github.com/bloomberg/docket/issues/new/choose) and let\nus know what you think!\n\nIf you want to contribute code to the docket project, please be sure to read our\n[contribution guidelines](https://github.com/bloomberg/.github/blob/master/CONTRIBUTING.md).\n**We highly recommend opening an issue before you start working on your pull\nrequest.** We'd like to talk with you about the change you want to make _before_\nyou start making it. :smile:\n\n## License\n\nDocket is licensed under the [Apache License, Version 2.0](LICENSE).\n\n## Security Policy\n\nIf you believe you have identified a security vulnerability in this project,\nplease send an email to the project team at opensource@bloomberg.net detailing\nthe suspected issue and any methods you've found to reproduce it.\n\nPlease do _not_ open an issue in the GitHub repository, as we'd prefer to keep\nvulnerability reports private until we've had an opportunity to review and\naddress them. Thank you.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbloomberg%2Fdocket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbloomberg%2Fdocket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbloomberg%2Fdocket/lists"}