Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

horizon/integration/test: added test for reingest with --ledgerbackend datastore #5383

Merged
merged 14 commits into from
Jul 12, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
#4911: reset command args after each cmd invoke in db cmd tests
  • Loading branch information
sreuland committed Jul 11, 2024
commit 5d89697d6a258f661ad420514a844d557175d36b
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