scheduler: adding tests

This commit is contained in:
Armon Dadgar 2015-08-13 18:51:08 -07:00
parent d4e3270757
commit be4cd4d8a4
2 changed files with 55 additions and 0 deletions

View file

@ -7,6 +7,14 @@ import (
"github.com/hashicorp/nomad/nomad/structs" "github.com/hashicorp/nomad/nomad/structs"
) )
func TestServiceSched_JobRegister(t *testing.T) {
// TODO
}
func TestServiceSched_JobModify(t *testing.T) {
// TODO
}
func TestServiceSched_JobDeregister(t *testing.T) { func TestServiceSched_JobDeregister(t *testing.T) {
h := NewHarness(t) h := NewHarness(t)
@ -56,3 +64,7 @@ func TestServiceSched_JobDeregister(t *testing.T) {
t.Fatalf("bad: %#v", out) t.Fatalf("bad: %#v", out)
} }
} }
func TestServiceSched_NodeDrain(t *testing.T) {
// TODO
}

43
scheduler/stack_test.go Normal file
View file

@ -0,0 +1,43 @@
package scheduler
import (
"reflect"
"testing"
"github.com/hashicorp/nomad/nomad/mock"
)
func TestServiceStack_SetJob(t *testing.T) {
_, ctx := testContext(t)
stack := NewServiceStack(ctx, nil)
job := mock.Job()
stack.SetJob(job)
if stack.binPack.priority != job.Priority {
t.Fatalf("bad")
}
if !reflect.DeepEqual(stack.jobConstraint.constraints, job.Constraints) {
t.Fatalf("bad")
}
}
func TestServiceStack_Select_Size(t *testing.T) {
// TODO
}
func TestServiceStack_Select_MetricsReset(t *testing.T) {
// TODO
}
func TestServiceStack_Select_DriverFilter(t *testing.T) {
// TODO
}
func TestServiceStack_Select_ConstraintFilter(t *testing.T) {
// TODO
}
func TestServiceStack_Select_BinPack_Overflow(t *testing.T) {
// TODO
}