Skip to content

Commit

Permalink
CI: dump logs when tests fail
Browse files Browse the repository at this point in the history
  • Loading branch information
eudoxos committed Nov 19, 2024
1 parent 2922aeb commit 36bc2e7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- name: pytest (native)
timeout-minutes: 2
run: |
python -m pytest .
python -m pytest . || { for f in .pytest_cache/d/.xprocess/*/*.log; do echo @@@@@@@@@@@@@@@@@@@@@@@@@@@ $f @@@@@@@@@@@@@@@@@@@@@@@@@; cat $f; done }
- name: webapi test
timeout-minutes: 2
run: |
Expand Down
6 changes: 4 additions & 2 deletions mupifDB/test_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,11 @@ def test_01_workflowdemo01(self,scheduler):
print('Execution log not available')
logContent=None
logContent,logName=restApiControl.getBinaryFileByID(exe.ExecutionLog)
except: log.error('Error downloading log')
(log.error if exe.Status!='Finished' else log.info)(logContent.decode('utf-8'))
except:
log.error('Error downloading log')
(log.error if exe.Status!='Finished' else log.info)(logContent.decode('utf-8'))
assert exe.Status=='Finished'
assert logContent is not None
def test_02_web(self,scheduler,web):
server='http://localhost:'+PORTS['web']
import requests
Expand Down

0 comments on commit 36bc2e7

Please sign in to comment.