moemoe89 / integration-test-golang

🦴 Integration Test using Dockertest for my Medium story material

Home Page:https://medium.com/easyread/59ed3b35240e

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status codecov Go Report Card

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

$ mkdir -p src/github.com/moemoe89
$ cd src/github.com/moemoe89
$ git clone <url>
$ mv <cloned directory> integration-test-golang

How to Run Test

$ go test ./...

or

$ make test

License

MIT

About

🦴 Integration Test using Dockertest for my Medium story material

https://medium.com/easyread/59ed3b35240e

License:MIT License


Languages

Language:Go 99.1%Language:Makefile 0.9%