diff --git a/.gitignore b/.gitignore index c8c3a89..f8b3902 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ go.work /skylabify *.db *.db-journal +/logs/ \ No newline at end of file diff --git a/internal/db/db_test.go b/internal/db/db_test.go index 038cfee..e2fd87a 100644 --- a/internal/db/db_test.go +++ b/internal/db/db_test.go @@ -3,6 +3,7 @@ package db import ( "reflect" "testing" + "time" "github.com/jmoiron/sqlx" "github.com/kschamplin/gotelem/skylab" @@ -10,7 +11,17 @@ import ( // helper func to get a random bus event with random data. func GetRandomBusEvent() skylab.BusEvent { - return + data := skylab.WsrVelocity{ + MotorVelocity: 1.0, + VehicleVelocity: 4.0, + } + ev := skylab.BusEvent{ + Timestamp: time.Now(), + Data: &data, + } + ev.Id, _ = data.CANId() + + return ev } func TestTelemDb(t *testing.T) {