Skip to content

andylongstaffe/go-mysql-test-container

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-mysql-test-container

pkg report coverage build

Golang MySQL testcontainer that makes integration testing MySQL a breeze

Usage

Execute

go get github.com/andylongstaffe/go-mysql-test-container

Code

package main

import (
	"testing"

	"github.com/andylongstaffe/go-mysql-test-container/mysqltestcontainer"
)

func Test(t *testing.T) {
	mySql, _ := mysqltestcontainer.Create("test")
	db := mySql.GetDb()
	err := db.Ping()
	if err != nil {
		log.L.Errorln(err.Error())
	}
}

Development

  1. Make sure Docker is installed on your local machine

    docker --version
    
  2. Make sure you can run Docker locally

    docker run hello-world
    
  3. Run the test

    ./gotest.sh
    

About

Golang MySQL testcontainer package

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 99.6%
  • Shell 0.4%