-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: initiate unit tests and the PR workflow #28
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Test Charts | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- 'charts/**' | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'charts/**' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
unit-tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install Helm | ||
uses: azure/setup-helm@v3 | ||
|
||
- name: Install helm-unittests | ||
run: | | ||
helm plugin install https://github.com/helm-unittest/helm-unittest.git | ||
|
||
- name: Run Unit Tests | ||
run: | | ||
make test | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -132,4 +132,6 @@ Network Trash Folder | |
Temporary Items | ||
.apdisk | ||
|
||
.idea | ||
.idea | ||
**/.debug | ||
**/__snapshot__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,3 +21,4 @@ | |
.idea/ | ||
*.tmproj | ||
.vscode/ | ||
tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,3 +21,4 @@ | |
.idea/ | ||
*.tmproj | ||
.vscode/ | ||
tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
suite: Test azblob secret | ||
templates: | ||
- templates/azblob-secret.yaml | ||
chart: | ||
appVersion: 1.0.0 | ||
version: 0.0.1 | ||
tests: | ||
- it: disabled azblob should not render secret | ||
set: | ||
stateStore: | ||
azblob: | ||
enabled: false | ||
asserts: | ||
- hasDocuments: | ||
count: 0 | ||
- it: azblob authenticating with service account should not render secret | ||
set: | ||
stateStore: | ||
minio: | ||
enabled: false | ||
azblob: | ||
enabled: true | ||
authentication: | ||
useServiceAccount: true | ||
asserts: | ||
- hasDocuments: | ||
count: 0 | ||
- it: azblob authenticating with existing secret should not render secret | ||
set: | ||
stateStore: | ||
minio: | ||
enabled: false | ||
azblob: | ||
enabled: true | ||
authentication: | ||
useServiceAccount: false | ||
existingSecretName: AZBLOB_SECRET | ||
asserts: | ||
- hasDocuments: | ||
count: 0 | ||
- it: azblob authenticating with credentials should pass | ||
set: | ||
stateStore: | ||
minio: | ||
enabled: false | ||
azblob: | ||
enabled: true | ||
authentication: | ||
useServiceAccount: false | ||
accountName: ACCOUNT_NAME | ||
accountKey: ACCOUNT_KEY | ||
asserts: | ||
- hasDocuments: | ||
count: 1 | ||
- containsDocument: | ||
apiVersion: v1 | ||
kind: Secret | ||
- equal: | ||
path: metadata.name | ||
value: RELEASE-NAME-risingwave-azblob | ||
- isSubset: | ||
path: metadata.labels | ||
content: | ||
helm.sh/chart: risingwave-0.0.1 | ||
app.kubernetes.io/name: risingwave | ||
app.kubernetes.io/managed-by: Helm | ||
app.kubernetes.io/version: 1.0.0 | ||
app.kubernetes.io/instance: RELEASE-NAME | ||
- notExists: | ||
path: metadata.annotations | ||
- equal: | ||
path: stringData | ||
value: | ||
AZBLOB_ACCOUNT_NAME: "ACCOUNT_NAME" | ||
AZBLOB_ACCOUNT_KEY: "ACCOUNT_KEY" | ||
- it: common labels and annotations should work | ||
set: | ||
commonLabels: | ||
LABEL: LABEL_V | ||
commonAnnotations: | ||
ANNOTATION: ANNOTATION_V | ||
stateStore: | ||
minio: | ||
enabled: false | ||
azblob: | ||
enabled: true | ||
asserts: | ||
- isSubset: | ||
path: metadata.labels | ||
content: | ||
LABEL: LABEL_V | ||
- exists: | ||
path: metadata.annotations | ||
- isSubset: | ||
path: metadata.annotations | ||
content: | ||
ANNOTATION: ANNOTATION_V |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
suite: Test etcd secret | ||
templates: | ||
- templates/etcd-secret.yaml | ||
chart: | ||
appVersion: 1.0.0 | ||
version: 0.0.1 | ||
tests: | ||
- it: bundled etcd should not render secret | ||
set: | ||
tags.etcd: true | ||
metaStore.etcd.authentication.enabled: true | ||
asserts: | ||
- hasDocuments: | ||
count: 0 | ||
- it: external etcd without authentication should not render secret | ||
set: | ||
tags.etcd: false | ||
metaStore.etcd.authentication.enabled: false | ||
template: etcd-secret.yaml | ||
asserts: | ||
- hasDocuments: | ||
count: 0 | ||
- it: external etcd with authentication should pass | ||
set: | ||
tags.etcd: false | ||
metaStore: | ||
etcd: | ||
endpoints: | ||
- external-etcd:1234 | ||
authentication: | ||
enabled: true | ||
username: USERNAME | ||
password: PASSWORD | ||
asserts: | ||
- hasDocuments: | ||
count: 1 | ||
- containsDocument: | ||
apiVersion: v1 | ||
kind: Secret | ||
- equal: | ||
path: metadata.name | ||
value: RELEASE-NAME-risingwave-etcd | ||
- isSubset: | ||
path: metadata.labels | ||
content: | ||
helm.sh/chart: risingwave-0.0.1 | ||
app.kubernetes.io/name: risingwave | ||
app.kubernetes.io/managed-by: Helm | ||
app.kubernetes.io/version: 1.0.0 | ||
app.kubernetes.io/instance: RELEASE-NAME | ||
- notExists: | ||
path: metadata.annotations | ||
- equal: | ||
path: stringData | ||
value: | ||
RW_ETCD_USERNAME: "USERNAME" | ||
RW_ETCD_PASSWORD: "PASSWORD" | ||
- it: external etcd with authentication contains common labels and annotations | ||
set: | ||
tags.etcd: false | ||
commonLabels: | ||
LABEL: LABEL_V | ||
commonAnnotations: | ||
ANNOTATION: ANNOTATION_V | ||
metaStore: | ||
etcd: | ||
endpoints: | ||
- external-etcd:1234 | ||
authentication: | ||
enabled: true | ||
username: USERNAME | ||
password: PASSWORD | ||
asserts: | ||
- isSubset: | ||
path: metadata.labels | ||
content: | ||
LABEL: LABEL_V | ||
- exists: | ||
path: metadata.annotations | ||
- isSubset: | ||
path: metadata.annotations | ||
content: | ||
ANNOTATION: ANNOTATION_V |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
suite: Test gcs secret | ||
templates: | ||
- templates/gcs-secret.yaml | ||
chart: | ||
appVersion: 1.0.0 | ||
version: 0.0.1 | ||
tests: | ||
- it: disabled gcs should not render secret | ||
set: | ||
stateStore: | ||
gcs: | ||
enabled: false | ||
asserts: | ||
- hasDocuments: | ||
count: 0 | ||
- it: gcs authenticating with service account should not render secret | ||
set: | ||
stateStore: | ||
minio: | ||
enabled: false | ||
gcs: | ||
enabled: true | ||
authentication: | ||
useServiceAccount: true | ||
asserts: | ||
- hasDocuments: | ||
count: 0 | ||
- it: gcs authenticating with existing secret should not render secret | ||
set: | ||
stateStore: | ||
minio: | ||
enabled: false | ||
gcs: | ||
enabled: true | ||
authentication: | ||
useServiceAccount: false | ||
existingSecretName: GCS_SECRET | ||
asserts: | ||
- hasDocuments: | ||
count: 0 | ||
- it: gcs authenticating with credentials should pass | ||
set: | ||
stateStore: | ||
minio: | ||
enabled: false | ||
gcs: | ||
enabled: true | ||
authentication: | ||
useServiceAccount: false | ||
credentials: CREDENTIALS | ||
asserts: | ||
- hasDocuments: | ||
count: 1 | ||
- containsDocument: | ||
apiVersion: v1 | ||
kind: Secret | ||
- equal: | ||
path: metadata.name | ||
value: RELEASE-NAME-risingwave-gcs | ||
- isSubset: | ||
path: metadata.labels | ||
content: | ||
helm.sh/chart: risingwave-0.0.1 | ||
app.kubernetes.io/name: risingwave | ||
app.kubernetes.io/managed-by: Helm | ||
app.kubernetes.io/version: 1.0.0 | ||
app.kubernetes.io/instance: RELEASE-NAME | ||
- notExists: | ||
path: metadata.annotations | ||
- equal: | ||
path: stringData | ||
value: | ||
GOOGLE_APPLICATION_CREDENTIALS: "CREDENTIALS" | ||
- it: common labels and annotations should work | ||
set: | ||
commonLabels: | ||
LABEL: LABEL_V | ||
commonAnnotations: | ||
ANNOTATION: ANNOTATION_V | ||
stateStore: | ||
minio: | ||
enabled: false | ||
gcs: | ||
enabled: true | ||
asserts: | ||
- isSubset: | ||
path: metadata.labels | ||
content: | ||
LABEL: LABEL_V | ||
- exists: | ||
path: metadata.annotations | ||
- isSubset: | ||
path: metadata.annotations | ||
content: | ||
ANNOTATION: ANNOTATION_V |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: newline at the end of the file (or make it consistent across all files)