From 31bee62f5b4bf1f6ac5382d862ac7cfc23a8d24c Mon Sep 17 00:00:00 2001 From: Armon Dadgar Date: Fri, 3 Jul 2015 17:48:02 -0700 Subject: [PATCH] nomad: adding basic test for schema --- nomad/schema.go | 2 +- nomad/schema_test.go | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 nomad/schema_test.go diff --git a/nomad/schema.go b/nomad/schema.go index 3ffda5c87..9db6dee25 100644 --- a/nomad/schema.go +++ b/nomad/schema.go @@ -181,7 +181,7 @@ func allocTableSchema() *memdb.TableSchema { Indexes: map[string]*memdb.IndexSchema{ // Primary index is a UUID "id": &memdb.IndexSchema{ - Name: "ID", + Name: "id", AllowMissing: false, Unique: true, Indexer: &memdb.UUIDFieldIndex{ diff --git a/nomad/schema_test.go b/nomad/schema_test.go new file mode 100644 index 000000000..79fcab693 --- /dev/null +++ b/nomad/schema_test.go @@ -0,0 +1,15 @@ +package nomad + +import ( + "testing" + + "github.com/hashicorp/go-memdb" +) + +func TestStateStoreSchema(t *testing.T) { + schema := stateStoreSchema() + _, err := memdb.NewMemDB(schema) + if err != nil { + t.Fatalf("err: %v", err) + } +}