Skip to content

Commit

Permalink
Merge pull request #612 from rstudio/move-helm-unittest-files-outside…
Browse files Browse the repository at this point in the history
…-chart-dirs

Place the helm unittests in the same directory structure as lint and install tests
  • Loading branch information
jforest authored Nov 15, 2024
2 parents 766839d + 84f2c74 commit cf2fb56
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 4 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/chart-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,14 @@ jobs:
- name: Install helm unittest plugin
run: helm plugin install --version v0.6.3 https://github.com/helm-unittest/helm-unittest.git

- name: Symlink ci-tests -> tests
run: |
for dir in ci/*/tests; do
dir=${dir#ci/}
dir=${dir%/tests}
ln -s ../../ci/${dir}/tests charts/${dir}/tests
done
- name: Run chart unit tests
id: unittest
run: |
Expand Down
2 changes: 1 addition & 1 deletion charts/rstudio-connect/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: rstudio-connect
description: Official Helm chart for Posit Connect
version: 0.7.15
version: 0.7.16
apiVersion: v2
appVersion: 2024.11.0
icon: https://rstudio.com/wp-content/uploads/2018/10/RStudio-Logo-Flat.png
Expand Down
4 changes: 4 additions & 0 deletions charts/rstudio-connect/NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.7.16

- Change location of helm unittests to `ci/rstudio-connect/tests` so changes to unittest files do not require a chart version bump

## 0.7.15

- Bump Connect version to 2024.11.0
Expand Down
6 changes: 3 additions & 3 deletions charts/rstudio-connect/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Posit Connect

![Version: 0.7.15](https://img.shields.io/badge/Version-0.7.15-informational?style=flat-square) ![AppVersion: 2024.11.0](https://img.shields.io/badge/AppVersion-2024.11.0-informational?style=flat-square)
![Version: 0.7.16](https://img.shields.io/badge/Version-0.7.16-informational?style=flat-square) ![AppVersion: 2024.11.0](https://img.shields.io/badge/AppVersion-2024.11.0-informational?style=flat-square)

#### _Official Helm chart for Posit Connect_

Expand Down Expand Up @@ -30,11 +30,11 @@ To ensure reproducibility in your environment and insulate yourself from future

## Installing the chart

To install the chart with the release name `my-release` at version 0.7.15:
To install the chart with the release name `my-release` at version 0.7.16:

```{.bash}
helm repo add rstudio https://helm.rstudio.com
helm upgrade --install my-release rstudio/rstudio-connect --version=0.7.15
helm upgrade --install my-release rstudio/rstudio-connect --version=0.7.16
```

To explore other chart versions, look at:
Expand Down
63 changes: 63 additions & 0 deletions ci/rstudio-workbench/tests/service_accounts_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
suite: Workbench Service Accounts
templates:
- configmap-general.yaml
- configmap-prestart.yaml
- configmap-secret.yaml
- configmap-session.yaml
- deployment.yaml
tests:
- it: should set the Workbench pod service account when the launcher is enabled
template: deployment.yaml
set:
launcher:
enabled: true
rbac:
serviceAccount:
name: "workbench-service-account"
asserts:
- equal:
path: "spec.template.spec.serviceAccountName"
value: "workbench-service-account"
- it: should set the Workbench pod service account when the launcher is not enabled
template: deployment.yaml
set:
launcher:
enabled: false
rbac:
serviceAccount:
name: "workbench-service-account"
asserts:
- equal:
path: "spec.template.spec.serviceAccountName"
value: "workbench-service-account"
- it: should use the default serviceAccount name when not set
template: deployment.yaml
asserts:
- equal:
path: "spec.template.spec.serviceAccountName"
value: "RELEASE-NAME-rstudio-workbench"
- it: should use the nameOverride as part of the serviceAccount name when nameOverride is set
template: deployment.yaml
set:
nameOverride: "posit-workbench"
asserts:
- equal:
path: "spec.template.spec.serviceAccountName"
value: "RELEASE-NAME-posit-workbench"
- it: should use the fullnameOverride as the serviceAccount name when fullnameOverride is set
template: deployment.yaml
set:
fullnameOverride: "posit-workbench"
asserts:
- equal:
path: "spec.template.spec.serviceAccountName"
value: "posit-workbench"
- it: should use the fullnameOverride as the serviceAccount name when fullnameOverride is set even if nameOverride is set
template: deployment.yaml
set:
fullnameOverride: "posit-workbench"
nameOverride: "old-workbench"
asserts:
- equal:
path: "spec.template.spec.serviceAccountName"
value: "posit-workbench"

0 comments on commit cf2fb56

Please sign in to comment.