Skip to content

Commit

Permalink
Update CI (#614)
Browse files Browse the repository at this point in the history
* remove boxed flag from pytest

* remove OS check of cleanup routines

* coverage with python37 instead of python36
  • Loading branch information
jopohl authored Feb 6, 2019
1 parent c7f930e commit 3966d56
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 17 deletions.
20 changes: 12 additions & 8 deletions data/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,27 @@ jobs:
python -m pip install --upgrade pip
pip install -r data/requirements.txt
sudo apt-get install libhackrf-dev librtlsdr-dev xvfb
pip install pytest!=4.1 pytest-xdist pytest-xvfb pytest-cov coveralls
pip install pytest pytest-xvfb pytest-cov pytest-xdist
coverage --version
displayName: 'Install dependencies'
- script: python setup.py build_ext --inplace
displayName: "Build extensions"

- script: |
touch tests/show_gui
pytest -s -v --boxed --junitxml=junit/test-results.xml --cov=src/urh --cov-report=xml --cov-report=html --cov-config tests/.coveragerc tests
cp tests/.coveragerc .
pytest --junitxml=junit/test-results.xml --cov=src --cov-config=.coveragerc tests
coverage xml
coverage html
displayName: 'Run pytest with coverage'
condition: eq(variables['python.version'], '3.6')
condition: eq(variables['python.version'], '3.7')
- script: |
touch tests/show_gui
pytest -s -v --boxed --junitxml=junit/test-results.xml tests
pytest --junitxml=junit/test-results.xml tests
displayName: 'Run pytest without coverage'
condition: ne(variables['python.version'], '3.6')
condition: ne(variables['python.version'], '3.7')
- task: PublishTestResults@2
condition: succeededOrFailed()
Expand All @@ -55,15 +59,15 @@ jobs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov'
condition: eq(variables['python.version'], '3.6')
condition: eq(variables['python.version'], '3.7')

- task: mspremier.BuildQualityChecks.QualityChecks-task.BuildQualityChecks@5
displayName: 'Check coverage'
condition: eq(variables['python.version'], '3.6')
condition: eq(variables['python.version'], '3.7')
inputs:
checkCoverage: true
allowCoverageVariance: true
coverageVariance: 0.1
coverageVariance: 0.15
coverageDeltaType: percentage
coverageType: lines

Expand Down
2 changes: 1 addition & 1 deletion tests/.coveragerc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[run]
omit =
/src/urh/tests/*
src/urh/tests/*
*/__init__.py
src/urh/cythonext/*
src/urh/dev/*
Expand Down
14 changes: 6 additions & 8 deletions tests/QtTestCase.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,17 @@ def tearDown(self):
if hasattr(self, "dialog"):
self.dialog.close()

if sys.platform == "win32" or sys.platform == "darwin":
sip.delete(self.dialog)
self.dialog = None
sip.delete(self.dialog)
self.dialog = None

if hasattr(self, "form"):
self.form.close_all_files()
self.form.close()

if sys.platform == "win32" or sys.platform == "darwin":
sip.delete(self.form)
self.form = None
if sys.platform == "darwin" or sys.platform == "win32":
gc.collect()
sip.delete(self.form)
self.form = None

gc.collect()

def wait_before_new_file(self):
QApplication.instance().processEvents()
Expand Down

0 comments on commit 3966d56

Please sign in to comment.