Skip to content

Commit

Permalink
stellar#4911: reset command args after each cmd invoke in db cmd tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sreuland committed Jul 11, 2024
1 parent bbe931d commit 5d89697
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion services/horizon/internal/integration/db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,7 @@ func TestReingestDB(t *testing.T) {
"captive-core-reingest-range-integration-tests.cfg",
)

horizoncmd.ResetCommandArgs()
horizoncmd.RootCmd.SetArgs(command(t, horizonConfig, "db",
"reingest",
"range",
Expand Down Expand Up @@ -605,6 +606,7 @@ func TestReingestDatastore(t *testing.T) {
t.Logf("fake gcs server started at %v", gcsServer.URL())
t.Setenv("STORAGE_EMULATOR_HOST", gcsServer.URL())

horizoncmd.ResetCommandArgs()
horizoncmd.RootCmd.SetArgs([]string{"db",
"reingest",
"range",
Expand Down Expand Up @@ -689,7 +691,6 @@ func TestReingestDBWithFilterRules(t *testing.T) {
itest, _ := initializeDBIntegrationTest(t)
tt := assert.New(t)

horizoncmd.ResetCommandArgs()
archive, err := historyarchive.Connect(
itest.GetHorizonIngestConfig().HistoryArchiveURLs[0],
historyarchive.ArchiveOptions{
Expand Down Expand Up @@ -785,6 +786,7 @@ func TestReingestDBWithFilterRules(t *testing.T) {
itest.StopHorizon()

// clear the db with reaping all ledgers
horizoncmd.ResetCommandArgs()
horizoncmd.RootCmd.SetArgs(command(t, itest.GetHorizonIngestConfig(), "db",
"reap",
"--history-retention-count=1",
Expand All @@ -793,6 +795,7 @@ func TestReingestDBWithFilterRules(t *testing.T) {

// repopulate the db with reingestion which should catchup using core reapply filter rules
// correctly on reingestion ranged
horizoncmd.ResetCommandArgs()
horizoncmd.RootCmd.SetArgs(command(t, itest.GetHorizonIngestConfig(), "db",
"reingest",
"range",
Expand Down

0 comments on commit 5d89697

Please sign in to comment.