Skip to content

Commit

Permalink
introduce ct for local helm install test
Browse files Browse the repository at this point in the history
  • Loading branch information
knelasevero committed Aug 10, 2022
1 parent ccfaeb2 commit ba85e79
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 81 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/helm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ jobs:

# Need a multi node cluster so descheduler runs until evictions
- name: Create multi node Kind cluster
run: |
kind create cluster --name kind --config ./hack/kind_config.yaml --wait 2m
run: make kind-multi-node

# helm-extra-set-args only available after ct 3.6.0
- name: Run chart-testing (install)
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,6 @@ test-helm: ensure-helm-install

kind-multi-node:
kind create cluster --name kind --config ./hack/kind_config.yaml --wait 2m

ct-helm:
./hack/verify-chart.sh
30 changes: 0 additions & 30 deletions charts/descheduler/templates/tests/test-descheduler-pod.yaml

This file was deleted.

22 changes: 10 additions & 12 deletions docs/contributor-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,6 @@ make test-unit
make test-e2e
```

## Run Helm Tests
Run the helm test for a particular descheduler release by setting below variables,
```
HELM_IMAGE_REPO="descheduler"
HELM_IMAGE_TAG="helm-test"
HELM_CHART_LOCATION="./charts/descheduler"
```
The helm tests runs as part of descheduler CI. But, to run it manually from the descheduler root,

```
make test-helm
```

## Build Helm Package locally

Expand All @@ -68,5 +56,15 @@ To check linting of your changes in the helm chart locally you can run:
make lint-helm
```

## Test helm changes locally with kind and ct

You will need kind and docker (or equivalent) installed. We can use ct public image to avoid installing ct and all its dependencies.


```
make kind-multi-node
make ct-helm
```

### Miscellaneous
See the [hack directory](https://github.com/kubernetes-sigs/descheduler/tree/master/hack) for additional tools and scripts used for developing the descheduler.
1 change: 1 addition & 0 deletions hack/verify-chart.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docker run -it --rm --network host --workdir=/data --volume ~/.kube/config:/root/.kube/config:ro --volume $(pwd):/data quay.io/helmpack/chart-testing:v3.7.0 /bin/bash -c "git config --global --add safe.directory /data; ct install --config=.github/ci/ct.yaml --helm-extra-set-args=\"--set=kind=Deployment --set=podSecurityPolicy.create=false\""
37 changes: 0 additions & 37 deletions test/run-helm-tests.sh

This file was deleted.

0 comments on commit ba85e79

Please sign in to comment.