Skip to content

Instantly share code, notes, and snippets.

@goneri
Last active February 18, 2020 14:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goneri/e408b8a0a405412c24e7595b49af565b to your computer and use it in GitHub Desktop.
Save goneri/e408b8a0a405412c24e7595b49af565b to your computer and use it in GitHub Desktop.
Ansible VMware module test coverage
#!/bin/bash
echo "module,status"
for module in $(find lib -type f -name 'vmware*.py' -or -name 'vca*.py' -or -name 'vcenter*.py'|xargs -n1 basename -s .py|sort -u); do
aliases_file="test/integration/targets/${module}/aliases"
current_status="no_test"
if [ -f "${aliases_file}" ]; then
if [ -n "$(egrep '(disabled)' ${aliases_file})" ]; then
current_status="disabled"
elif [ -n "$(grep zuul ${aliases_file})" ]; then
current_status="$(grep 'zuul/vmware' "test/integration/targets/${module}/aliases"|sed 's,zuul/vmware/,,')"
fi
fi
echo "\"${module}\",\"${current_status}\""
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment