From 7342218df5b1a626f44bbc01121f6582164ce635 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Wed, 21 Dec 2022 10:45:55 +0100 Subject: [PATCH 01/10] docs: move OSS to license section --- docs/index.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/index.md b/docs/index.md index a188e17014..8d8518a957 100644 --- a/docs/index.md +++ b/docs/index.md @@ -18,9 +18,6 @@ _Testcontainers for Go_ is a Go package that makes it simple to create and clean automated integration/smoke tests. The clean, easy-to-use API enables developers to programmatically define containers that should be run as part of a test and clean up those resources when the test is done. -This project is opensource and you can have a look at the code on -[GitHub](https://github.com/testcontainers/testcontainers-go). - ## GoDoc Inline documentation and docs where the code live is crucial for us. Go has nice support for them and we provide @@ -34,7 +31,8 @@ examples as well. Check it out at ## License -See [LICENSE](https://github.com/testcontainers/testcontainers-go/blob/main/LICENSE). +This project is opensource and you can have a look at the code on +[GitHub](https://github.com/testcontainers/testcontainers-go). See [LICENSE](https://github.com/testcontainers/testcontainers-go/blob/main/LICENSE). ## Copyright From b5bb39cfa2040dda3cbb651a26c4223737bce198 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Wed, 21 Dec 2022 10:47:52 +0100 Subject: [PATCH 02/10] docs: move quickstart page to root dir --- docs/{quickstart/gotest.md => quickstart.md} | 0 mkdocs.yml | 3 +-- 2 files changed, 1 insertion(+), 2 deletions(-) rename docs/{quickstart/gotest.md => quickstart.md} (100%) diff --git a/docs/quickstart/gotest.md b/docs/quickstart.md similarity index 100% rename from docs/quickstart/gotest.md rename to docs/quickstart.md diff --git a/mkdocs.yml b/mkdocs.yml index db3a255bed..4c6f5a9f60 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -26,8 +26,7 @@ markdown_extensions: - pymdownx.snippets nav: - Home: index.md - - Quickstart: - - quickstart/gotest.md + - Quickstart: quickstart.md - Features: - features/creating_container.md - features/networking.md From fb5b2f30b881497da2cd106e44fbb96ff89ef4c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Wed, 21 Dec 2022 10:48:10 +0100 Subject: [PATCH 03/10] docs: link quickstart in the index --- docs/index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/index.md b/docs/index.md index 8d8518a957..b2205f4bf9 100644 --- a/docs/index.md +++ b/docs/index.md @@ -18,6 +18,8 @@ _Testcontainers for Go_ is a Go package that makes it simple to create and clean automated integration/smoke tests. The clean, easy-to-use API enables developers to programmatically define containers that should be run as part of a test and clean up those resources when the test is done. +To start using _Testcontainers for Go_ please read our [quickstart guide](./quickstart.md). + ## GoDoc Inline documentation and docs where the code live is crucial for us. Go has nice support for them and we provide From bc7645255e159091477ca36391065c356b6a9ef2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Wed, 21 Dec 2022 10:55:30 +0100 Subject: [PATCH 04/10] docs: tidy up quickstart guide --- docs/quickstart.md | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/docs/quickstart.md b/docs/quickstart.md index 843548bf15..10bb181fed 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -3,15 +3,11 @@ _Testcontainers for Go_ plays well with the native `go test` framework. The ideal use case is for integration or end to end tests. It helps you to spin up and manage the dependencies life cycle via Docker. -Docker has to be available for this library to work. +## 1. System requirements -## 1. Install +Please the [system requirements](./system_requirements/) page before you start. -We use [gomod](https://blog.golang.org/using-go-modules) and you can get it installed via: - -``` -go get github.com/testcontainers/testcontainers-go -``` +## 2. Install _Testcontainers for Go_ !!!warning @@ -38,7 +34,13 @@ go get github.com/testcontainers/testcontainers-go ) ``` -## 2. Spin up Redis +We use [gomod](https://blog.golang.org/using-go-modules) and you can get it installed via: + +``` +go get github.com/testcontainers/testcontainers-go +``` + +## 3. Spin up Redis ```go import ( @@ -105,7 +107,7 @@ terminated function: `defer redisC.Terminate(ctx)`. Look at [features/garbage_collector](/features/garbage_collector/) to know another way to clean up resources. -## 3. Make your code to talk with the container +## 4. Make your code to talk with the container This is just an example, but usually Go applications that rely on Redis are using the [redis-go](https://github.com/go-redis/redis) client. This code gets @@ -133,6 +135,6 @@ We expose only one port, so the `Endpoint` does not need a second argument set. In this case it returns: `localhost:`. -## 3. Run the test +## 5. Run the test You can run the test via `go test ./...` From a68e0ad8a58075fb45f1eb3dbf366230e6dbbee2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Wed, 21 Dec 2022 11:02:14 +0100 Subject: [PATCH 05/10] docs: link Redis example in the quickstart guide --- docs/quickstart.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/quickstart.md b/docs/quickstart.md index 10bb181fed..026f5956a5 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -138,3 +138,7 @@ In this case it returns: `localhost:`. ## 5. Run the test You can run the test via `go test ./...` + +## 6. Want to go deeper with Redis? + +You can find a more elaborated Redis example in our examples section. Please check it out [here](./examples/redis.md). From 5d505105288e60142e0124a218aaca2dd0cab2c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Wed, 21 Dec 2022 11:04:33 +0100 Subject: [PATCH 06/10] docs: rephrase link to docs in README --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 5f0b59641e..bf154c6f42 100644 --- a/README.md +++ b/README.md @@ -6,5 +6,4 @@ _Testcontainers for Go_ is a Go package that makes it simple to create and clean automated integration/smoke tests. The clean, easy-to-use API enables developers to programmatically define containers that should be run as part of a test and clean up those resources when the test is done. -You can find more information about _Testcontainers for Go_ in the [./docs](./docs) directory, which is rendered at -[golang.testcontainers.org](https://golang.testcontainers.org). +You can find more information about _Testcontainers for Go_ at [golang.testcontainers.org](https://golang.testcontainers.org), which is rendered from the [./docs](./docs) directory. From 5067276527f54c40a46dd3ec844ef5016d7690f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Wed, 21 Dec 2022 11:07:16 +0100 Subject: [PATCH 07/10] docs: link to quickstart in the main README --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index bf154c6f42..3c2d6aa2f6 100644 --- a/README.md +++ b/README.md @@ -7,3 +7,7 @@ automated integration/smoke tests. The clean, easy-to-use API enables developers that should be run as part of a test and clean up those resources when the test is done. You can find more information about _Testcontainers for Go_ at [golang.testcontainers.org](https://golang.testcontainers.org), which is rendered from the [./docs](./docs) directory. + +## Using _Testcontainers for Go_ + +Please visit [the quickstart guide](https://golang.testcontainers.org/quickstart) to understand how to add the dependency to your Go project. From f3169cdcb158ac6b824da33152a8edf85a8f0d72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Wed, 21 Dec 2022 11:10:02 +0100 Subject: [PATCH 08/10] fix: proper link --- docs/quickstart.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/quickstart.md b/docs/quickstart.md index 026f5956a5..2dfe9f3bb9 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -5,7 +5,7 @@ up and manage the dependencies life cycle via Docker. ## 1. System requirements -Please the [system requirements](./system_requirements/) page before you start. +Please the [system requirements](../system_requirements/) page before you start. ## 2. Install _Testcontainers for Go_ From b6be1e934eeba25b5226ba1492d59dd1a33b1bc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Wed, 21 Dec 2022 12:57:51 +0100 Subject: [PATCH 09/10] fix: update mkdocs struct --- examples/mkdocs.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/mkdocs.go b/examples/mkdocs.go index b550f57460..57a4b90d27 100644 --- a/examples/mkdocs.go +++ b/examples/mkdocs.go @@ -29,7 +29,7 @@ type MkDocsConfig struct { MarkdownExtensions []interface{} `yaml:"markdown_extensions"` Nav []struct { Home string `yaml:"Home,omitempty"` - Quickstart []string `yaml:"Quickstart,omitempty"` + Quickstart string `yaml:"Quickstart,omitempty"` Features []interface{} `yaml:"Features,omitempty"` Examples []string `yaml:"Examples,omitempty"` SystemRequirements []string `yaml:"System Requirements,omitempty"` From a0754557ee63c8fce00695b7a0c16d6198330ef9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Wed, 21 Dec 2022 13:46:06 +0100 Subject: [PATCH 10/10] fix: typo --- docs/quickstart.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/quickstart.md b/docs/quickstart.md index 2dfe9f3bb9..706ae71d48 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -5,7 +5,7 @@ up and manage the dependencies life cycle via Docker. ## 1. System requirements -Please the [system requirements](../system_requirements/) page before you start. +Please read the [system requirements](../system_requirements/) page before you start. ## 2. Install _Testcontainers for Go_