Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI with Azure Pipelines #595

Merged
merged 89 commits into from
Jan 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
352eb49
add yaml config
jopohl Jan 6, 2019
4b0317c
update build trigger
jopohl Jan 6, 2019
8905d57
add flag
jopohl Jan 6, 2019
7720b3b
update file
jopohl Jan 6, 2019
a097974
skip broken pytest
jopohl Jan 6, 2019
46e946e
install deps
jopohl Jan 6, 2019
66013e0
add osx
jopohl Jan 6, 2019
a3b714d
adaptions
jopohl Jan 6, 2019
99ecd47
fix osx
jopohl Jan 6, 2019
82c21c3
start xvfb
jopohl Jan 6, 2019
69576aa
add env var
jopohl Jan 6, 2019
1d162c9
use xfvb run
jopohl Jan 6, 2019
3e92c08
start xvfb
jopohl Jan 6, 2019
2cf63c6
add flag
jopohl Jan 6, 2019
d7f6378
adapt path
jopohl Jan 6, 2019
b285e5a
use pytest xfvb
jopohl Jan 6, 2019
f779a7c
debug windows error
jopohl Jan 6, 2019
e6599cb
debug windows error
jopohl Jan 6, 2019
3cb5bf1
disable teardown for test
jopohl Jan 6, 2019
e70c771
try different setup
jopohl Jan 6, 2019
7e030a5
fix constructor
jopohl Jan 6, 2019
aad1e90
add gc collect
jopohl Jan 6, 2019
67a0932
increase timeout for ci
jopohl Jan 6, 2019
dcee074
debug win
jopohl Jan 6, 2019
81df2b9
catch relpath error
jopohl Jan 6, 2019
602471f
remove debug line
jopohl Jan 6, 2019
f871adb
improve log
jopohl Jan 6, 2019
5bff482
winfix
jopohl Jan 6, 2019
6e10450
winfix
jopohl Jan 6, 2019
c0fd148
more fixes
jopohl Jan 6, 2019
d7740f6
make calls win compat
jopohl Jan 6, 2019
e841832
catch relpath
jopohl Jan 6, 2019
a339995
update code.py
jopohl Jan 6, 2019
3f50c79
add cov config
jopohl Jan 6, 2019
143db77
download drivers
jopohl Jan 7, 2019
3c1602e
fix syntax
jopohl Jan 7, 2019
d049046
fix syntax
jopohl Jan 7, 2019
5d4aacd
fix syntax
jopohl Jan 7, 2019
36bc589
update var
jopohl Jan 7, 2019
b28e06c
add debug
jopohl Jan 7, 2019
414012a
add braces
jopohl Jan 7, 2019
fb539f0
fix var name
jopohl Jan 7, 2019
8335eec
add braces
jopohl Jan 7, 2019
95b4700
add braces
jopohl Jan 7, 2019
716962b
add
jopohl Jan 7, 2019
b79a729
rename to python arch
jopohl Jan 7, 2019
7b4f77b
remove echos
jopohl Jan 7, 2019
7d79ee8
improve test
jopohl Jan 7, 2019
5231fea
coverage only for python 3.6
jopohl Jan 7, 2019
965bcd1
add coveralls
jopohl Jan 7, 2019
31777d5
add testrun
jopohl Jan 7, 2019
95c7d79
change var
jopohl Jan 7, 2019
28ee525
change var
jopohl Jan 7, 2019
133f1cc
dummy commit
jopohl Jan 7, 2019
033b28e
test var
jopohl Jan 7, 2019
0a92113
add timeout for ci
jopohl Jan 7, 2019
78fceb0
remove coverage upload from travis
jopohl Jan 7, 2019
7fb5c47
reset travis
jopohl Jan 7, 2019
84e5ccb
try pullrequest id
jopohl Jan 7, 2019
0a6f22a
try pullrequest id
jopohl Jan 7, 2019
f42ebff
try pullrequest id
jopohl Jan 7, 2019
de0e2a8
try pull nr
jopohl Jan 7, 2019
e12ebe1
Merge branch 'master' into azure
jopohl Jan 7, 2019
15a3aba
use build quality check
jopohl Jan 7, 2019
72f9e0b
add condition
jopohl Jan 7, 2019
7923509
switch to line coverage
jopohl Jan 7, 2019
68d0f6c
test coverage
jopohl Jan 7, 2019
a17a7f0
add cov config
jopohl Jan 7, 2019
f15d0cb
add build deps task
jopohl Jan 7, 2019
a871301
test build
jopohl Jan 7, 2019
7c4c897
conditions
jopohl Jan 7, 2019
288bbaa
test var
jopohl Jan 7, 2019
9257b38
add twine upload
jopohl Jan 7, 2019
f1fc1f7
add echo
jopohl Jan 7, 2019
bc3c87c
test var
jopohl Jan 7, 2019
94d32ce
test var
jopohl Jan 7, 2019
c347221
twine upload
jopohl Jan 7, 2019
34ae0f1
increase timeout for ci
jopohl Jan 7, 2019
936427f
fix test
jopohl Jan 7, 2019
dbfe4ef
test publish build artifacts
jopohl Jan 8, 2019
8f2740c
test other archive name
jopohl Jan 8, 2019
c9f613e
fix test
jopohl Jan 8, 2019
b50244d
split build task
jopohl Jan 8, 2019
c80b819
add github release task
jopohl Jan 8, 2019
9a47cfa
fix syntax
jopohl Jan 8, 2019
c4761bb
try conn
jopohl Jan 8, 2019
6a8528b
try conn
jopohl Jan 8, 2019
ba47535
add tag trigger
jopohl Jan 8, 2019
bc98481
cleanup
jopohl Jan 8, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
215 changes: 215 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
trigger:
- master
- refs/tags/v*

