tests: add support to junit output for marking what tests were excluded and all files that were processed

[ci skip]
This commit is contained in:
Jose Diaz-Gonzalez
2019-01-06 20:25:12 -05:00
parent 57766597ae
commit 85bf4dd5cd
2 changed files with 61 additions and 26 deletions

View File

@@ -81,8 +81,10 @@ lint:
# these are disabled due to their expansive existence in the codebase. we should clean it up though
@cat tests/shellcheck-exclude | sed -n -e '/^# SC/p'
@echo linting...
@mkdir -p test-results/shellcheck
@$(QUIET) find . -not -path '*/\.*' -not -path './debian/*' -type f | xargs file | grep text | awk -F ':' '{ print $$1 }' | xargs head -n1 | egrep -B1 "bash" | grep "==>" | awk '{ print $$2 }' | xargs shellcheck -e $(shell cat tests/shellcheck-exclude | sed -n -e '/^# SC/p' | cut -d' ' -f2 | paste -d, -s) | tests/shellcheck-to-junit --output test-results/shellcheck/results.xml
@mkdir -p test-results/shellcheck tmp/shellcheck
@$(QUIET) find . -not -path '*/\.*' -not -path './debian/*' -type f | xargs file | grep text | awk -F ':' '{ print $$1 }' | xargs head -n1 | egrep -B1 "bash" | grep "==>" | awk '{ print $$2 }' > tmp/shellcheck/test-files
@$(QUIET) cat tests/shellcheck-exclude | sed -n -e '/^# SC/p' | cut -d' ' -f2 | paste -d, -s > tmp/shellcheck/exclude
@$(QUIET) cat tmp/shellcheck/test-files | xargs shellcheck -e $(shell cat tmp/shellcheck/exclude) | tests/shellcheck-to-junit --output test-results/shellcheck/results.xml --files tmp/shellcheck/test-files --exclude $(shell cat tmp/shellcheck/exclude)
ci-go-coverage:
docker run --rm -ti \