Skip to content

Commit 77eeb10

Browse files
Brennon Yorkpwendell
authored andcommitted
[WIP][HOTFIX][SPARK-4123]: Fix bug in PR dependency (all deps. removed issue)
We're seeing a bug sporadically in the new PR dependency comparison test whereby it notes that *all* dependencies are removed. This happens when the current PR is built, but the final, sorted, dependency file is left blank. I believe this is an error either in the way the `git checkout` calls have been or an error within the `mvn` build for that PR (again, likely related to the `git checkout`). As such I've set the checkouts to now force (with `-f` flag) which is more in line with what Jenkins currently does on the initial checkout. Setting this as a WIP for now to trigger the build process myriad times to see if the issue still arises. Author: Brennon York <[email protected]> Closes apache#5443 from brennonyork/HOTFIX2-SPARK-4123 and squashes the following commits: f2186be [Brennon York] added output for the various git commit refs 3f073d6 [Brennon York] removed the git checkouts piping to dev null 07765a6 [Brennon York] updated the diff logic to reference the filenames rather than hardlink e3f63c7 [Brennon York] added '-f' to the checkout flags for git 710c8d1 [Brennon York] added 30 minutes to the test benchmark
1 parent 971b95b commit 77eeb10

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

dev/run-tests-jenkins

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,10 @@ pr_message=""
161161
# Ensure we save off the current HEAD to revert to
162162
current_pr_head="`git rev-parse HEAD`"
163163

164+
echo "HEAD: `git rev-parse HEAD`"
165+
echo "GHPRB: $ghprbActualCommit"
166+
echo "SHA1: $sha1"
167+
164168
# Run pull request tests
165169
for t in "${PR_TESTS[@]}"; do
166170
this_test="${FWDIR}/dev/tests/${t}.sh"

dev/tests/pr_new_dependencies.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ CURR_CP_FILE="my-classpath.txt"
3939
MASTER_CP_FILE="master-classpath.txt"
4040

4141
# First switch over to the master branch
42-
git checkout master &>/dev/null
42+
git checkout -f master
4343
# Find and copy all pom.xml files into a *.gate file that we can check
4444
# against through various `git` changes
4545
find -name "pom.xml" -exec cp {} {}.gate \;
4646
# Switch back to the current PR
47-
git checkout "${current_pr_head}" &>/dev/null
47+
git checkout -f "${current_pr_head}"
4848

4949
# Check if any *.pom files from the current branch are different from the master
5050
difference_q=""
@@ -71,7 +71,7 @@ else
7171
sort > ${CURR_CP_FILE}
7272

7373
# Checkout the master branch to compare against
74-
git checkout master &>/dev/null
74+
git checkout -f master
7575

7676
${MVN_BIN} clean package dependency:build-classpath -DskipTests 2>/dev/null | \
7777
sed -n -e '/Building Spark Project Assembly/,$p' | \
@@ -84,7 +84,7 @@ else
8484
rev | \
8585
sort > ${MASTER_CP_FILE}
8686

87-
DIFF_RESULTS="`diff my-classpath.txt master-classpath.txt`"
87+
DIFF_RESULTS="`diff ${CURR_CP_FILE} ${MASTER_CP_FILE}`"
8888

8989
if [ -z "${DIFF_RESULTS}" ]; then
9090
echo " * This patch does not change any dependencies."

0 commit comments

Comments
 (0)