Skip to content

Commit

Permalink
GH-14949: [CI][Release] Output script's stdout on failure (#14957)
Browse files Browse the repository at this point in the history
This doesn't solve GH-14949 (CI failure) because it's a problem of  MojoHaus Versions Maven Plugin: mojohaus/versions#848

This adds more debug information on test failure.
* Closes: #14949

Authored-by: Sutou Kouhei <kou@clear-code.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
  • Loading branch information
kou committed Dec 15, 2022
1 parent 2708c08 commit 676c804
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 deletions.
1 change: 1 addition & 0 deletions .github/workflows/dev.yml
Expand Up @@ -98,6 +98,7 @@ jobs:
- name: Install Dependencies
shell: bash
run: |
gem install test-unit
pip install cython setuptools six pytest jira
- name: Run Release Test
env:
Expand Down
11 changes: 7 additions & 4 deletions dev/release/01-prepare-test.rb
Expand Up @@ -54,7 +54,9 @@ def prepare(*targets)
def test_linux_packages
user = "Arrow Developers"
email = "dev@arrow.apache.org"
prepare("LINUX_PACKAGES", "DEBFULLNAME" => user, "DEBEMAIL" => email)
stdout = prepare("LINUX_PACKAGES",
"DEBFULLNAME" => user,
"DEBEMAIL" => email)
changes = parse_patch(git("log", "-n", "1", "-p"))
sampled_changes = changes.collect do |change|
{
Expand Down Expand Up @@ -91,7 +93,7 @@ def test_linux_packages
],
},
]
assert_equal(expected_changes, sampled_changes)
assert_equal(expected_changes, sampled_changes, "Output:\n#{stdout}")
end

def test_version_pre_tag
Expand Down Expand Up @@ -273,8 +275,9 @@ def test_version_pre_tag
}
end

prepare("VERSION_PRE_TAG")
stdout = prepare("VERSION_PRE_TAG")
assert_equal(expected_changes.sort_by {|diff| diff[:path]},
parse_patch(git("log", "-n", "1", "-p")))
parse_patch(git("log", "-n", "1", "-p")),
"Output:\n#{stdout}")
end
end
20 changes: 11 additions & 9 deletions dev/release/post-11-bump-versions-test.rb
Expand Up @@ -44,7 +44,7 @@ def bump_versions(*targets)
else
additional_env = {}
end
env = { "BUMP_DEFAULT" => "0" }
env = {"BUMP_DEFAULT" => "0"}
targets.each do |target|
env["BUMP_#{target}"] = "1"
end
Expand Down Expand Up @@ -259,13 +259,14 @@ def test_version_post_tag
}
end

bump_versions("VERSION_POST_TAG")
stdout = bump_versions("VERSION_POST_TAG")
assert_equal(expected_changes.sort_by {|diff| diff[:path]},
parse_patch(git("log", "-n", "1", "-p")))
parse_patch(git("log", "-n", "1", "-p")),
"Output:\n#{stdout}")
end

def test_deb_package_names
bump_versions("DEB_PACKAGE_NAMES")
stdout = bump_versions("DEB_PACKAGE_NAMES")
changes = parse_patch(git("log", "-n", "1", "-p"))
sampled_changes = changes.collect do |change|
first_hunk = change[:hunks][0]
Expand Down Expand Up @@ -299,15 +300,15 @@ def test_deb_package_names
path: "dev/tasks/tasks.yml",
},
]
assert_equal(expected_changes, sampled_changes)
assert_equal(expected_changes, sampled_changes, "Output:\n#{stdout}")
end

def test_linux_packages
name = "Arrow Developers"
email = "dev@arrow.apache.org"
bump_versions("LINUX_PACKAGES",
"DEBFULLNAME" => name,
"DEBEMAIL" => email)
stdout = bump_versions("LINUX_PACKAGES",
"DEBFULLNAME" => name,
"DEBEMAIL" => email)

release_time_string = git("log",
"--format=%aI",
Expand Down Expand Up @@ -367,6 +368,7 @@ def test_linux_packages
},
]
assert_equal(expected_changes,
parse_patch(git("log", "-n", "1", "-p")))
parse_patch(git("log", "-n", "1", "-p")),
"Output:\n#{stdout}")
end
end

0 comments on commit 676c804

Please sign in to comment.