-
Notifications
You must be signed in to change notification settings - Fork 284
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AMORO-2778][Helm Chart] Add Tests for Helm Chart (#2794)
* [AMORO-2778] add Tests for Helm Charts * Add Tests for Helm Chart Templates * [AMORO-2778] add Tests for Helm Charts With Lisence * [AMORO-2778][helm chart] fix syntax errors on test names, and add a workflow to run unittest when aubmit pr * [AMORO2778] debug workflow * [AMORO2778] debug workflow * Update .github/workflows/pull-request-on-helmchat.yml Co-authored-by: baiyangtx <xiangnebula@163.com> * Update and rename pull-request-on-helmchat.yml to helm-charts-ci.yml --------- Co-authored-by: baiyangtx <xiangnebula@163.com>
- Loading branch information
Showing
11 changed files
with
1,280 additions
and
3 deletions.
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,60 @@ | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
|
||
# This workflow will execute Tests when submit a PR. | ||
|
||
name: "CI for Helm Charts" | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- 'charts/**' | ||
push: | ||
paths: | ||
- 'charts/**' | ||
merge_group: | ||
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@v4 | ||
|
||
- name: Install helm-unittests | ||
run: | | ||
helm plugin install https://github.com/helm-unittest/helm-unittest.git | ||
- name: Rebuild Chart with Dependency | ||
run: | | ||
cd charts/amoro | ||
helm dependency build | ||
- name: Run Unit Tests | ||
run: | | ||
helm unittest charts/amoro |
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 |
---|---|---|
|
@@ -22,4 +22,5 @@ | |
*.tmproj | ||
.vscode/ | ||
# test files | ||
test-values.yaml | ||
test-values.yaml | ||
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
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,123 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
|
||
suite: Test Amoro ConfigMap | ||
templates: | ||
- amoro-configmap.yaml | ||
chart: | ||
appVersion: 0.1.0 | ||
version: 0.6.0 | ||
tests: | ||
- it: Amoro ConfigMap should override name if set | ||
set: | ||
fullnameOverride: test | ||
asserts: | ||
- containsDocument: | ||
kind: ConfigMap | ||
apiVersion: v1 | ||
name: test | ||
- hasDocuments: | ||
count: 1 | ||
- it: Amoro configMap should reflect jvmOptions | ||
set: | ||
jvmOptions: | ||
xms=8196 | ||
asserts: | ||
- matchRegex: | ||
path: data["jvm.properties"] | ||
pattern: | ||
| | ||
xms=8196 | ||
- it: Amoro configMap should reflect ports | ||
asserts: | ||
- matchRegex: | ||
path: data["config.yaml"] | ||
pattern: | ||
| | ||
bind-port: 1260 | ||
- it: Amoro configMap should reflect database.username if type is set to mysql | ||
set: | ||
amoroConf: | ||
database: | ||
type: mysql | ||
username: aaa | ||
asserts: | ||
- matchRegex: | ||
path: data["config.yaml"] | ||
pattern: | ||
| | ||
username: "aaa" | ||
- it: Amoro configMap should reflect terminal iceberg params if terminal.backend is set to local | ||
set: | ||
amoroConf: | ||
terminal: | ||
backend: local | ||
icebergHandleTimestampWithoutTimezone: true | ||
asserts: | ||
- matchRegex: | ||
path: data["config.yaml"] | ||
pattern: | ||
| | ||
local.spark.sql.iceberg.handle-timestamp-without-timezone: true | ||
- it: Amoro configMap should show kyuubi url if terminal.backend is set to kyuubi | ||
set: | ||
amoroConf: | ||
terminal: | ||
backend: kyuubi | ||
kyuubiJdbcUrl: jdbc:hive2://127.0.0.1:10009/ | ||
asserts: | ||
- matchRegex: | ||
path: data["config.yaml"] | ||
pattern: | ||
| | ||
kyuubi.jdbc.url: "jdbc:hive2://127.0.0.1:10009/" | ||
- it: Amoro configMap should show flink if flink optimizer enabled is set true | ||
set: | ||
optimizer: | ||
flink: | ||
enabled: true | ||
name: flink1 | ||
asserts: | ||
- matchRegex: | ||
path: data["config.yaml"] | ||
pattern: | ||
| | ||
- name: flink1 | ||
- it: Amoro configMap should show spark if spark optimizer enabled is set true | ||
set: | ||
optimizer: | ||
spark: | ||
enabled: true | ||
name: spark1 | ||
asserts: | ||
- matchRegex: | ||
path: data["config.yaml"] | ||
pattern: | ||
| | ||
- name: spark1 | ||
- it: Amoro configMap should show local if local optimizer enabled is set true | ||
set: | ||
optimizer: | ||
local: | ||
enabled: true | ||
name: local1 | ||
asserts: | ||
- matchRegex: | ||
path: data["config.yaml"] | ||
pattern: | ||
| | ||
- name: local1 |
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,86 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
|
||
suite: Test Amoro Database Secret | ||
templates: | ||
- amoro-database-secret.yaml | ||
chart: | ||
appVersion: 0.1.0 | ||
version: 0.6.0 | ||
tests: | ||
- it: Amoro database secret should not exist if database type is set to derby | ||
set: | ||
amoroConf: | ||
database: | ||
type: derby | ||
asserts: | ||
- hasDocuments: | ||
count: 0 | ||
- it: Amoro database secret should exist if database type is set to mysql | ||
set: | ||
fullnameOverride: test | ||
amoroConf: | ||
database: | ||
type: mysql | ||
username: "abc" | ||
password: "123" | ||
asserts: | ||
- containsDocument: | ||
kind: Secret | ||
apiVersion: v1 | ||
name: test | ||
- hasDocuments: | ||
count: 1 | ||
- it: Amoro database secret should exist if database type is set to postgres | ||
set: | ||
fullnameOverride: test | ||
amoroConf: | ||
database: | ||
type: postgres | ||
username: "abc" | ||
password: "123" | ||
asserts: | ||
- containsDocument: | ||
kind: Secret | ||
apiVersion: v1 | ||
name: test | ||
- hasDocuments: | ||
count: 1 | ||
- it: Amoro database secret should reflect username if database type is set to mysql | ||
set: | ||
amoroConf: | ||
database: | ||
type: mysql | ||
username: "abc" | ||
password: "123" | ||
asserts: | ||
- equal: | ||
path: data.username | ||
value: "abc" | ||
decodeBase64: true | ||
- it: Amoro database secret should reflect password if database type is set to mysql | ||
set: | ||
amoroConf: | ||
database: | ||
type: mysql | ||
username: "abc" | ||
password: "123" | ||
asserts: | ||
- equal: | ||
path: data.password | ||
value: "123" | ||
decodeBase64: true |
Oops, something went wrong.