From 7a11625ef9edb89395c726ffef354a39a6e8e086 Mon Sep 17 00:00:00 2001 From: Shawn Reuland Date: Tue, 9 Jul 2024 16:16:22 -0700 Subject: [PATCH] #4911: fix db reingest cmd unit test --- services/horizon/cmd/db_test.go | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/services/horizon/cmd/db_test.go b/services/horizon/cmd/db_test.go index 1763d5ea29..3942f8d91a 100644 --- a/services/horizon/cmd/db_test.go +++ b/services/horizon/cmd/db_test.go @@ -55,6 +55,7 @@ func (s *DBCommandsTestSuite) TestDefaultParallelJobSizeForCaptiveBackend() { "db", "reingest", "range", "--db-url", s.dsn, "--network", "testnet", + "--stellar-core-binary-path", "/test/core/bin/path", "--parallel-workers", "2", "--ledgerbackend", "captive-core", "2", @@ -64,11 +65,12 @@ func (s *DBCommandsTestSuite) TestDefaultParallelJobSizeForCaptiveBackend() { require.Equal(s.T(), parallelJobSize, uint32(100_000)) } -func (s *DBCommandsTestSuite) TestUsesParallelJobSizeWhenSet() { +func (s *DBCommandsTestSuite) TestUsesParallelJobSizeWhenSetForCaptive() { RootCmd.SetArgs([]string{ "db", "reingest", "range", "--db-url", s.dsn, "--network", "testnet", + "--stellar-core-binary-path", "/test/core/bin/path", "--parallel-workers", "2", "--parallel-job-size", "5", "--ledgerbackend", "captive-core", @@ -78,3 +80,19 @@ func (s *DBCommandsTestSuite) TestUsesParallelJobSizeWhenSet() { require.NoError(s.T(), RootCmd.Execute()) require.Equal(s.T(), parallelJobSize, uint32(5)) } + +func (s *DBCommandsTestSuite) TestUsesParallelJobSizeWhenSetForBuffered() { + RootCmd.SetArgs([]string{ + "db", "reingest", "range", + "--db-url", s.dsn, + "--network", "testnet", + "--parallel-workers", "2", + "--parallel-job-size", "5", + "--ledgerbackend", "datastore", + "--datastore-config", "../config.storagebackend.toml", + "2", + "10"}) + + require.NoError(s.T(), RootCmd.Execute()) + require.Equal(s.T(), parallelJobSize, uint32(5)) +}