From e74a332d7de270a3f91c9d69026010df252ee58f Mon Sep 17 00:00:00 2001 From: David Dworken Date: Mon, 13 Jan 2025 12:32:33 -0800 Subject: [PATCH] Add tests --- client/client_test.go | 2 ++ client/testdata/TestExportJson | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/client/client_test.go b/client/client_test.go index c1be42a..9975ea7 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -3454,6 +3454,8 @@ func TestExportJson(t *testing.T) { db := hctx.GetDb(hctx.MakeContext()) e1 := testutils.MakeFakeHistoryEntry("echo synth1") e1.StartTime = time.Unix(1234567, 0) + e1.CustomColumns = make(data.CustomColumns, 1) + e1.CustomColumns[0] = data.CustomColumn{Name: "MyCol", Val: "bar"} require.NoError(t, db.Create(e1).Error) e2 := testutils.MakeFakeHistoryEntry("echo synth2") e1.StartTime = time.Unix(1244567, 0) diff --git a/client/testdata/TestExportJson b/client/testdata/TestExportJson index 9a1f73e..405dbbb 100644 --- a/client/testdata/TestExportJson +++ b/client/testdata/TestExportJson @@ -1,2 +1,2 @@ {"command":"echo synth2","current_working_directory":"/tmp/","custom_columns":null,"end_time":"2022-10-18T04:43:24Z","exit_code":2,"home_directory":"/home/david/","hostname":"localhost","local_username":"david","start_time":"2022-10-18T04:43:21Z"} -{"command":"echo synth1","current_working_directory":"/tmp/","custom_columns":null,"end_time":"2022-10-18T04:43:19Z","exit_code":2,"home_directory":"/home/david/","hostname":"localhost","local_username":"david","start_time":"1970-01-14T22:56:07-08:00"} +{"command":"echo synth1","current_working_directory":"/tmp/","custom_columns":[{"name":"MyCol","value":"bar"}],"end_time":"2022-10-18T04:43:19Z","exit_code":2,"home_directory":"/home/david/","hostname":"localhost","local_username":"david","start_time":"1970-01-14T22:56:07-08:00"}