jobs:

- job: 'Linux'
pool:
vmImage: 'Ubuntu-16.04'
strategy:
matrix:
Python35:
python.version: '3.5'
Python36:
python.version: '3.6'
Python37:
python.version: '3.7'

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
architecture: 'x64'

- script: |
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
displayName: 'Install dependencies'

- script: python setup.py build_ext --inplace
displayName: "Build extensions"

- script: |
touch tests/show_gui
pytest -s --boxed --junitxml=junit/test-results.xml --cov=src/urh --cov-report=xml --cov-report=html --cov-config tests/.coveragerc tests
displayName: 'Run pytest with coverage'
condition: eq(variables['python.version'], '3.6')

- script: |
touch tests/show_gui
pytest -s --boxed --junitxml=junit/test-results.xml tests
displayName: 'Run pytest without coverage'
condition: ne(variables['python.version'], '3.6')

- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/test-*.xml'
testRunTitle: 'Publish test results for Python $(python.version)'

- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov'
condition: eq(variables['python.version'], '3.6')

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

- script: |
pip install .
urh --version
xvfb-run urh autoclose
displayName: 'Testrun'

- job: 'Windows'
pool:
vmImage: 'vs2017-win2016'
strategy:
matrix:
Python35-64:
python.version: '3.5'
python.arch: 'x64'
Python35-32:
python.version: '3.5'
python.arch: 'x86'
Python36-64:
python.version: '3.6'
python.arch: 'x64'
Python36-32:
python.version: '3.6'
python.arch: 'x86'
Python37-64:
python.version: '3.7'
python.arch: 'x64'
Python37-32:
python.version: '3.7'
python.arch: 'x86'

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
architecture: '$(python.arch)'

- powershell: |
if ("$(python.arch)" -eq "x86") {$url="https://dl.dropboxusercontent.com/s/ky6prqc0zh4wspm/win-32.zip"} else {$url="https://dl.dropboxusercontent.com/s/3pdvo56amjjm7b7/win-64.zip"}
Invoke-WebRequest -Uri $url -OutFile "C:\windlls.zip"
displayName: 'download SDR drivers'

