Move jobs raw definition to their own namespace and the cascading fallout

This commit is contained in:
Bel LaPointe
2020-04-24 09:52:34 -06:00
parent d9b10029ae
commit 9bd9c47895
7 changed files with 84 additions and 35 deletions

View File

@@ -5,6 +5,7 @@ import (
"fmt"
"io/ioutil"
"local/firestormy/config"
"local/firestormy/config/ns"
"local/storage"
"os"
"testing"
@@ -215,7 +216,7 @@ func TestSchedulerUpdate(t *testing.T) {
t.Fatal(err)
}
time.Sleep(time.Millisecond * 1500)
j.Raw = "echo 2"
config.Store.Set(j.Name, []byte("echo 2"), ns.JobsRaw...)
j.Title = "title 2"
if err := s.Update(j); err != nil {
t.Fatal(err)
@@ -226,8 +227,6 @@ func TestSchedulerUpdate(t *testing.T) {
t.Fatal(err)
} else if j, err := s.loadJobFromStore(j.Name); err != nil {
t.Fatal(err)
} else if j.Raw != "echo 2" {
t.Error(j.Raw)
} else if j.Title != "title 2" {
t.Error(j.Title)
} else if entry := s.cron.Entry(s.running[j.Name]); entry == s.cron.Entry(-99) {