Skip to content

Commit 959e799

Browse files
xcz011jorisvandenbossche
authored andcommitted
CI: Add print skipped tests into azure step (#26698)
1 parent 5574a9f commit 959e799

File tree

4 files changed

+27
-21
lines changed

4 files changed

+27
-21
lines changed

.travis.yml

+1-6
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,5 @@ script:
103103
after_script:
104104
- echo "after_script start"
105105
- source activate pandas-dev && pushd /tmp && python -c "import pandas; pandas.show_versions();" && popd
106-
- if [ -e test-data-single.xml ]; then
107-
ci/print_skipped.py test-data-single.xml;
108-
fi
109-
- if [ -e test-data-multiple.xml ]; then
110-
ci/print_skipped.py test-data-multiple.xml;
111-
fi
106+
- ci/print_skipped.py
112107
- echo "after_script done"

ci/azure/posix.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,9 @@ jobs:
8989
# note that this will produce $LASTEXITCODE=1
9090
Write-Error "$($matches[1]) tests failed"
9191
}
92-
displayName: Check for test failures
92+
displayName: 'Check for test failures'
93+
- script: |
94+
export PATH=$HOME/miniconda3/bin:$PATH
95+
source activate pandas-dev
96+
python ci/print_skipped.py
97+
displayName: 'Print skipped tests'

ci/azure/windows.yml

+8-3
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ jobs:
1818

1919
steps:
2020
- powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
21-
displayName: Add conda to PATH
21+
displayName: 'Add conda to PATH'
2222
- script: conda update -q -n base conda
2323
displayName: Update conda
2424
- script: conda env create -q --file ci\\deps\\azure-windows-$(CONDA_PY).yaml
25-
displayName: Create anaconda environment
25+
displayName: 'Create anaconda environment'
2626
- script: |
2727
call activate pandas-dev
2828
call conda list
@@ -48,4 +48,9 @@ jobs:
4848
# note that this will produce $LASTEXITCODE=1
4949
Write-Error "$($matches[1]) tests failed"
5050
}
51-
displayName: Check for test failures
51+
displayName: 'Check for test failures'
52+
- script: |
53+
export PATH=$HOME/miniconda3/bin:$PATH
54+
source activate pandas-dev
55+
python ci/print_skipped.py
56+
displayName: 'Print skipped tests'

ci/print_skipped.py

+12-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python
22

3+
import os
34
import sys
45
import math
56
import xml.etree.ElementTree as et
@@ -36,19 +37,19 @@ def parse_results(filename):
3637
return '\n'.join(skipped)
3738

3839

39-
def main(args):
40+
def main():
41+
test_files = [
42+
'test-data-single.xml',
43+
'test-data-multiple.xml',
44+
'test-data.xml',
45+
]
46+
4047
print('SKIPPED TESTS:')
41-
for fn in args.filename:
42-
print(parse_results(fn))
48+
for fn in test_files:
49+
if os.path.isfile(fn):
50+
print(parse_results(fn))
4351
return 0
4452

4553

46-
def parse_args():
47-
import argparse
48-
parser = argparse.ArgumentParser()
49-
parser.add_argument('filename', nargs='+', help='XUnit file to parse')
50-
return parser.parse_args()
51-
52-
5354
if __name__ == '__main__':
54-
sys.exit(main(parse_args()))
55+
sys.exit(main())

0 commit comments

Comments
 (0)