https://github.com/moemoe89/integration-test-golang
🦴 Integration Test using Dockertest for my Medium story material
https://github.com/moemoe89/integration-test-golang
dockertest dokcer go golang integration-testing mysql postgresql
Last synced: 5 months ago
JSON representation
🦴 Integration Test using Dockertest for my Medium story material
- Host: GitHub
- URL: https://github.com/moemoe89/integration-test-golang
- Owner: moemoe89
- License: mit
- Created: 2020-06-12T14:18:34.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-12-30T07:08:31.000Z (over 4 years ago)
- Last Synced: 2024-06-19T06:54:13.069Z (10 months ago)
- Topics: dockertest, dokcer, go, golang, integration-testing, mysql, postgresql
- Language: Go
- Homepage: https://medium.com/easyread/59ed3b35240e
- Size: 18.6 KB
- Stars: 13
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/moemoe89/integration-test-golang)
[](https://codecov.io/gh/moemoe89/integration-test-golang)
[](https://goreportcard.com/report/github.com/moemoe89/integration-test-golang)# INTEGRATION-TEST-GOLANG #
Example integration test using Dockertest
## Directory structure
Your project directory structure should look like this
```
+ your_gopath/
|
+--+ src/github.com/moemoe89
| |
| +--+ integration-test-golang/
| |
| +--+ main.go
| + repository/
| |
| +--+ repository.go
| |
| +--+ cassandra
| | |
| | +--+ cassandra.go
| | + cassandra_test.go
| +--+ mysql
| | |
| | +--+ mysql.go
| | + mysql_test.go
| |
| +--+ postgres
| |
| +--+ postgres.go
| + postgres_test.go
|
+--+ bin/
| |
| +-- ... executable file
|
+--+ pkg/
|
+-- ... all dependency_library required```
## Setup
* Setup Golang
* Setup Docker
* Under `$GOPATH`, do the following command :
```
$ mkdir -p src/github.com/moemoe89
$ cd src/github.com/moemoe89
$ git clone
$ mv integration-test-golang
```## How to Run Test
```
$ go test ./...
```
or
```
$ make test
```## License
MIT