Skip to content

[Spark QA] only check code files for new classes #2184

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

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
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
16 changes: 10 additions & 6 deletions dev/run-tests-jenkins
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ COMMIT_URL="https://github.com/apache/spark/commit/${ghprbActualCommit}"
# GitHub doesn't auto-link short hashes when submitted via the API, unfortunately. :(
SHORT_COMMIT_HASH="${ghprbActualCommit:0:7}"

# NOTE: Jenkins will kill the whole build after 120 minutes.
# Tests are a large part of that, but not all of it.
TESTS_TIMEOUT="120m"
TESTS_TIMEOUT="120m" # format: http://linux.die.net/man/1/timeout

function post_message () {
local message=$1
Expand Down Expand Up @@ -93,9 +91,14 @@ function post_message () {
else
merge_note=" * This patch merges cleanly."

non_test_files=$(git diff master --name-only | grep -v "\/test" | tr "\n" " ")
source_files=$(
git diff master --name-only \
| grep -v -e "\/test" `# ignore files in test directories` \
| grep -e "\.py$" -e "\.java$" -e "\.scala$" `# include only code files` \
| tr "\n" " "
)
new_public_classes=$(
git diff master ${non_test_files} `# diff this patch against master and...` \
git diff master ${source_files} `# diff this patch against master and...` \
| grep "^\+" `# filter in only added lines` \
| sed -r -e "s/^\+//g" `# remove the leading +` \
| grep -e "trait " -e "class " `# filter in lines with these key words` \
Expand Down Expand Up @@ -138,7 +141,8 @@ function post_message () {
test_result="$?"

if [ "$test_result" -eq "124" ]; then
fail_message="**[Tests timed out](${BUILD_URL}consoleFull)** after a configured wait of \`${TESTS_TIMEOUT}\`."
fail_message="**[Tests timed out](${BUILD_URL}consoleFull)** after \
a configured wait of \`${TESTS_TIMEOUT}\`."
post_message "$fail_message"
exit $test_result
else
Expand Down