Coder Social home page Coder Social logo

testcontainers-for-go's Introduction

개요

Testcontainers for Go is a Go package that makes it simple to create and clean up container-based dependencies for automated integration/smoke tests. The clean, easy-to-use API enables developers to programmatically define containers that should be run as part of a test and clean up those resources when the test is done.

사용 용도

  • 통합테스트에 사용하기 가장 적합하다
  • E2E 테스트

레퍼런스

패키지: https://pkg.go.dev/github.com/testcontainers/testcontainers-go

사용방법

go test 프레임워크와 병행해서 사용할 수 있다. 도커를 통해서 테스트가 이루어진다

세팅

  1. pkg 설치
go get github.com/testcontainers/testcontainers-go
  1. 테스트 파일 작성

  2. go test ./... -v 명령어 실행(자세히 볼수있음)

ok      testcont        9.674s --1차
ok      testcont        3.800s --2차

컨테이너 띄우고 내리는데 한참 걸리는듯(이미지 없는 경우엔)

testcontainers-for-go's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.