-
Notifications
You must be signed in to change notification settings - Fork 15
/
.jobtemplate.yml
108 lines (93 loc) · 3.35 KB
/
.jobtemplate.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
jobs:
- job: ${{ parameters.name }}
dependsOn:
- 'build_sut'
variables:
nuget: packages
python_version: ${{ parameters.python_version }}
extra_atest_params: ${{ parameters.extra_atest_params }}
steps:
- task: UsePythonVersion@0
displayName: 'Setup Python'
inputs:
versionSpec: $(python_version)
addToPath: true
architecture: 'x64'
- script: |
pip install -r requirements-dev.txt
displayName: Install needed components from PyPi
- task: DownloadPipelineArtifact@0
inputs:
artifactName: 'build_artifacts'
displayName: Copying White from pipeline artifacts.
- script: |
mkdir src\WhiteLibrary\bin\
copy $(nuget)\Castle.Core.3.3.0\lib\net45\Castle.Core.dll src\WhiteLibrary\bin\
copy $(nuget)\Salabs.TestStack.White.0.13.4\lib\net40\TestStack.White.dll src\WhiteLibrary\bin\
continueOnError: false
displayName: Copy binaries to the library package
- script: |
python -m xmlrunner discover -s src --output-file unittests_$(python_version).xml
displayName: Run Python unit tests
- task: PublishTestResults@2
condition: always()
inputs:
testRunner: JUnit
testResultsFiles: unittests_$(python_version).xml
- script: |
python setup.py install
displayName: Install WhiteLibrary
- script: |
robot --outputdir output --noncritical unstable --xunit acceptancetests_$(python_version).xml $(extra_atest_params) --loglevel DEBUG:INFO atests
displayName: Execute Acceptance tests
- task: PublishTestResults@2
condition: always()
inputs:
testRunner: JUnit
testResultsFiles: output/acceptancetests_$(python_version).xml
- script: |
mkdir sareports
flake8 --output sareports/flake8_$(python_version).xml --format=junit-xml
displayName: 'Running Flake8 Static Analysis'
continueOnError: true
- task: PublishTestResults@2
condition: always()
continueOnError: true
inputs:
testRunner: JUnit
testResultsFiles: sareports/flake8_$(python_version).xml
testResultsTitle: Static Analysis Results from Flake8
testRunTitle: flake8-results-$(python_version)
publishRunAttachments: true
failTaskOnFailedTests: true
- script: |
pylint src --output-format=junit > sareports/pylint_$(python_version).xml
displayName: 'Running Pylint Static Analysis'
condition: and(always(), in(variables['python_version'], '3.4', '3.5', '3.6', '3.7'))
continueOnError: true
- task: PublishTestResults@2
condition: and(always(), in(variables['python_version'], '3.4', '3.5', '3.6', '3.7'))
continueOnError: true
inputs:
testRunner: JUnit
testResultsFiles: sareports/pylint_$(python_version).xml
testResultsTitle: Static Analysis Results from Pylint
testRunTitle: pylint-results-$(python_version)
publishRunAttachments: true
failTaskOnFailedTests: true
- task: PublishBuildArtifacts@1
condition: always()
displayName: Publish Robot Framework logs and results
inputs:
PathtoPublish: output
ArtifactType: container
TargetPath: ""
ArtifactName: Robot Test results
- task: PublishBuildArtifacts@1
condition: always()
displayName: Archive Static Analysis Reports
inputs:
PathToPublish: sareports
ArtifactType: container
TargetPath: ""
ArtifactName: StaticAnalysis