mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
scheduler: adding tests
This commit is contained in:
@@ -7,6 +7,14 @@ import (
|
||||
"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) {
|
||||
h := NewHarness(t)
|
||||
|
||||
@@ -56,3 +64,7 @@ func TestServiceSched_JobDeregister(t *testing.T) {
|
||||
t.Fatalf("bad: %#v", out)
|
||||
}
|
||||
}
|
||||
|
||||
func TestServiceSched_NodeDrain(t *testing.T) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
43
scheduler/stack_test.go
Normal file
43
scheduler/stack_test.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user