Skip to content

Commit 474183f

Browse files
committed
itest: add tapd harness arg for specifying sqlite database file path
1 parent 3e67545 commit 474183f

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

itest/tapd_harness.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ type harnessOpts struct {
104104
// fedSyncTickerInterval is the interval at which the federation envoy
105105
// sync ticker will fire.
106106
fedSyncTickerInterval *time.Duration
107+
108+
// sqliteDatabaseFilePath is the path to the SQLite database file to
109+
// use.
110+
sqliteDatabaseFilePath *string
107111
}
108112

109113
type harnessOption func(*harnessOpts)
@@ -187,6 +191,11 @@ func newTapdHarness(t *testing.T, ht *harnessTest, cfg tapdConfig,
187191
// as well as RPC insert and query.
188192
tapCfg.Universe.PublicAccess = true
189193

194+
// Set the SQLite database file path if it was specified.
195+
if opts.sqliteDatabaseFilePath != nil {
196+
tapCfg.Sqlite.DatabaseFileName = *opts.sqliteDatabaseFilePath
197+
}
198+
190199
// Pass through the address asset syncer disable flag. If the option
191200
// was not set, this will be false, which is the default.
192201
tapCfg.AddrBook.DisableSyncer = opts.addrAssetSyncerDisable

itest/test_harness.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,10 @@ type tapdHarnessParams struct {
373373
// noDefaultUniverseSync indicates whether the default universe server
374374
// should be added as a federation server or not.
375375
noDefaultUniverseSync bool
376+
377+
// sqliteDatabaseFilePath is the path to the SQLite database file to
378+
// use.
379+
sqliteDatabaseFilePath *string
376380
}
377381

378382
type Option func(*tapdHarnessParams)
@@ -407,12 +411,14 @@ func setupTapdHarness(t *testing.T, ht *harnessTest,
407411
ho.custodianProofRetrievalDelay = params.custodianProofRetrievalDelay
408412
ho.addrAssetSyncerDisable = params.addrAssetSyncerDisable
409413
ho.fedSyncTickerInterval = params.fedSyncTickerInterval
414+
ho.sqliteDatabaseFilePath = params.sqliteDatabaseFilePath
410415
}
411416

412-
tapdHarness, err := newTapdHarness(t, ht, tapdConfig{
417+
tapdCfg := tapdConfig{
413418
NetParams: harnessNetParams,
414419
LndNode: node,
415-
}, harnessOpts)
420+
}
421+
tapdHarness, err := newTapdHarness(t, ht, tapdCfg, harnessOpts)
416422
require.NoError(t, err)
417423

418424
// Start the tapd harness now.

0 commit comments

Comments
 (0)