Skip to content

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.rb
index 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::TestCase
end
def prepare(*targets)
+ if targets.last.is_a?(Hash)
+ additional_env = targets.pop
+ else
+ additional_env = {}
+ end
env = {"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::TestCase
end
end
+ 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_tag
omit_on_release_branch
prepare("VERSION_PRE_TAG")