Commit 44dc0de7 authored by Matt Butcher's avatar Matt Butcher

fix(server): add tests for in-memory storage

This adds a higher level set of tests for storage.
parent fa6a33c3
......@@ -3,10 +3,15 @@ package environment
import (
"github.com/deis/tiller/pkg/engine"
"github.com/deis/tiller/pkg/hapi"
"github.com/deis/tiller/pkg/storage"
)
// GoTplEngine is the name of the Go template engine, as registered in the EngineYard.
const GoTplEngine = "gotpl"
// DefaultEngine points to the engine that the EngineYard should treat as the
// default. A chart that does not specify an engine may be run through the
// default engine.
var DefaultEngine = GoTplEngine
// EngineYard maps engine names to engine implementations.
......@@ -93,8 +98,13 @@ type Environment struct {
// New returns an environment initialized with the defaults.
func New() *Environment {
e := engine.New()
var ey EngineYard = map[string]Engine{GoTplEngine: e}
var ey EngineYard = map[string]Engine{
// Currently, the only template engine we support is the GoTpl one. But
// we can easily add some here.
GoTplEngine: e,
}
return &Environment{
EngineYard: ey,
Releases: storage.NewMemory(),
}
}
......@@ -5,11 +5,13 @@ import (
"github.com/deis/tiller/cmd/tiller/environment"
"github.com/deis/tiller/pkg/engine"
"github.com/deis/tiller/pkg/storage"
)
// These are canary tests to make sure that the default server actually
// fulfills its requirements.
var _ environment.Engine = &engine.Engine{}
var _ environment.ReleaseStorage = storage.NewMemory()
func TestNewServer(t *testing.T) {
defer func() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment