From fcfc605f77d8db3b46f0f097a979a6a5cbab9fa8 Mon Sep 17 00:00:00 2001 From: saji Date: Mon, 3 Jul 2023 13:56:42 -0500 Subject: [PATCH] fix db test compile issue --- .gitignore | 1 + internal/db/db_test.go | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) 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) {