Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(#25) Create very basic implementation of Local Docker Compose #97

Merged
merged 33 commits into from
Apr 20, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
1276796
(#25) Add utility to generate random strings
mdelapenya Sep 11, 2019
790421c
(#25) Create very basic implementation of Local Docker Compose implem…
mdelapenya Sep 11, 2019
0ed0ea9
(#25) Add a function to "down" the compose
mdelapenya Sep 11, 2019
fe96445
(#25) Make ExecError public
mdelapenya Sep 11, 2019
b8299a7
(#25) Use lowercase for container/service identifiers
mdelapenya Sep 18, 2019
06ada3c
(#25) Fix compose down
mdelapenya Sep 18, 2019
a320e66
(#25) Add a test verifying that the container receives the env vars
mdelapenya Sep 18, 2019
1badb29
(#25) Extract assertion of container env to a function
mdelapenya Sep 18, 2019
47362c1
(#25) Extract default environment generation to a function
mdelapenya Sep 18, 2019
d9e1579
(#25) Extract compose execution to a function
mdelapenya Sep 18, 2019
2604294
(#25) Support passing multiple docker-compose files
mdelapenya Sep 18, 2019
4807a91
(#25) Support checking for absent env vars in tests
mdelapenya Sep 18, 2019
80f3758
(#25) Make tests more readable
mdelapenya Sep 18, 2019
7614627
(#25) Remove unneeded log
mdelapenya Oct 29, 2019
28b4ce4
(#25) Use Google's UUID for generating compose's identifier
mdelapenya Nov 18, 2019
866cd2a
(#25) Add local compose to the docs
mdelapenya Nov 18, 2019
26eee98
(#25) Rename simple compose test resource
mdelapenya Nov 18, 2019
8096d05
(#25) Add a test with a more complex scenario
mdelapenya Nov 18, 2019
efa9db2
(#25) Fix path in test
mdelapenya Nov 18, 2019
3c26102
(#25) Add info about the command and the arguments when compose fails
mdelapenya Nov 19, 2019
a07447a
(#25) Create defer functions the soonest
mdelapenya Nov 20, 2019
a3e1f0b
(#25) Add comments and Go Examples for docs
mdelapenya Nov 22, 2019
ef1c203
(#25) Do not override ports on Travis CI
mdelapenya Nov 26, 2019
71af051
(#25) Support getting the services from the compose files
mdelapenya Sep 30, 2019
956a03b
(#25) Execute go mod tidy
mdelapenya Nov 26, 2019
446944d
(#25) Provide more information when failing a Compose test
mdelapenya Nov 26, 2019
b587960
(#25) Extract array population on exec errors
mdelapenya Nov 26, 2019
661033b
(#25) Enhance exec error
mdelapenya Nov 26, 2019
88efbd0
(#25) Optimise reading for docker-compose output
mdelapenya Nov 27, 2019
9570dd9
(#25) Do not assert the environment variables in the simple test
mdelapenya Nov 27, 2019
7182ddc
(#25) Fix tests reading environment variables from the compose file
mdelapenya Dec 26, 2019
6830723
(#25) Add troubleshooting Travis guide
mdelapenya Dec 26, 2019
03c0820
(#25) Run go mod tidy
mdelapenya Apr 16, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
(#25) Add troubleshooting Travis guide
  • Loading branch information
mdelapenya committed Apr 16, 2020
commit 6830723986b48075754173d0ae1ff0c1be07825c
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,3 +203,26 @@ if err != nil {
}
return nil
```

## Troubleshooting Travis

If you want to reproduce a Travis build locally, please follow this instructions to spin up a Travis build agent locally:
```shell
export BUILDID="build-testcontainers"
export INSTANCE="travisci/ci-sardonyx:packer-1564753982-0c06deb6"
docker run --name $BUILDID -w /root/go/src/github.com/testcontainers/testcontainers-go -v /Users/mdelapenya/sourcecode/src/github.com/mdelapenya/testcontainers-go:/root/go/src/github.com/testcontainers/testcontainers-go -v /var/run/docker.sock:/var/run/docker.sock -dit $INSTANCE /sbin/init
```

Once the container has been created, enter it (`docker exec -ti $BUILDID bash`) and reproduce Travis steps:

```shell
eval "$(gimme 1.11.4)"
export GO111MODULE=on
export GOPATH="/root/go"
export PATH="$GOPATH/bin:$PATH"
go get gotest.tools/gotestsum
go mod tidy
go fmt ./...
go vet ./...
gotestsum --format short-verbose ./...
```
7 changes: 3 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,12 @@ require (
github.com/opencontainers/runc v0.1.1 // indirect
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.2.0 // indirect
github.com/stretchr/testify v1.2.2
golang.org/x/sys v0.0.0-20181228144115-9a3f9b0469bb // indirect
github.com/stretchr/testify v1.4.0
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c // indirect
google.golang.org/grpc v1.17.0 // indirect
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
gopkg.in/yaml.v2 v2.2.1
gotest.tools v0.0.0-20181223230014-1083505acf35 // indirect
gopkg.in/yaml.v2 v2.2.8
gotest.tools v0.0.0-20181223230014-1083505acf35
)

replace github.com/docker/docker => github.com/docker/engine v0.0.0-20190717161051-705d9623b7c1
9 changes: 5 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD87
github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA=
github.com/go-playground/validator/v10 v10.2.0 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY=
github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI=
github.com/go-redis/redis v6.15.7+incompatible h1:3skhDh95XQMpnqeqNftPkQD9jL9e5e36z/1SUm6dy1U=
github.com/go-redis/redis v6.15.7+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=
github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs=
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
github.com/go-redis/redis v6.15.6+incompatible h1:H9evprGPLI8+ci7fxQx6WNZHJSb7be8FqJQRhdQZ5Sg=
github.com/go-redis/redis v6.15.6+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=
github.com/go-redis/redis v6.15.7+incompatible h1:3skhDh95XQMpnqeqNftPkQD9jL9e5e36z/1SUm6dy1U=
github.com/go-redis/redis v6.15.7+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=
github.com/go-sql-driver/mysql v1.4.1 h1:g24URVg0OFbNUTx9qqY1IRZ9D9z3iPyi5zKhQZpNwpA=
github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs=
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
github.com/gogo/protobuf v1.2.0 h1:xU6/SpYbvkNYiptHJYEDRseDLvYE7wSqhYYNy0QSUzI=
github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
Expand Down Expand Up @@ -126,6 +126,7 @@ golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181228144115-9a3f9b0469bb/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42 h1:vEOn+mP2zCOVzKckCZy6YsCtDblrpj/w7B9nxGNELpg=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
Expand Down