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
#4911: use root cmd instance not package var for migrate tests
  • Loading branch information
sreuland committed Jul 12, 2024
commit b1573d0d5a4fe5e8f70ac5fa6da700a7c8079e83
10 changes: 6 additions & 4 deletions services/horizon/internal/integration/db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -873,12 +873,13 @@ func TestMigrateIngestIsTrueByDefault(t *testing.T) {
newDB := dbtest.Postgres(t)
freshHorizonPostgresURL := newDB.DSN

horizoncmd.RootCmd.SetArgs([]string{
rootCmd := horizoncmd.NewRootCmd()
rootCmd.SetArgs([]string{
// ingest is set to true by default
"--db-url", freshHorizonPostgresURL,
"db", "migrate", "up",
})
tt.NoError(horizoncmd.RootCmd.Execute())
tt.NoError(rootCmd.Execute())

dbConn, err := db.Open("postgres", freshHorizonPostgresURL)
tt.NoError(err)
Expand All @@ -894,12 +895,13 @@ func TestMigrateChecksIngestFlag(t *testing.T) {
newDB := dbtest.Postgres(t)
freshHorizonPostgresURL := newDB.DSN

horizoncmd.RootCmd.SetArgs([]string{
rootCmd := horizoncmd.NewRootCmd()
rootCmd.SetArgs([]string{
"--ingest=false",
"--db-url", freshHorizonPostgresURL,
"db", "migrate", "up",
})
tt.NoError(horizoncmd.RootCmd.Execute())
tt.NoError(rootCmd.Execute())

dbConn, err := db.Open("postgres", freshHorizonPostgresURL)
tt.NoError(err)
Expand Down
Loading