{"repo":"dhui/dktest","free":true,"listed":false,"github":"https://github.com/dhui/dktest","clone":"git clone https://github.com/dhui/dktest.git","description":"Integration testing in Go with Docker","language":"Go","stars":115,"topics":["golang","docker","testing-tools","integration-testing","go"],"license":"Apache-2.0","category":"deployment-docker-iac","readme_excerpt":"dktest dktest is short for d oc k er test . dktest makes it stupidly easy to write integration tests in Go using Docker. Pulling images, starting containers, and cleaning up (even if your tests panic) is handled for you automatically! API Run() is the workhorse Example Usage For more examples, see the docs. Debugging tests Running go test with the -v option will display the container lifecycle log statements along with the container ID. Short lived tests/containers Run go test with the -v option and specify the LogStdout and/or LogStderr Options to see the container's logs. Interactive tests/containers Run go test with the -v option to get the container ID and check the container's logs with docker logs -f $CONTAINER ID . Cleaning up dangling containers In the unlikely scenario where dktest leaves dangling containers, you can find and removing them by using the dktest label: Roadmap [x] Support multiple ports in ContainerInfo [ ] Use non-default network [ ] Add more Options [x] Volume mounts [ ] Network config [ ] Support testing against multiple containers. It can be faked for now by nested/recursive Run() calls but that serializes the containers' startup time. Comparisons Last updated: 2020/01/03 dockertest Why dktest is better Uses the official Docker SDK docker/docker (aka moby/moby) uses import path checking, so needs to be imported as github.com/docker/docker Designed to run in the Go testing environment Smaller API surface Running Docker containers are automatically cl","default_branch":null,"files":null,"tree":[],"storefront":"/r/dhui","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/dhui/dktest/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}