Skip to content

Commit 4934f70

Browse files
committed
chore: run KinD integration tests with Helm deployment
Currently we have no coverage of testing the deployment of snyk-monitor with Helm. This change addresses this. We currently choose to deploy only during KinD tests, and assume that we can deploy with Helm for every other platform if this test succeeds.
1 parent 85868c5 commit 4934f70

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

.circleci/config.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,31 @@ jobs:
198198
- store_artifacts:
199199
path: /tmp/logs/test/integration/kind
200200

201+
integration_tests_helm:
202+
<<: *default_machine_config
203+
steps:
204+
- checkout
205+
- setup_node12
206+
- run:
207+
name: Create temporary directory for logs
208+
command: mkdir -p /tmp/logs/test/integration/kind-helm
209+
- run:
210+
name: Integration tests with Helm deployment
211+
command: |
212+
export KUBERNETES_MONITOR_IMAGE_NAME_AND_TAG=$(./scripts/circleci-jobs/setup-integration-tests.py)
213+
npm run test:integration:kind:helm
214+
- run:
215+
name: Notify Slack on failure
216+
command: |
217+
if [[ "$CIRCLE_BRANCH" == "staging" ]]; then
218+
./scripts/slack-notify-failure.sh "staging-integration-helm-tests-${CIRCLE_SHA1}"
219+
else
220+
echo "Current branch is $CIRCLE_BRANCH so skipping notifying Slack"
221+
fi
222+
when: on_fail
223+
- store_artifacts:
224+
path: /tmp/logs/test/integration/kind-helm
225+
201226
eks_integration_tests:
202227
<<: *default_machine_config
203228
steps:
@@ -410,6 +435,10 @@ workflows:
410435
requires:
411436
- build_image
412437
<<: *main_branches_filter
438+
- integration_tests_helm:
439+
requires:
440+
- build_image
441+
<<: *main_branches_filter
413442

414443
MERGE_TO_STAGING:
415444
jobs:
@@ -429,6 +458,10 @@ workflows:
429458
requires:
430459
- build_image
431460
<<: *staging_branch_only_filter
461+
- integration_tests_helm:
462+
requires:
463+
- build_image
464+
<<: *staging_branch_only_filter
432465
- eks_integration_tests:
433466
requires:
434467
- build_image
@@ -450,6 +483,7 @@ workflows:
450483
- unit_tests
451484
- system_tests
452485
- integration_tests
486+
- integration_tests_helm
453487
<<: *staging_branch_only_filter
454488
- deploy_dev:
455489
requires:

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"test:system": "tap test/system --timeout=600",
1010
"test:integration": "DEPLOYMENT_TYPE=YAML TEST_PLATFORM=kind CREATE_CLUSTER=true tap test/integration/kubernetes.test.ts --timeout=900",
1111
"test:integration:kind": "DEPLOYMENT_TYPE=YAML TEST_PLATFORM=kind CREATE_CLUSTER=true tap test/integration/kubernetes.test.ts --timeout=900",
12+
"test:integration:kind:helm": "DEPLOYMENT_TYPE=Helm TEST_PLATFORM=kind CREATE_CLUSTER=true tap test/integration/kubernetes.test.ts --timeout=900",
1213
"test:integration:eks": "DEPLOYMENT_TYPE=YAML TEST_PLATFORM=eks CREATE_CLUSTER=false tap test/integration/kubernetes.test.ts --timeout=900",
1314
"test:integration:openshift3": "DEPLOYMENT_TYPE=YAML TEST_PLATFORM=openshift3 CREATE_CLUSTER=true tap test/integration/kubernetes.test.ts --timeout=900",
1415
"test:integration:openshift4": "DEPLOYMENT_TYPE=Operator TEST_PLATFORM=openshift4 CREATE_CLUSTER=false tap test/integration/kubernetes.test.ts --timeout=900",

0 commit comments

Comments
 (0)