forked from AOSPA/android_packages_apps_Settings
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Precommit hook added to Settings, preventing the creation of new Robo…
…lectric tests. Test: repo upload . Change-Id: If31d79a7bf6a18f4c52692ffab4981056c14eaba
- Loading branch information
Jeremy Goldman
committed
Dec 10, 2020
1 parent
836df5e
commit d6a29ea
Showing
2 changed files
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
# This script detects the presence of new robolectric java tests within | ||
# commits to be uploaded. If a new file is detected the script will print an | ||
# error message and return an error code. Intended to be used as a repo hook. | ||
|
||
new_robolectric_tests=$( | ||
git diff --name-status $REPO_LREV | grep "^A.*tests/robotests.*\.java") | ||
if [ $new_robolectric_tests != "" ] | ||
then | ||
echo "New Robolectric unit tests detected. Please submit junit tests" \ | ||
"instead, in the tests/junit directory." \ | ||
"See go/android-platform-robolectric-cleanup." | ||
echo $new_robolectric_tests | ||
exit 1 | ||
fi |