Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

1 Commit

Repository files navigation

testify-tutorial

This repository contains the code for my testify tutorial youtube video series. It shows how to use testify together with mockery to build awesome golang tests.

Description

The tests are written for the calculations package and test the PriceIncreaseCalculator functionality which depends on PriceProvider interface.

Prepare Postgres in Docker

If you want to run integration tests you need to have a running postgres instance. The constants that are being used are the default ones from dockerhub

const (
dbHost="localhost"dbPort=5432dbUser="postgres"dbPassword="mysecretpassword"dbName="postgres"
)

All you need to do is execute the following command and you should be good to go

docker run --name pg-testify -e POSTGRES_PASSWORD=mysecretpassword -p 5432:5432 postgres

Running the tests

# runalltestsgotest ./calculations
# onlyrununittestsgotest ./calculations-runUnitTestSuite-v
# onlyrunintegrationtests
# runningpostgresinstancerequiredgotest ./calculations-runIntTestSuite-v

About

No description, website, or topics provided.

Resources

Stars

22 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages