Skip to content

Commit d524730

Browse files
committed
Add task for code coverage report, Skip tests
1 parent 1be270f commit d524730

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

azure-pipelines.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ jobs:
4343
- script: tox -e $(tox.env)
4444
displayName: Run tox
4545

46+
- task: PublishCodeCoverageResults@1
47+
inputs:
48+
codeCoverageTool: 'Cobertura'
49+
summaryFileLocation: 'C:\Windows\ServiceProfiles\NetworkService\coverage.xml'
50+
4651
- job: Linux
4752
pool:
4853
vmImage: ubuntu-18.04
@@ -85,3 +90,8 @@ jobs:
8590
8691
- script: tox -e $(tox.env)
8792
displayName: Run tox
93+
94+
- task: PublishCodeCoverageResults@1
95+
inputs:
96+
codeCoverageTool: 'Cobertura'
97+
summaryFileLocation: '/home/vsts/coverage.xml'

test.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ DJANGO_VERSION="$(python -m django --version)"
1010
cd django
1111
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
1212
git checkout $DJANGO_VERSION
13-
pip install -r tests/requirements/py3.txt
13+
pip install -r tests/requirements/py3.txt coverage
1414

15-
python tests/runtests.py --settings=testapp.settings --noinput \
15+
coverage run tests/runtests.py --settings=testapp.settings --noinput \
1616
aggregation \
1717
aggregation_regress \
1818
annotations \
@@ -108,3 +108,6 @@ python tests/runtests.py --settings=testapp.settings --noinput \
108108
transactions \
109109
update \
110110
update_only_fields
111+
112+
python -m coverage xml --include '*mssql*' --omit '*virtualenvs*'
113+
mv coverage.xml ~/

testapp/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@
117117
'backends.tests.LastExecutedQueryTest.test_last_executed_query',
118118
'constraints.tests.CheckConstraintTests.test_abstract_name',
119119
'constraints.tests.CheckConstraintTests.test_name',
120+
'db_functions.datetime.test_now.NowTests.test_basic',
120121
'db_functions.datetime.test_extract_trunc.DateFunctionTests.test_extract_year_exact_lookup',
121122
'db_functions.datetime.test_extract_trunc.DateFunctionTests.test_extract_year_greaterthan_lookup',
122123
'db_functions.datetime.test_extract_trunc.DateFunctionTests.test_extract_year_lessthan_lookup',

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ envlist =
77

88
whitelist_externals =
99
/bin/bash
10+
C:\Program Files\Git\bin\bash.EXE
1011

1112
commands =
1213
python manage.py test --noinput

0 commit comments

Comments
 (0)