Created
April 26, 2022 18:17
-
-
Save ctubbsii/e17bcc9d5a4b71db68b748dd2b6919cf to your computer and use it in GitHub Desktop.
git-diffTests : create a Maven command line with -Dtest= and -Dit.test= for changed tests
This file contains hidden or 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
#! /usr/bin/bash | |
function findTests() { | |
{ | |
echo 'blah' | |
git diff --name-only "$2" | grep "$1[.]java" | xargs -n1 basename 2>/dev/null | cut -f1 -d. | |
} | paste -sd, | |
} | |
if [[ -z $1 ]]; then | |
testarg="-Dtest=$(findTests Test HEAD)" | |
itarg="-Dit.test=$(findTests IT HEAD)" | |
else | |
testarg="-Dtest=$(findTests Test "$1")" | |
itarg="-Dit.test=$(findTests IT "$1")" | |
fi | |
echo "$testarg $itarg" 1>&2 | |
echo "$testarg $itarg" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Whoops, I missed that part. Thanks!