testcontainers-go:Testcontainers是一个Golang库,提供了一个友好的API以运行Docker容器。 它旨在创建运行时环境以在自动测试期间使用

时间:2021-02-02 08:52:34
【文件属性】:
文件名称:testcontainers-go:Testcontainers是一个Golang库,提供了一个友好的API以运行Docker容器。 它旨在创建运行时环境以在自动测试期间使用
文件大小:123KB
文件格式:ZIP
更新时间:2021-02-02 08:52:34
testing docker golang automation DockerGo 当我从事Zipkin PR时,我发现了一个不错的Java库,称为 。 它通过docker sdk提供了一个简单干净的API,可在您的测试中运行,终止和连接到容器。 我发现自己很容易以编程方式编写运行集成/烟雾测试所需的容器。 所以我开始在Go中移植这个库。 这是一个例子: package main import ( "context" "fmt" "net/http" "testing" "github.com/testcontainers/testcontainers-go" "github.com/testcontainers/testcontainers-go/wait" ) func TestNginxLatestReturn ( t * testing. T ) { ctx := context . Background () req := testcontainers. ContainerRequest { Image : "nginx" , ExposedPorts : [] string { "80/tcp" }, Wa
【文件预览】:
testcontainers-go-master
----.travis.yml(324B)
----reaper.go(4KB)
----docs()
--------css()
--------features()
--------_redirects(112B)
--------_headers(59B)
--------getting_help.md(607B)
--------quickstart()
--------modules.md(1KB)
--------logo.svg(679B)
--------logo.png(51KB)
--------contributing_docs.md(1011B)
--------index.md(871B)
--------favicon.ico(15KB)
--------contributing.md(1KB)
----runtime.txt(4B)
----compose_test.go(5KB)
----testing_test.go(129B)
----container.go(7KB)
----Pipfile(211B)
----.github()
--------ISSUE_TEMPLATE()
--------release-drafter.yml(476B)
--------workflows()
----docker_test.go(32KB)
----compose.go(6KB)
----mkdocs.yml(1015B)
----logconsumer_test.go(3KB)
----LICENSE(1KB)
----Pipfile.lock(9KB)
----container_test.go(8KB)
----network.go(920B)
----requirements.txt(95B)
----wait()
--------testdata()
--------log.go(3KB)
--------http.go(5KB)
--------host_port.go(3KB)
--------log_test.go(2KB)
--------sql.go(2KB)
--------wait.go(556B)
--------errors.go(130B)
--------multi.go(1012B)
--------errors_windows.go(135B)
--------http_test.go(3KB)
----docker.go(23KB)
----logconsumer.go(540B)
----.gitignore(152B)
----go.sum(12KB)
----.dependabot()
--------config.yaml(123B)
----README.md(3KB)
----testresources()
--------docker-compose-override.yml(205B)
--------hello.sh(69B)
--------docker-compose-complex.yml(235B)
--------Dockerfile(21B)
--------echoserver.go(730B)
--------echoserver.Dockerfile(86B)
--------docker-compose-simple.yml(159B)
--------echo.Dockerfile(66B)
----scripts()
--------checks.sh(297B)
----generic.go(2KB)
----testing.go(769B)
----network_test.go(2KB)
----go.mod(2KB)

网友评论