Skip to content

Instantly share code, notes, and snippets.

@nkh
Last active September 13, 2021 10:14
Show Gist options
  • Save nkh/260629f4310cdf23bf18217f0813be57 to your computer and use it in GitHub Desktop.
Save nkh/260629f4310cdf23bf18217f0813be57 to your computer and use it in GitHub Desktop.
{
# find which repositories have changes, input: lib local_commit repo_commit
while IFS=$'\t' read -r -a revs ; do [[ "${revs[1]}" == "${revs[2]}" ]] || changed[${revs[0]}]=1 ; done < revisions
# find what test they trigger, input: repo test1 test2 ... and tests list
while IFS=$'\t' read -r -a deps ; do ((changed[${deps[0]}])) && { printf "%s\n" "${deps[@]:1}" | grep -f tests ; } ; done < dependencies
# add previously failed tests, input: faile test1 tes2 ...
awk '{ OFS="\n" ; /failed/ ; $1="" }1' < status
} | sed '/^$/d' | sort -u
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment