Home

Awesome

Libkermit

GoDoc Build Status Go Report Card License codecov

When green is all there is to be<br/> It could make you wonder why<br/> But why wonder why wonder<br/> I am green, and it'll do fine<br/> It's beautiful,<br/> and I think it's what I want to be.<br/> -- 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 :

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