Apache DataFusion SQL Query Engine
ARROW-7697: [Release] Add a test for updating Linux packages by 00-prepare.sh
Sutou Kouheiaa1413021ff6
diff --git a/dev/release/00-prepare-test.rb b/dev/release/00-prepare-test.rbindex a493dd21a9..e9894d0bc8 100644--- a/dev/release/00-prepare-test.rb+++ b/dev/release/00-prepare-test.rb@@ -43,10 +43,16 @@ class PrepareTest < Test::Unit::TestCaseenddef prepare(*targets)+ if targets.last.is_a?(Hash)+ additional_env = targets.pop+ else+ additional_env = {}+ endenv = {"PREPARE_DEFAULT" => "0"}targets.each do |target|env["PREPARE_#{target}"] = "1"end+ env = env.merge(additional_env)sh(env, @script, @release_version, @next_version)end@@ -72,6 +78,59 @@ class PrepareTest < Test::Unit::TestCaseendend+ def test_linux_packages+ user = "Arrow Developers"+ email = "[email protected]"+ prepare("LINUX_PACKAGES",+ "DEBFULLNAME" => user,+ "DEBEMAIL" => email)+ changes = parse_patch(git("log", "-n", "1", "-p"))+ sampled_changes = changes.collect do |change|+ {+ path: change[:path],+ sampled_hunks: change[:hunks].collect(&:first),+ # sampled_hunks: change[:hunks],+ }+ end+ base_dir = "dev/tasks/linux-packages"+ today = Time.now.utc.strftime("%a %b %d %Y")+ expected_changes = [+ {+ path: "#{base_dir}/apache-arrow-archive-keyring/debian/changelog",+ sampled_hunks: [+ "+apache-arrow-archive-keyring (#{@release_version}-1) " ++ "unstable; urgency=low",+ ],+ },+ {+ path:+ "#{base_dir}/apache-arrow-release/yum/apache-arrow-release.spec.in",+ sampled_hunks: [+ "+* #{today} #{user} <#{email}> - #{@release_version}-1",+ ],+ },+ {+ path: "#{base_dir}/apache-arrow/debian.ubuntu-xenial/changelog",+ sampled_hunks: [+ "+apache-arrow (#{@release_version}-1) unstable; urgency=low",+ ],+ },+ {+ path: "#{base_dir}/apache-arrow/debian/changelog",+ sampled_hunks: [+ "+apache-arrow (#{@release_version}-1) unstable; urgency=low",+ ],+ },+ {+ path: "#{base_dir}/apache-arrow/yum/arrow.spec.in",+ sampled_hunks: [+ "+* #{today} #{user} <#{email}> - #{@release_version}-1",+ ],+ },+ ]+ assert_equal(expected_changes, sampled_changes)+ end+def test_version_pre_tagomit_on_release_branchprepare("VERSION_PRE_TAG")