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

Commit 3aa1517

Browse files
committed
[#22] Include integration tests for read-only-hooks
To ensure that read-only-hooks are executed I implemented a basic integrationtest using test-scan, generic-webhook, and http-webhook. The test checks whether the logs of http-webhook contain a request.
1 parent 9dbd47c commit 3aa1517

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

.github/workflows/ci.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ jobs:
341341
run: |
342342
cd tests/integration/
343343
npx jest --ci --color no-scan-definition-error
344-
- name: "Hooks Integration Tests"
344+
- name: "Hooks (Read-Write) Integration Tests"
345345
run: |
346346
helm -n integration-tests install update-category ./hooks/update-field/ \
347347
--set="image.tag=sha-$(git rev-parse --short HEAD)" \
@@ -355,6 +355,16 @@ jobs:
355355
cd tests/integration/
356356
npx jest --ci --color read-write-hook
357357
helm -n integration-tests uninstall test-scan update-category update-severity
358+
- name: "Hooks (Read-Only) Integration Tests"
359+
run: |
360+
helm -n integration-tests install test-scan ./scanner/test-scan/ --set="parserImage.tag=sha-$(git rev-parse --short HEAD)"
361+
helm -n integration-tests install http-webhook ./demo-apps/http-webhook
362+
WEB_HOOK_IP=$(kubectl get -n integration-tests service/http-webhook -o jsonpath='{.spec.clusterIP}')
363+
helm -n integration-test install read-only-hook ./hooks/generic-webhook/ --set="webhookUrl=http://$WEB_HOOK_IP/hallo-welt"
364+
cd tests/integration/
365+
npx jest --ci --color read-write-hook
366+
helm -n integration-tests uninstall test-scan update-category update-severity
367+
358368
- name: "nmap Integration Tests"
359369
run: |
360370
helm -n integration-tests install nmap ./scanner/nmap/ --set="parserImage.tag=sha-$(git rev-parse --short HEAD)"

0 commit comments

Comments
 (0)