From 44dc0de71fbb6d414f810d51a1642b86960c461f Mon Sep 17 00:00:00 2001 From: Matt Butcher Date: Wed, 13 Apr 2016 17:12:45 -0600 Subject: [PATCH] fix(server): add tests for in-memory storage This adds a higher level set of tests for storage. --- cmd/tiller/environment/environment.go | 12 +++++++++++- cmd/tiller/server_test.go | 2 ++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/cmd/tiller/environment/environment.go b/cmd/tiller/environment/environment.go index 1845d83c7..a0e2c2990 100644 --- a/cmd/tiller/environment/environment.go +++ b/cmd/tiller/environment/environment.go @@ -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(), } } diff --git a/cmd/tiller/server_test.go b/cmd/tiller/server_test.go index e018530ad..82efbfe6a 100644 --- a/cmd/tiller/server_test.go +++ b/cmd/tiller/server_test.go @@ -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() {