Giter Site home page Giter Site logo

pombredanne / docker-9 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from libkermit/docker

0.0 0.0 0.0 4.3 MB

๐Ÿณ ๐Ÿธ When Docker meets with integration/acceptance tests to make you see everything in green

License: Apache License 2.0

Makefile 3.47% Go 74.60% Shell 21.93%

docker-9's Introduction

Libkermit

GoDoc Build Status Go Report Card License codecov

When green is all there is to be
It could make you wonder why
But why wonder why wonder
I am green, and it'll do fine
It's beautiful,
and I think it's what I want to be.
-- Kermit the Frog

When Docker meets with integration/acceptance tests to make you see everything in green. Libkermit is a Go(lang) library that aims to ease the writing of integration tests (any non unit tests actually) with the helps of Docker and it's ecosystem (mainly libcompose).

The goals are :

  • Easy docker manipulation, from managing a simple container to boot up a whole stack.
    • create, delete, pause, โ€ฆ containers
    • check for a certain state containers (inspect them)
    • support compose files to allow starting a whole stack
  • Testing suite and functions, in a simple fashion.
  • Works seamlessly with the Go(lang) testing framework.
  • Try to not force any testing framework but also tries to integrate with them (go-check, testify, โ€ฆ).

Note: This is experimental and not even implemented yet. You are on your own right now

Package docker

This package holds functions and structs to ease docker uses.

package yours

import (
    "testing"

    "github.com/libkermit/docker"
)

func TestItMyFriend(t *testing.T) {
    project, err := docker.NewProjectFromEnv()
    if err != nil {
        t.Fatal(err)
    }
    container, err := project.Start("vdemeester/myawesomeimage")
    if err != nil {
        t.Fatal(err)
    }

    // Do your stuff
    // [โ€ฆ]

    // Clean the containers managed by libkermit
    err = project.Clean()
    if err != nil {
        t.Fatal(err)
    }
}

Package docker/testing

This package map the docker package but takes a *testing.T struct on all methods. The idea is to write even less. Let's write the same example as above.

package yours

import (
    "testing"

    docker "github.com/libkermit/docker/testing"
)

func TestItMyFriend(t *testing.T) {
    project := docker.NewProjectFromEnv(t)
    container := project.Start(t, "vdemeester/myawesomeimage")

    // Do your stuff
    // [โ€ฆ]

    // Clean the containers managed by libkermit
    project.Clean(t)
}

Other packages to come

  • suite : functions and structs to setup tests suites.

docker-9's People

Contributors

vdemeester 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.