-
Notifications
You must be signed in to change notification settings - Fork 48
307 lines (295 loc) · 10.2 KB
/
testing.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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
name: UDMI test suite
on:
push:
pull_request:
schedule:
- cron: '0 13 * * *'
concurrency:
group: ci-${{ github.repository }}
cancel-in-progress: true
jobs:
udmis:
name: UDMIS Tests
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/setup-java@v1
with:
java-version: '17'
- name: Checkout source
uses: actions/checkout@v3
- name: bin/run_tests install_dependencies
run: bin/run_tests install_dependencies
- name: bin/start_pubsub
run: bin/start_pubsub
- name: bin/test_mosquitto
run: bin/test_mosquitto
- name: bin/run_tests udmis_tests
run: bin/run_tests udmis_tests
unit:
name: Unit Tests
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/setup-java@v1
with:
java-version: '17'
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Checkout source
uses: actions/checkout@v3
- name: bin/run_tests install_dependencies
run: bin/run_tests install_dependencies
- name: bin/run_tests code_tests
if: ${{ always() }}
run: bin/run_tests code_tests
- name: bin/run_tests schema_tests
if: ${{ always() }}
run: bin/run_tests schema_tests
- name: bin/run_tests trace_tests
if: ${{ always() }}
run: bin/run_tests trace_tests
- name: bin/run_tests registrar_tests
if: ${{ always() }}
run: bin/run_tests registrar_tests
- name: bin/run_tests util_tests
if: ${{ always() }}
run: bin/run_tests util_tests
spelling:
name: Docs Spelling Checks
runs-on: ubuntu-latest
timeout-minutes: 1
steps:
- uses: actions/checkout@v3
- name: Check Spelling
uses: rojopolis/[email protected]
with:
config_path: .spellcheck.yml
task_name: Markdown
clearblade:
name: ClearBlade Integration
runs-on: ubuntu-latest
if: vars.CLEARBLADE_PROJECT != ''
env:
CLEARBLADE_PROJECT: ${{ vars.CLEARBLADE_PROJECT }}
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v1
with:
java-version: '17'
- name: bin/run_tests install_dependencies
run: bin/run_tests install_dependencies
- name: bin/test_regclean //clearblade/$CLEARBLADE_PROJECT
run: bin/test_regclean //clearblade/$CLEARBLADE_PROJECT
- name: Config outputs
if: ${{ always() }}
run: more /tmp/pubber_config.json /tmp/registrar_config.json | cat
udmif:
name: UDMIF unit tests
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v1
with:
node-version: 16.16.0
- name: Install Angular CLI
run: npm install -g @angular/cli
- name: web tests
run: udmif/web/runTests
- name: api tests
run: udmif/api/runTests
sanity:
name: GitHub Actions sanity
runs-on: ubuntu-latest
timeout-minutes: 1
env:
VARS_GCP_TARGET_PROJECT: ${{ vars.GCP_TARGET_PROJECT }}
VARS_UDMI_REGISTRY_SUFFIX: ${{ vars.UDMI_REGISTRY_SUFFIX }}
VARS_UDMI_ALT_REGISTRY: ${{ vars.UDMI_ALT_REGISTRY }}
SECRETS_GCP_TARGET_PROJECT: ${{ secrets.GCP_TARGET_PROJECT }}
SECRETS_UDMI_REGISTRY_SUFFIX: ${{ secrets.UDMI_REGISTRY_SUFFIX }}
SECRETS_UDMI_ALT_REGISTRY: ${{ secrets.UDMI_ALT_REGISTRY }}
steps:
- name: check secret-not-var GCP_TARGET_PROJECT
run: |
echo GCP_TARGET_PROJECT var is $VARS_GCP_TARGET_PROJECT
echo GCP_TARGET_PROJECT secret is $SECRETS_GCP_TARGET_PROJECT
echo Checking if secret is defined but not var
[[ -n $VARS_GCP_TARGET_PROJECT || -z $SECRETS_GCP_TARGET_PROJECT ]]
- name: check secret-not-var UDMI_REGISTRY_SUFFIX
run: |
echo UDMI_REGISTRY_SUFFIX var is $VARS_UDMI_REGISTRY_SUFFIX
echo UDMI_REGISTRY_SUFFIX secret is $SECRETS_UDMI_REGISTRY_SUFFIX
echo Checking if secret is defined but not var
[[ -n $VARS_UDMI_REGISTRY_SUFFIX || -z $SECRETS_UDMI_REGISTRY_SUFFIX ]]
- name: check secret-not-var UDMI_ALT_REGISTRY
run: |
echo UDMI_ALT_REGISTRY var is $VARS_UDMI_ALT_REGISTRY
echo UDMI_ALT_REGISTRY secret is $SECRETS_UDMI_ALT_REGISTRY
echo Checking if secret is defined but not var
[[ -n $VARS_UDMI_ALT_REGISTRY || -z $SECRETS_UDMI_ALT_REGISTRY ]]
sequencer:
name: Sequencer Suite
runs-on: ubuntu-latest
timeout-minutes: 45
if: vars.GCP_TARGET_PROJECT != '' && vars.UDMI_REGISTRY_SUFFIX != ''
env:
GCP_TARGET_PROJECT: ${{ vars.GCP_TARGET_PROJECT }}
UDMI_REGISTRY_SUFFIX: ${{ vars.UDMI_REGISTRY_SUFFIX }}
UDMI_ALT_REGISTRY: ${{ vars.UDMI_ALT_REGISTRY }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v1
with:
java-version: '17'
- name: base setup
run: bin/run_tests install_dependencies
- name: registrar clean
run: bin/test_regclean //gcp/$GCP_TARGET_PROJECT
- name: sequence tests clean
run: bin/test_sequencer clean $GCP_TARGET_PROJECT
- name: sequence tests alpha
run: bin/test_sequencer alpha $GCP_TARGET_PROJECT
- name: sequence test timing
if: ${{ always() }}
run: fgrep ' ending test ' out/sequencer.log
- name: generated files
if: ${{ always() }}
run: more out/sequencer.out out/generated.md || true
- name: sequencer end state
if: ${{ always() }}
run: cat sites/udmi_site_model/out/sequencer_AHU-1.json || true
- name: schema validation output
if: ${{ always() }}
run: |
echo ============ out/schemas.out
cat out/schemas.out || true
echo ============ find RESULT.log
find sites/udmi_site_model/out/devices/ -name RESULT.log | xargs fgrep -i schema
- name: pubber logs
if: ${{ always() }}
run: more out/pubber.out* pubber/out/*/*.json || true
- name: output logs
if: ${{ always() }}
run: cd sites/udmi_site_model/out && more `find . -type f` || true
sequencer_dep:
name: Sequencer Suite
runs-on: ubuntu-latest
timeout-minutes: 45
needs: redirect
if: vars.GCP_TARGET_PROJECT != '' && vars.UDMI_REGISTRY_SUFFIX == ''
env:
GCP_TARGET_PROJECT: ${{ vars.GCP_TARGET_PROJECT }}
UDMI_ALT_REGISTRY: ${{ vars.UDMI_ALT_REGISTRY }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v1
with:
java-version: '17'
- name: base setup
run: bin/run_tests install_dependencies
- name: registrar clean
run: bin/test_regclean //gcp/$GCP_TARGET_PROJECT
- name: sequence tests clean
run: bin/test_sequencer clean $GCP_TARGET_PROJECT
- name: sequence tests alpha
run: bin/test_sequencer alpha $GCP_TARGET_PROJECT
- name: sequence test timing
if: ${{ always() }}
run: fgrep 'ending test' out/sequencer.log
- name: generated files
if: ${{ always() }}
run: more out/sequencer.out out/generated.md || true
- name: sequencer end state
if: ${{ always() }}
run: cat sites/udmi_site_model/out/sequencer_AHU-1.json || true
- name: schema validation output
if: ${{ always() }}
run: |
echo ============ out/schemas.out
cat out/schemas.out || true
echo ============ find RESULT.log
find sites/udmi_site_model/out/devices/ -name RESULT.log | xargs fgrep -i schema
- name: pubber logs
if: ${{ always() }}
run: more out/pubber.out* pubber/out/*/*.json || true
- name: output logs
if: ${{ always() }}
run: cd sites/udmi_site_model/out && more `find . -type f` || true
comprehensive:
name: Comprehensive Suite
runs-on: ubuntu-latest
timeout-minutes: 30
if: vars.GCP_TARGET_PROJECT != ''
env:
GCP_TARGET_PROJECT: ${{ vars.GCP_TARGET_PROJECT }}
UDMI_ALT_REGISTRY: ${{ vars.UDMI_ALT_REGISTRY }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v1
with:
java-version: '17'
- name: base setup
run: bin/run_tests install_dependencies
- name: registrar clean
run: |
bin/test_regclean //gcp/$GCP_TARGET_PROJECT
- name: telemetry validator
run: |
bin/test_validator $GCP_TARGET_PROJECT
- name: validator result
if: ${{ always() }}
run: |
cat /tmp/validator.out || true
- name: message captures
if: ${{ always() }}
run: |
cd sites/udmi_site_model/out && more `find . -type f` || true
- name: itemized sequencer tests
if: ${{ always() }}
run: |
bin/test_itemized $GCP_TARGET_PROJECT
- name: itemized output logs
if: ${{ always() }}
run: |
more out/test_itemized.out out/schemas_itemized.out | cat
more sites/udmi_site_model/out/devices/AHU-1/tests/*/sequencer.log | cat
- name: pubber output logs
if: ${{ always() }}
run: |
more out/pubber.out* | cat
redirect:
name: Endpoint Redirection
runs-on: ubuntu-latest
needs: comprehensive
timeout-minutes: 10
if: vars.GCP_TARGET_PROJECT != ''
env:
GCP_TARGET_PROJECT: ${{ vars.GCP_TARGET_PROJECT }}
UDMI_ALT_REGISTRY: ${{ vars.UDMI_ALT_REGISTRY }}
MQTT_PROXY_HOST: ${{ vars.MQTT_PROXY_HOST }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v1
with:
java-version: '17'
- name: base setup
run: bin/run_tests install_dependencies
- name: bin/test_proxy
if: "${{ env.MQTT_PROXY_HOST != '' }}"
run: |
bin/test_proxy $GCP_TARGET_PROJECT $MQTT_PROXY_HOST
- name: bin/test_redirect
run: |
bin/test_redirect $GCP_TARGET_PROJECT
- name: pubber.out.1
run: |
echo ::::::: pubber.out.1
cat out/pubber.out.1
- name: pubber.out.2
run: |
echo ::::::: pubber.out.2
cat out/pubber.out.2