Skip to content

Commit

Permalink
Merge branch 'master' into pj/host-announce-window
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisSchinnerl committed Oct 17, 2023
2 parents 4d0ea10 + fe8b497 commit 7716bea
Show file tree
Hide file tree
Showing 8 changed files with 604 additions and 645 deletions.
16 changes: 7 additions & 9 deletions stores/autopilot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@ import (
)

func TestAutopilotStore(t *testing.T) {
db, _, _, err := newTestSQLStore(t.TempDir())
if err != nil {
t.Fatal(err)
}
ss := newTestSQLStore(t, defaultTestSQLStoreConfig)
defer ss.Close()

// assert we have no autopilots
autopilots, err := db.Autopilots(context.Background())
autopilots, err := ss.Autopilots(context.Background())
if err != nil {
t.Fatal(err)
} else if len(autopilots) != 0 {
Expand Down Expand Up @@ -48,13 +46,13 @@ func TestAutopilotStore(t *testing.T) {
}

// add an autopilot with that config
err = db.UpdateAutopilot(context.Background(), api.Autopilot{ID: t.Name(), Config: cfg})
err = ss.UpdateAutopilot(context.Background(), api.Autopilot{ID: t.Name(), Config: cfg})
if err != nil {
t.Fatal(err)
}

// assert we have one autopilot
autopilots, err = db.Autopilots(context.Background())
autopilots, err = ss.Autopilots(context.Background())
if err != nil {
t.Fatal(err)
} else if len(autopilots) != 1 {
Expand All @@ -73,13 +71,13 @@ func TestAutopilotStore(t *testing.T) {
// update the autopilot and set a new current period and update the config
autopilot.CurrentPeriod = 1
autopilot.Config.Contracts.Amount = 99
err = db.UpdateAutopilot(context.Background(), autopilot)
err = ss.UpdateAutopilot(context.Background(), autopilot)
if err != nil {
t.Fatal(err)
}

// fetch it and assert it was updated
updated, err := db.Autopilot(context.Background(), t.Name())
updated, err := ss.Autopilot(context.Background(), t.Name())
if err != nil {
t.Fatal(err)
}
Expand Down
Loading

0 comments on commit 7716bea

Please sign in to comment.