Skip to content

Commit

Permalink
#4911: fix db reingest cmd unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
sreuland committed Jul 9, 2024
1 parent fb23f8c commit 7a11625
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion services/horizon/cmd/db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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))
}

0 comments on commit 7a11625

Please sign in to comment.