Skip to content

Commit

Permalink
Test: Azure CIs wait for all artifacts, publish pytest results, debug…
Browse files Browse the repository at this point in the history
… pyinstaller
  • Loading branch information
Greg Blumberg committed Jan 18, 2019
1 parent 4deda37 commit 052c8a5
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 6 deletions.
24 changes: 18 additions & 6 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ steps:
sleep 3 # give xvfb some time to start
xdpyinfo | grep dimensions # Check display dimensions
python ci/screen.py # Check display dimensions as seen by PySide
#pytest -v
pytest -v --doctest-modules --junitxml=junit/test-results.xml
mv examples/data/14061619.png examples/data/14061619_linux.png
displayName: "Installing code and running tests (Linux)"
condition: eq( variables['Agent.OS'], 'Linux')
Expand All @@ -66,9 +66,9 @@ steps:
system_profiler SPDisplaysDataType | grep Resolution # Check display dimensions using OS tools
sudo python ci/screen.py # Check display dimensions as seen by PySide
sudo python setup.py -q install
#sudo pytest -v
#sudo pytest -v --doctest-modules --junitxml=junit/test-results.xml
#sudo mv examples/data/14061619.png examples/data/14061619_mac.png
sudo pyinstaller runsharp/SHARPpy-osx.spec --noconsole --onefile
sudo pyinstaller runsharp/SHARPpy-osx.spec --noconsole --onefile --log-level DEBUG
sudo chmod 777 dist/SHARPpy.app
ls -lh dist
displayName: "Installing code and running tests (macOS)"
Expand All @@ -85,12 +85,19 @@ steps:
- script: |
python ci/screen.py
python setup.py -q install --user
#pytest -v
#pytest -v --doctest-modules --junitxml=junit/test-results.xml
#move examples\\data\\14061619.png examples\\data\\14061619_win.png
pyinstaller runsharp/SHARPpy-win7-64.spec
pyinstaller runsharp/SHARPpy-win7-64.spec --log-level DEBUG
displayName: "Installing code and running tests (Windows)"
condition: eq( variables['Agent.OS'], 'Windows_NT')

# Publish test results to Azure Pipelines
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/test-*.xml'
testRunTitle: 'Publish test results for $(Agent.OS)'

# Zipping Windows files
- task: ArchiveFiles@2
inputs:
Expand All @@ -106,14 +113,19 @@ steps:
rootFolderOrFile: dist/SHARPpy.app
archiveType: zip
archiveFile: '$(Build.ArtifactStagingDirectory)/SHARPpy-osx-64.zip'
displayName: "Zipping macOS .app"
condition: eq( variables['Agent.OS'], 'Darwin')

# Wait till the ArtifactStagingDirectory has both zip files using Python.
- script: python ci/check_artifact_dir.py
displayName: "Waiting till all artifacts needed for Github Releases have been built."

# Deploy to Github Releases
- task: GithubRelease@0
inputs:
gitHubConnection: releases
repositoryName: sharppy/SHARPpy
action: 'create' # Options: create, edit, discard
action: 'edit' # Options: create, edit, discard
target: '$(build.sourceVersion)' # Required when action == create || action == edit
tagSource: 'manual' # Required when action == create. Options: auto, manual
tag: azure-test # Required when action == edit || action == discard || tagSource == manual
Expand Down
15 changes: 15 additions & 0 deletions ci/check_artifact_dir.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import os
import glob
import time
from datetime import datetime

path = os.environ.get('Build_ArtifactStagingDirectory'.upper())
print(path)
timeout = 60*5
now = datetime.now()
files = glob.glob(path + '/*zip')
while len(files) != 2 and (datetime.now() - now).total_seconds() < timeout:
files = glob.glob(path + '/*zip')
print(num_files)

print("ALL FILES IN THE BUILD ARTIFACT STAGING DIRECTORY...NEXT STEP SHOULD BE DEPLOYING")

0 comments on commit 052c8a5

Please sign in to comment.