Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.

Commit 1f3daf1

Browse files
authored
Merge pull request #1 from AtomicJar/first-test-go
Add first-test-go
2 parents 6bd5024 + e230bbf commit 1f3daf1

File tree

5 files changed

+1118
-2
lines changed

5 files changed

+1118
-2
lines changed

README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@
22
This repository contains various example applications & tests to show Testcontainers Cloud:
33

44
* [First test with Testcontainers Cloud](https://github.com/AtomicJar/testcontainers-cloud-samples/tree/main/first-test)
5-
6-
5+
* [First test with Testcontainers Cloud with Golang](https://github.com/AtomicJar/testcontainers-cloud-samples/tree/main/first-test-go)

first-test-go/README.md

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# First Test with Golang
2+
This is an example repository with a simple test for demonstrating [Testcontainers Cloud](https://testcontainers.cloud).
3+
4+
Clone the repository:
5+
```bash
6+
git clone https://github.com/atomicjar/testcontainers-cloud-samples.git
7+
8+
cd testcontainers-cloud-samples/first-test-go
9+
```
10+
11+
Install the Golang dependencies:
12+
```
13+
go get
14+
```
15+
16+
Run the tests:
17+
```bash
18+
go test . -v
19+
```
20+
21+
If the test succeeds, you should see logs from `testcontainers` and the created container:
22+
```bash
23+
=== RUN TestWithRedis
24+
2022/04/19 15:40:36 Starting container id: 396fd04ae829 image: docker.io/testcontainers/ryuk:0.3.3
25+
2022/04/19 15:40:37 Waiting for container id 396fd04ae829 image: docker.io/testcontainers/ryuk:0.3.3
26+
2022/04/19 15:40:37 Container is ready id: 396fd04ae829 image: docker.io/testcontainers/ryuk:0.3.3
27+
2022/04/19 15:40:37 Starting container id: 37b6361734ff image: redis:latest
28+
2022/04/19 15:40:37 Waiting for container id 37b6361734ff image: redis:latest
29+
2022/04/19 15:40:38 Container is ready id: 37b6361734ff image: redis:latest
30+
main_test.go:40: M1:C 19 Apr 2022 13:40:38.036 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
31+
n1:C 19 Apr 2022 13:40:38.036 # Redis version=6.2.6, bits=64, commit=00000000, modified=0, pid=1, just started
32+
n1:C 19 Apr 2022 13:40:38.036 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
33+
D1:M 19 Apr 2022 13:40:38.037 * monotonic clock: POSIX clock_gettime
34+
C1:M 19 Apr 2022 13:40:38.038 * Running mode=standalone, port=6379.
35+
21:M 19 Apr 2022 13:40:38.038 # Server initialized
36+
1:M 19 Apr 2022 13:40:38.038 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
37+
;1:M 19 Apr 2022 13:40:38.038 * Ready to accept connections
38+
--- PASS: TestWithRedis (1.97s)
39+
PASS
40+
ok github.com/AtomicJar/testcontainers-cloud-samples 2.289s
41+
```

first-test-go/go.mod

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
module github.com/AtomicJar/testcontainers-cloud-samples
2+
3+
go 1.17
4+
5+
require github.com/testcontainers/testcontainers-go v0.13.0
6+
7+
require (
8+
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
9+
github.com/Microsoft/go-winio v0.4.17 // indirect
10+
github.com/Microsoft/hcsshim v0.8.23 // indirect
11+
github.com/cenkalti/backoff/v4 v4.1.2 // indirect
12+
github.com/containerd/cgroups v1.0.1 // indirect
13+
github.com/containerd/containerd v1.5.9 // indirect
14+
github.com/docker/distribution v2.7.1+incompatible // indirect
15+
github.com/docker/docker v20.10.11+incompatible // indirect
16+
github.com/docker/go-connections v0.4.0 // indirect
17+
github.com/docker/go-units v0.4.0 // indirect
18+
github.com/gogo/protobuf v1.3.2 // indirect
19+
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
20+
github.com/golang/protobuf v1.5.2 // indirect
21+
github.com/google/uuid v1.3.0 // indirect
22+
github.com/magiconair/properties v1.8.5 // indirect
23+
github.com/moby/sys/mount v0.2.0 // indirect
24+
github.com/moby/sys/mountinfo v0.5.0 // indirect
25+
github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 // indirect
26+
github.com/morikuni/aec v0.0.0-20170113033406-39771216ff4c // indirect
27+
github.com/opencontainers/go-digest v1.0.0 // indirect
28+
github.com/opencontainers/image-spec v1.0.2 // indirect
29+
github.com/opencontainers/runc v1.0.2 // indirect
30+
github.com/pkg/errors v0.9.1 // indirect
31+
github.com/sirupsen/logrus v1.8.1 // indirect
32+
go.opencensus.io v0.22.3 // indirect
33+
golang.org/x/net v0.0.0-20211108170745-6635138e15ea // indirect
34+
golang.org/x/sys v0.0.0-20211124211545-fe61309f8881 // indirect
35+
google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a // indirect
36+
google.golang.org/grpc v1.33.2 // indirect
37+
google.golang.org/protobuf v1.27.1 // indirect
38+
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
39+
)

0 commit comments

Comments
 (0)