go-mysql-test-container

module
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 8, 2022 License: MIT

README

go-mysql-test-container

pkg report coverage build

Golang MySQL testcontainer that makes integration testing MySQL a breeze

Usage

Execute

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

Code

package main

import (
	"testing"

	"github.com/arikama/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
    

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL