Skip to content
This repository was archived by the owner on Nov 16, 2020. It is now read-only.

Commit 423d27f

Browse files
authored
fix tests and report pr status (#572)
1 parent 1ce97a6 commit 423d27f

File tree

9 files changed

+90
-35
lines changed

9 files changed

+90
-35
lines changed

ci/base-images/tests/clojure/task.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,5 @@ run:
3939
4040
echo ${image_url}
4141
42-
chmod +x ./dispatch/ci/base-images/tests/run-tests.sh
4342
./dispatch/ci/base-images/tests/run-tests.sh ./dispatch/ci/base-images/tests/clojure/tests.bats
4443

ci/base-images/tests/java/task.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,4 @@ run:
3939
4040
echo ${image_url}
4141
42-
chmod +x ./dispatch/ci/base-images/tests/run-tests.sh
4342
./dispatch/ci/base-images/tests/run-tests.sh ./dispatch/ci/base-images/tests/java/tests.bats

ci/base-images/tests/java/tests.bats

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ load ${DISPATCH_ROOT}/e2e/tests/helpers.bash
2727
}
2828

2929
@test "Create java function no schema" {
30-
run dispatch create function --image=java java-hello-no-schema ${DISPATCH_ROOT}/examples/java/hello-with-deps --handler=io.dispatchframework.examples.Hello
30+
run dispatch create function --image=java-image java-hello-no-schema ${DISPATCH_ROOT}/examples/java/hello-with-deps --handler=io.dispatchframework.examples.Hello
3131
echo_to_log
3232
assert_success
3333

ci/base-images/tests/nodejs/task.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,4 @@ run:
3939
4040
echo ${image_url}
4141
42-
chmod +x ./dispatch/ci/base-images/tests/run-tests.sh
4342
./dispatch/ci/base-images/tests/run-tests.sh ./dispatch/ci/base-images/tests/nodejs/tests.bats

ci/base-images/tests/nodejs/tests.bats

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,31 +30,31 @@ load ${DISPATCH_ROOT}/e2e/tests/helpers.bash
3030
}
3131

3232
@test "Execute node function no schema" {
33-
run_with_retry "dispatch exec node-hello-no-schema --input='{\"name\": \"Jon\", \"place\": \"Winterfell\"}' --wait --json | jq -r .output.myField" "Hello, Jon from Winterfell" 10 5
33+
run_with_retry "dispatch exec nodejs-hello-no-schema --input='{\"name\": \"Jon\", \"place\": \"Winterfell\"}' --wait --json | jq -r .output.myField" "Hello, Jon from Winterfell" 10 5
3434
}
3535

3636
@test "Delete node function no schema" {
37-
run dispatch delete function node-hello-no-schema
37+
run dispatch delete function nodejs-hello-no-schema
3838
echo_to_log
3939
assert_success
4040

41-
run_with_retry "dispatch get runs node-hello-no-schema --json | jq '. | length'" 0 5 5
41+
run_with_retry "dispatch get runs nodejs-hello-no-schema --json | jq '. | length'" 0 5 5
4242
}
4343

4444
@test "Create node function with schema" {
45-
run dispatch create function --image=nodejs node-hello-with-schema ${DISPATCH_ROOT}/examples/nodejs --handler=./hello.js --schema-in ${DISPATCH_ROOT}/examples/nodejs/hello.schema.in.json --schema-out ${DISPATCH_ROOT}/examples/nodejs/hello.schema.out.json
45+
run dispatch create function --image=nodejs-image nodejs-hello-with-schema ${DISPATCH_ROOT}/examples/nodejs --handler=./hello.js --schema-in ${DISPATCH_ROOT}/examples/nodejs/hello.schema.in.json --schema-out ${DISPATCH_ROOT}/examples/nodejs/hello.schema.out.json
4646
echo_to_log
4747
assert_success
4848

49-
run_with_retry "dispatch get function node-hello-with-schema --json | jq -r .status" "READY" 6 5
49+
run_with_retry "dispatch get function nodejs-hello-with-schema --json | jq -r .status" "READY" 6 5
5050
}
5151

