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

HBASE-24890 The command regioninfo is not available #2263

Merged
merged 3 commits into from
Aug 22, 2020
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
add ut for command regioninfo
  • Loading branch information
bsglz committed Aug 17, 2020
commit 88449f2266d869ae8d91e3a3f1a16ce9dffa6aed
34 changes: 34 additions & 0 deletions hbase-shell/src/test/ruby/hbase/admin2_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -435,5 +435,39 @@ def teardown
end
end
end

# Tests for the `regioninfo` shell command
class RegionInfoTest < Test::Unit::TestCase
include TestHelpers
include HBaseConstants

def setup
setup_hbase
end

def teardown
shutdown
end

define_test "Get region info without any args" do
assert_raise(ArgumentError) do
command(:regioninfo)
end
end

define_test 'Get region info with encoded region name' do
output = capture_stdout { command(:regioninfo, '1588230740') }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we know that 1588230740 region exists? Can we create a table, list_regions and then get regioninfo with this command?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it would be better.
Will fix later, Thanks.

puts "Region info output:\n#{output}"
assert output.include? 'ENCODED'
assert output.include? 'STARTKEY'
end

define_test 'Get region info with region name' do
output = capture_stdout { command(:regioninfo, 'hbase:meta,,1') }
puts "Region info output:\n#{output}"
assert output.include? 'ENCODED'
assert output.include? 'STARTKEY'
end
end
# rubocop:enable ClassLength
end