Skip to content

Commit

Permalink
Split up unit tests on Shippable. (#21931)
Browse files Browse the repository at this point in the history
* Add more verbose output to coverage combine.
* Run unit tests on CI separately by version.
  • Loading branch information
mattclay committed Feb 25, 2017
1 parent 0d45503 commit 2804d2e
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 10 deletions.
6 changes: 5 additions & 1 deletion shippable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ matrix:
- env: TEST=none
include:
- env: TEST=other
- env: TEST=units

- env: TEST=units/2.6
- env: TEST=units/2.7
- env: TEST=units/3.5
- env: TEST=units/3.6

- env: TEST=osx/10.11

Expand Down
5 changes: 5 additions & 0 deletions test/runner/lib/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ def command_coverage_combine(args):
ansible_path = os.path.abspath('lib/ansible/') + '/'
root_path = os.getcwd() + '/'

counter = 0

for coverage_file in coverage_files:
counter += 1
display.info('[%4d/%4d] %s' % (counter, len(coverage_files), coverage_file), verbosity=2)

original = coverage.CoverageData()

if os.path.getsize(coverage_file) == 0:
Expand Down
2 changes: 1 addition & 1 deletion test/utils/shippable/shippable.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ find lib/ansible/modules -type d -empty -print -delete
function cleanup
{
if [ "$(ls test/results/coverage/)" ]; then
ansible-test coverage xml --color -v --requirements
ansible-test coverage xml --color -vv --requirements
cp -av test/results/reports/coverage.xml shippable/codecoverage/coverage.xml
fi

Expand Down
23 changes: 15 additions & 8 deletions test/utils/shippable/units.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,23 @@

set -o pipefail

retry.py add-apt-repository 'ppa:ubuntu-toolchain-r/test'
retry.py add-apt-repository 'ppa:fkrull/deadsnakes'
declare -a args
IFS='/:' read -ra args <<< "${TEST}"

retry.py apt-get update -qq
retry.py apt-get install -qq \
g++-4.9 \
python3.6-dev \
version="${args[1]}"

ln -sf x86_64-linux-gnu-gcc-4.9 /usr/bin/x86_64-linux-gnu-gcc
if [ "${version}" = "3.6" ]; then
retry.py add-apt-repository 'ppa:ubuntu-toolchain-r/test'
retry.py add-apt-repository 'ppa:fkrull/deadsnakes'

retry.py apt-get update -qq
retry.py apt-get install -qq \
g++-4.9 \
python3.6-dev \

ln -sf x86_64-linux-gnu-gcc-4.9 /usr/bin/x86_64-linux-gnu-gcc
fi

retry.py pip install tox --disable-pip-version-check

ansible-test units --color -v --tox --coverage
ansible-test units --color -v --tox --coverage --python "${version}"

0 comments on commit 2804d2e

Please sign in to comment.