5252
@test "Execute node function with schema" {
53-
run_with_retry "dispatch exec node-hello-with-schema --input='{\"name\": \"Jon\", \"place\": \"Winterfell\"}' --wait --json | jq -r .output.myField" "Hello, Jon from Winterfell" 5 5
53+
run_with_retry "dispatch exec nodejs-hello-with-schema --input='{\"name\": \"Jon\", \"place\": \"Winterfell\"}' --wait --json | jq -r .output.myField" "Hello, Jon from Winterfell" 5 5
5454
}
5555

5656
@test "Execute node function with input schema error" {
57-
run_with_retry "dispatch exec node-hello-with-schema --wait --json | jq -r .error.type" "InputError" 5 5
57+
run_with_retry "dispatch exec nodejs-hello-with-schema --wait --json | jq -r .error.type" "InputError" 5 5
5858
}
5959

6060
@test "Cleanup" {

ci/base-images/tests/powershell/task.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,4 @@ run:
3939
4040
echo ${image_url}
4141
42-
chmod +x ./dispatch/ci/base-images/tests/run-tests.sh
4342
./dispatch/ci/base-images/tests/run-tests.sh ./dispatch/ci/base-images/tests/powershell/tests.bats

ci/base-images/tests/python3/task.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,4 @@ run:
3939
4040
echo ${image_url}
4141
42-
chmod +x ./dispatch/ci/base-images/tests/run-tests.sh
4342
./dispatch/ci/base-images/tests/run-tests.sh ./dispatch/ci/base-images/tests/python3/tests.bats

ci/base-images/tests/run-tests.sh

100644100755
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,4 @@ function run_bats() {
2121
EXIT_STATUS=0
2222
run_bats "$1"
2323

24-
# TODO: delete
25-
cat ${BATS_LOG}
26-
2724
exit ${EXIT_STATUS}

ci/pipelines/base-images.yml

Lines changed: 82 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ jobs:
176176
params:
177177
GKE_KEY: ((gke-key))
178178
GKE_PROJECT_ID: ((gke-project-id))
179-
CLUSTER_NAME_SUFFIX: job-base-image
179+
CLUSTER_NAME_SUFFIX: base-img
180180
- put: k8s-cluster
181181
params:
182182
file: k8s-cluster/name
@@ -207,6 +207,7 @@ jobs:
207207
trigger: true
208208
- get: k8s-cluster
209209
passed: [create-gke-cluster]
210+
trigger: true
210211
- task: deploy-dispatch
211212
file: dispatch/ci/base-images/install-dispatch.yml
212213
params:
@@ -244,8 +245,13 @@ jobs:
244245
- get: base-image
245246
resource: python3-base-image-pr
246247
trigger: true
248+
version: every
247249
- get: dispatch
248250
resource: dispatch-master
251+
- get: base-image-pr
252+
resource: python3-base-image-pr
253+
- put: python3-base-image-pr
254+
params: {path: base-image-pr, context: build-image, status: pending}
249255
- task: base-image-tag
250256
file: dispatch/ci/base-images/base-image-tag.yml
251257
- put: python3-base-image
@@ -256,7 +262,12 @@ jobs:
256262
- put: python3-base-image-env
257263
params:
258264
file: build-context/keyval.properties
259-
265+
on_success:
266+
put: python3-base-image-pr
267+
params: {path: base-image-pr, context: build-image, status: success}
268+
on_failure:
269+
put: python3-base-image-pr
270+
params: {path: base-image-pr, context: build-image, status: failure}
260271

261272
- name: test-python3-base-image
262273
public: true
@@ -275,8 +286,10 @@ jobs:
275286
passed: [deploy-dispatch]
276287
- get: k8s-cluster
277288
passed: [create-gke-cluster]
289+
- get: base-image-pr
290+
resource: python3-base-image-pr
278291
- put: python3-base-image-pr
279-
params: {path: python3-base-image, context: tests, status: pending}
292+
params: {path: base-image-pr, context: tests, status: pending}
280293
- task: test-python3
281294
file: dispatch/ci/base-images/tests/python3/task.yml
282295
params:
@@ -287,10 +300,10 @@ jobs:
287300
tag: python3-base-image-env
288301
on_success:
289302
put: python3-base-image-pr
290-
params: {path: python3-base-image, context: tests, status: success}
303+
params: {path: base-image-pr, context: tests, status: success}
291304
on_failure:
292305
put: python3-base-image-pr
293-
params: {path: python3-base-image, context: tests, status: failure}
306+
params: {path: base-image-pr, context: tests, status: failure}
294307
ensure: *test_ensure
295308

296309

@@ -301,8 +314,13 @@ jobs:
301314
- get: base-image
302315
resource: nodejs-base-image-pr
303316
trigger: true
317+
version: every
304318
- get: dispatch
305319
resource: dispatch-master
320+
- get: base-image-pr
321+
resource: nodejs-base-image-pr
322+
- put: nodejs-base-image-pr
323+
params: {path: base-image-pr, context: build-image, status: pending}
306324
- task: base-image-tag
307325
file: dispatch/ci/base-images/base-image-tag.yml
308326
- put: nodejs-base-image
@@ -313,7 +331,12 @@ jobs:
313331
- put: nodejs-base-image-env
314332
params:
315333
file: build-context/keyval.properties
316-
334+
on_success:
335+
put: nodejs-base-image-pr
336+
params: {path: base-image-pr, context: build-image, status: success}
337+
on_failure:
338+
put: nodejs-base-image-pr
339+
params: {path: base-image-pr, context: build-image, status: failure}
317340

318341
- name: test-nodejs-base-image
319342
public: true
@@ -332,8 +355,10 @@ jobs:
332355
passed: [deploy-dispatch]
333356
- get: k8s-cluster
334357
passed: [create-gke-cluster]
358+
- get: base-image-pr
359+
resource: nodejs-base-image-pr
335360
- put: nodejs-base-image-pr
336-
params: {path: nodejs-base-image, context: tests, status: pending}
361+
params: {path: base-image-pr, context: tests, status: pending}
337362
- task: test-nodejs
338363
file: dispatch/ci/base-images/tests/nodejs/task.yml
339364
params:
@@ -344,10 +369,10 @@ jobs:
344369
tag: nodejs-base-image-env
345370
on_success:
346371
put: nodejs-base-image-pr
347-
params: {path: nodejs-base-image, context: tests, status: success}
372+
params: {path: base-image-pr, context: tests, status: success}
348373
on_failure:
349374
put: nodejs-base-image-pr
350-
params: {path: nodejs-base-image, context: tests, status: failure}
375+
params: {path: base-image-pr, context: tests, status: failure}
351376
ensure: *test_ensure
352377

353378

@@ -358,8 +383,13 @@ jobs:
358383
- get: base-image
359384
resource: java-base-image-pr
360385
trigger: true
386+
version: every
361387
- get: dispatch
362388
resource: dispatch-master
389+
- get: base-image-pr
390+
resource: java-base-image-pr
391+
- put: java-base-image-pr
392+
params: {path: base-image-pr, context: build-image, status: pending}
363393
- task: base-image-tag
364394
file: dispatch/ci/base-images/base-image-tag.yml
365395
- put: java-base-image
@@ -370,6 +400,12 @@ jobs:
370400
- put: java-base-image-env
371401
params:
372402
file: build-context/keyval.properties
403+
on_success:
404+
put: java-base-image-pr
405+
params: {path: base-image-pr, context: build-image, status: success}
406+
on_failure:
407+
put: java-base-image-pr
408+
params: {path: base-image-pr, context: build-image, status: failure}
373409

374410

375411
- name: test-java-base-image
@@ -389,8 +425,10 @@ jobs:
389425
passed: [deploy-dispatch]
390426
- get: k8s-cluster
391427
passed: [create-gke-cluster]
428+
- get: base-image-pr
429+
resource: java-base-image-pr
392430
- put: java-base-image-pr
393-
params: {path: java-base-image, context: tests, status: pending}
431+
params: {path: base-image-pr, context: tests, status: pending}
394432
- task: test-java
395433
file: dispatch/ci/base-images/tests/java/task.yml
396434
params:
@@ -401,10 +439,10 @@ jobs:
401439
tag: java-base-image-env
402440
on_success:
403441
put: java-base-image-pr
404-
params: {path: java-base-image, context: tests, status: success}
442+
params: {path: base-image-pr, context: tests, status: success}
405443
on_failure:
406444
put: java-base-image-pr
407-
params: {path: java-base-image, context: tests, status: failure}
445+
params: {path: base-image-pr, context: tests, status: failure}
408446
ensure: *test_ensure
409447

410448

@@ -415,8 +453,13 @@ jobs:
415453
- get: base-image
416454
resource: clojure-base-image-pr
417455
trigger: true
456+
version: every
418457
- get: dispatch
419458
resource: dispatch-master
459+
- get: base-image-pr
460+
resource: clojure-base-image-pr
461+
- put: clojure-base-image-pr
462+
params: {path: base-image-pr, context: build-image, status: pending}
420463
- task: base-image-tag
421464
file: dispatch/ci/base-images/base-image-tag.yml
422465
- put: clojure-base-image
@@ -427,6 +470,12 @@ jobs:
427470
- put: clojure-base-image-env
428471
params:
429472
file: build-context/keyval.properties
473+
on_success:
474+
put: clojure-base-image-pr
475+
params: {path: base-image-pr, context: build-image, status: success}
476+
on_failure:
477+
put: clojure-base-image-pr
478+
params: {path: base-image-pr, context: build-image, status: failure}
430479

431480

432481
- name: test-clojure-base-image
@@ -446,8 +495,10 @@ jobs:
446495
passed: [deploy-dispatch]
447496
- get: k8s-cluster
448497
passed: [create-gke-cluster]
498+
- get: base-image-pr
499+
resource: clojure-base-image-pr
449500
- put: clojure-base-image-pr
450-
params: {path: clojure-base-image, context: tests, status: pending}
501+
params: {path: base-image-pr, context: tests, status: pending}
451502
- task: test-clojure
452503
file: dispatch/ci/base-images/tests/clojure/task.yml
453504
params:
@@ -458,10 +509,10 @@ jobs:
458509
tag: clojure-base-image-env
459510
on_success:
460511
put: clojure-base-image-pr
461-
params: {path: clojure-base-image, context: tests, status: success}
512+
params: {path: base-image-pr, context: tests, status: success}
462513
on_failure:
463514
put: clojure-base-image-pr
464-
params: {path: clojure-base-image, context: tests, status: failure}
515+
params: {path: base-image-pr, context: tests, status: failure}
465516
ensure: *test_ensure
466517

467518

@@ -472,8 +523,13 @@ jobs:
472523
- get: base-image
473524
resource: powershell-base-image-pr
474525
trigger: true
526+
version: every
475527
- get: dispatch
476528
resource: dispatch-master
529+
- get: base-image-pr
530+
resource: powershell-base-image-pr
531+
- put: powershell-base-image-pr
532+
params: {path: base-image-pr, context: build-image, status: pending}
477533
- task: base-image-tag
478534
file: dispatch/ci/base-images/base-image-tag.yml
479535
- put: powershell-base-image
@@ -484,7 +540,12 @@ jobs:
484540
- put: powershell-base-image-env
485541
params:
486542
file: build-context/keyval.properties
487-
543+
on_success:
544+
put: powershell-base-image-pr
545+
params: {path: base-image-pr, context: build-image, status: success}
546+
on_failure:
547+
put: powershell-base-image-pr
548+
params: {path: base-image-pr, context: build-image, status: failure}
488549

489550
- name: test-powershell-base-image
490551
public: true
@@ -503,8 +564,10 @@ jobs:
503564
passed: [deploy-dispatch]
504565
- get: k8s-cluster
505566
passed: [create-gke-cluster]
567+
- get: base-image-pr
568+
resource: powershell-base-image-pr
506569
- put: powershell-base-image-pr
507-
params: {path: powershell-base-image, context: tests, status: pending}
570+
params: {path: base-image-pr, context: tests, status: pending}
508571
- task: test-powershell
509572
file: dispatch/ci/base-images/tests/powershell/task.yml
510573
params:
@@ -515,10 +578,10 @@ jobs:
515578
tag: powershell-base-image-env
516579
on_success:
517580
put: powershell-base-image-pr
518-
params: {path: powershell-base-image, context: tests, status: success}
581+
params: {path: base-image-pr, context: tests, status: success}
519582
on_failure:
520583
put: powershell-base-image-pr
521-
params: {path: powershell-base-image, context: tests, status: failure}
584+
params: {path: base-image-pr, context: tests, status: failure}
522585
ensure: *test_ensure
523586

524587

0 commit comments

Comments
 (0)