Merge "Add pre-upload hook to run Winscope tests" into udc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
c4808fc1d2
8
PREUPLOAD.cfg
Normal file
8
PREUPLOAD.cfg
Normal file
@@ -0,0 +1,8 @@
|
||||
# Per-project `repo upload` hook settings.
|
||||
# https://android.googlesource.com/platform/tools/repohooks
|
||||
|
||||
[Options]
|
||||
ignore_merged_commits = true
|
||||
|
||||
[Hook Scripts]
|
||||
winscope = ./tools/winscope/hooks/pre-upload ${PREUPLOAD_FILES}
|
||||
19
tools/winscope/hooks/pre-upload
Executable file
19
tools/winscope/hooks/pre-upload
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
WINSCOPE_SRC_PATTERN="tools/winscope/"
|
||||
|
||||
match=false
|
||||
for file in "$@"
|
||||
do
|
||||
if echo $file | grep --quiet "$WINSCOPE_SRC_PATTERN"
|
||||
then
|
||||
match=true
|
||||
fi
|
||||
done
|
||||
|
||||
# If there are changes to winscope files and npm is installed
|
||||
if $match && (which node > /dev/null)
|
||||
then
|
||||
echo "Running winscope presubmit tests..."
|
||||
npm run test:presubmit --prefix $WINSCOPE_SRC_PATTERN
|
||||
fi
|
||||
Reference in New Issue
Block a user