-
Notifications
You must be signed in to change notification settings - Fork 1
/
azure-pipelines.yml
164 lines (152 loc) · 4.68 KB
/
azure-pipelines.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
trigger:
batch: true
branches:
include:
- main
pr:
branches:
include:
- main
resources:
repositories:
- repository: templates
type: github
name: AVEVA/AVEVA-Samples
endpoint: AVEVA
parameters:
- name: poolADH
default: DevOps Managed Containers Build
- name: containerDemandsADH
type: object
default: ['Agent.OS -equals Linux']
- name: poolPI
default: DevOps Managed Containers Build
- name: containerDemandsPI
type: object
default: ['Agent.OS -equals Linux']
- name: poolEDS
default: DevOps Managed Containers Build
- name: containerDemandsEDS
type: object
default: ['PYTHON']
jobs:
- job: Tests_ADH
pool:
name: ${{ parameters.poolADH }}
demands: ${{ parameters.containerDemandsADH }}
variables:
- name: Endpoints.0.Selected
value: true
- name: Endpoints.1.Selected
value: false
- name: Endpoints.2.Selected
value: false
- name: Endpoints.0.TenantId
value: $(TenantId)
- name: Endpoints.0.NamespaceId
value: $(NamespaceId)
- name: Endpoints.0.ClientId
value: $(ClientId)
- name: Endpoints.0.ClientSecret
value: $(ClientSecret)
- name: Endpoints.0.Resource
value: $(Resource)
steps:
- template: '/miscellaneous/build_templates/appsettings.yml@templates'
parameters:
secrets: 'TenantId, NamespaceId, ClientId, ClientSecret, Resource'
- script: |
echo Install tools
pip install setuptools wheel
pip install unittest-xml-reporting
pip install pytest
pip install pytest-cov
echo Install requirements
pip install -r requirements.txt
echo Run tests
python -m pytest ./test.py --junitxml=junit/test-results.xml
echo Complete
displayName: 'Run tests'
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/test-*.xml'
failTaskOnFailedTests: true
testRunTitle: '$(Agent.JobName) on $(Agent.OS)'
displayName: 'Publish test results'
- job: Tests_PI
pool:
name: ${{ parameters.poolPI }}
demands: ${{ parameters.containerDemandsPI }}
variables:
- name: Endpoints.0.Selected
value: false
- name: Endpoints.1.Selected
value: false
- name: Endpoints.2.Selected
value: true
- name: Endpoints.2.Resource
value: $(PIWebAPI)
- name: Endpoints.2.Username
value: $(Username)
- name: Endpoints.2.Password
value: $(Password)
- name: Endpoints.2.DataArchiveName
value: $(DataArchiveName)
- name: Endpoints.2.VerifySSL
value: false
steps:
- template: '/miscellaneous/build_templates/appsettings.yml@templates'
parameters:
secrets: 'Username, Password, PIWebAPI, DataArchiveName'
- script: |
echo Install tools
pip install setuptools wheel
pip install unittest-xml-reporting
pip install pytest
pip install pytest-cov
echo Install requirements
pip install -r requirements.txt
echo Run tests
python -m pytest ./test.py --junitxml=junit/test-results.xml
echo Complete
displayName: 'Run tests'
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/test-*.xml'
failTaskOnFailedTests: true
testRunTitle: '$(Agent.JobName) on $(Agent.OS)'
displayName: 'Publish test results'
- job: Tests_EDS
pool:
name: ${{ parameters.poolEDS }}
demands: ${{ parameters.containerDemandsEDS }}
variables:
- name: Endpoints.0.Selected
value: false
- name: Endpoints.1.Selected
value: true
- name: Endpoints.2.Selected
value: false
steps:
- template: '/miscellaneous/build_templates/appsettings.yml@templates'
- script: |
echo Install tools
pip install setuptools wheel
pip install unittest-xml-reporting
pip install pytest
pip install pytest-cov
echo Install requirements
pip install -r requirements.txt
echo Run tests
python -m pytest ./test.py --junitxml=junit/test-results.xml
echo Complete
displayName: 'Run tests'
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/test-*.xml'
failTaskOnFailedTests: true
testRunTitle: '$(Agent.JobName) on $(Agent.OS)'
displayName: 'Publish test results'