- script: |
python -m pip install --upgrade pip
pip install -r data/requirements.txt
pip install pytest pytest-faulthandler
displayName: 'Install dependencies'

- task: ExtractFiles@1
inputs:
archiveFilePatterns: 'C:\windlls.zip'
destinationFolder: src\urh\dev\native\lib\shared
#cleanDestinationFolder: true

- script: python setup.py build_ext --inplace
displayName: "Build extensions"

- script: |
pip install wheel twine six appdirs packaging cx_freeze
pip install "pyaudio; python_version < '3.7'"
python -c "import tempfile, os; open(os.path.join(tempfile.gettempdir(), 'urh_releasing'), 'w').close()"
displayName: "Install build dependencies"

- script: python setup.py bdist_wheel
displayName: "Build python wheel"

- script: python data\build_cx.py
condition: eq(variables['python.version'], '3.6')
displayName: "Build MSI"

- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: dist/
artifactName: 'dist'
displayName: "Publish Build Artifacts"

- script: twine upload --skip-existing dist/*.whl
displayName: "Upload wheel to PyPi"
condition: contains(variables['Build.SourceBranch'], 'refs/tags/')
env:
TWINE_USERNAME: $(twine.username)
TWINE_PASSWORD: $(twine.password)
TWINE_REPOSITORY_URL: "https://upload.pypi.org/legacy/"

- task: GitHubRelease@0
displayName: 'GitHub release'
condition: contains(variables['Build.SourceBranch'], 'refs/tags/')
inputs:
gitHubConnection: 'github connection 1'
repositoryName: jopohl/urh
assets: 'dist/*.msi'
assetUploadMode: 'replace'
addChangeLog: true

- script: pytest --junitxml=junit/test-results.xml -s -v tests
displayName: 'Run pytest'

- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/test-*.xml'
testRunTitle: 'Publish test results for Python $(python.version)'

- script: |
pip install .
urh --version
urh autoclose
displayName: 'Testrun'

- job: 'OSX'
pool:
vmImage: 'macOS-10.13'

strategy:
matrix:
Python37:
python.version: '3.7'

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'

- script: |
python -m pip install --upgrade pip
pip install -r data/requirements.txt
pip install pytest pytest-faulthandler
brew install hackrf librtlsdr
displayName: 'Install dependencies'

- script: python setup.py build_ext --inplace
displayName: "Build extensions"

- script: pytest --junitxml=junit/test-results.xml -s -v tests
displayName: 'Run pytest'

- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/test-*.xml'
testRunTitle: 'Publish test results for Python $(python.version)'

- script: |
pip install .
urh --version
urh autoclose
displayName: 'Test run'
30 changes: 17 additions & 13 deletions tests/test_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,24 @@ def receive(port, current_index, target_index, elapsed):

start = False
while True:
data = conn.recv(65536 * 8)
if not start:
start = True
t = time.time()
try:
data = conn.recv(65536 * 8)

if len(data) > 0:
while len(data) % 8 != 0:
data += conn.recv(len(data) % 8)
if not start:
start = True
t = time.time()

arr = np.frombuffer(data, dtype=np.complex64)
current_index.value += len(arr)
if len(data) > 0:
while len(data) % 8 != 0:
data += conn.recv(len(data) % 8)

if current_index.value == target_index:
break
arr = np.frombuffer(data, dtype=np.complex64)
current_index.value += len(arr)

if current_index.value == target_index:
break
except:
continue

conn.close()
elapsed.value = 1000 * (time.time() - t)
Expand Down Expand Up @@ -144,8 +148,8 @@ def test_performance(self):
time.sleep(0.5)
# send some zeros to simulate the end of a message
self.network_sdr_plugin_sender.send_raw_data(np.zeros(self.num_zeros_for_pause, dtype=np.complex64), 1)
time.sleep(1)
receive_process.join(25)
time.sleep(0.5)
receive_process.join(15)

logger.info("PROCESS TIME: {0:.2f}ms".format(elapsed.value))

Expand Down