mirror of
https://github.com/ddworken/hishtory.git
synced 2025-02-16 10:31:11 +01:00
Remove a few direct DB insertions to prepare for parallel tests
This commit is contained in:
parent
638912b230
commit
f8a3552ad8
@ -1672,12 +1672,10 @@ func setupTestTui(t testing.TB, onlineStatus OnlineStatus) (shellTester, string,
|
|||||||
// Insert a couple hishtory entries
|
// Insert a couple hishtory entries
|
||||||
db := hctx.GetDb(hctx.MakeContext())
|
db := hctx.GetDb(hctx.MakeContext())
|
||||||
e1 := testutils.MakeFakeHistoryEntry("ls ~/")
|
e1 := testutils.MakeFakeHistoryEntry("ls ~/")
|
||||||
require.NoError(t, db.Create(e1).Error)
|
|
||||||
if onlineStatus == Online {
|
if onlineStatus == Online {
|
||||||
manuallySubmitHistoryEntry(t, userSecret, e1)
|
manuallySubmitHistoryEntry(t, userSecret, e1)
|
||||||
}
|
}
|
||||||
e2 := testutils.MakeFakeHistoryEntry("echo 'aaaaaa bbbb'")
|
e2 := testutils.MakeFakeHistoryEntry("echo 'aaaaaa bbbb'")
|
||||||
require.NoError(t, db.Create(e2).Error)
|
|
||||||
if onlineStatus == Online {
|
if onlineStatus == Online {
|
||||||
manuallySubmitHistoryEntry(t, userSecret, e2)
|
manuallySubmitHistoryEntry(t, userSecret, e2)
|
||||||
}
|
}
|
||||||
@ -1793,14 +1791,11 @@ func testTui_defaultFilter(t *testing.T) {
|
|||||||
// Setup
|
// Setup
|
||||||
defer testutils.BackupAndRestore(t)()
|
defer testutils.BackupAndRestore(t)()
|
||||||
tester, userSecret, _ := setupTestTui(t, Online)
|
tester, userSecret, _ := setupTestTui(t, Online)
|
||||||
db := hctx.GetDb(hctx.MakeContext())
|
|
||||||
e1 := testutils.MakeFakeHistoryEntry("exit 0")
|
e1 := testutils.MakeFakeHistoryEntry("exit 0")
|
||||||
e1.ExitCode = 0
|
e1.ExitCode = 0
|
||||||
require.NoError(t, db.Create(e1).Error)
|
|
||||||
manuallySubmitHistoryEntry(t, userSecret, e1)
|
manuallySubmitHistoryEntry(t, userSecret, e1)
|
||||||
e2 := testutils.MakeFakeHistoryEntry("exit 1")
|
e2 := testutils.MakeFakeHistoryEntry("exit 1")
|
||||||
e2.ExitCode = 1
|
e2.ExitCode = 1
|
||||||
require.NoError(t, db.Create(e2).Error)
|
|
||||||
manuallySubmitHistoryEntry(t, userSecret, e2)
|
manuallySubmitHistoryEntry(t, userSecret, e2)
|
||||||
|
|
||||||
// Configure a default filter
|
// Configure a default filter
|
||||||
|
Loading…
Reference in New Issue
Block a user