harmonytask lints
This commit is contained in:
parent
6fd468dfc0
commit
c7aaa16e03
@ -5,7 +5,6 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"sort"
|
||||
"strings"
|
||||
"sync"
|
||||
"testing"
|
||||
"time"
|
||||
@ -82,14 +81,9 @@ func TestHarmonyTasks(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
time.Sleep(3 * time.Second) // do the work. FLAKYNESS RISK HERE.
|
||||
e.GracefullyTerminate(time.Minute)
|
||||
require.Equal(t, t1.WorkCompleted, 2, "wrong amount of work complete: expected 2 got:")
|
||||
expected := []string{"taskResult56", "taskResult73"}
|
||||
sort.Strings(t1.WorkCompleted)
|
||||
got := strings.Join(t1.WorkCompleted, ",")
|
||||
expected := "taskResult56,taskResult73"
|
||||
if got != expected {
|
||||
t.Fatal("Unexpected results! Wanted " + expected + " got " + got)
|
||||
}
|
||||
// TODO test history table looks right.
|
||||
require.Equal(t, len(t1.WorkCompleted), expected, "unexpected results")
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -317,7 +317,8 @@ func (e *TaskEngine) GetHttpHandlers() http.Handler {
|
||||
s := root.PathPrefix("/scheduler")
|
||||
f := s.PathPrefix("/follows")
|
||||
b := s.PathPrefix("/bump")
|
||||
for name, vs := range e.follows {
|
||||
for name, vsTmp := range e.follows {
|
||||
vs := vsTmp
|
||||
f.Path("/" + name + "/{tID}").Methods("GET").HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
tIDString := mux.Vars(r)["tID"]
|
||||
tID, err := strconv.Atoi(tIDString)
|
||||
|
Loading…
Reference in New Issue
Block a user