Skip to content

Commit

Permalink
test(chart): CI tests verify the supports on different Helm versions
Browse files Browse the repository at this point in the history
Signed-off-by: Viet Nguyen Duc <[email protected]>
  • Loading branch information
VietND96 committed Mar 2, 2024
1 parent 37cefa4 commit 2fe2215
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 30 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/helm-chart-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,28 @@ jobs:
- k8s-version: 'v1.25.16'
test-strategy: job
cluster: 'kind'
helm-version: 'v3.10.3'
- k8s-version: 'v1.26.14'
test-strategy: deployment
cluster: 'kind'
helm-version: 'v3.11.3'
- k8s-version: 'v1.27.11'
test-strategy: job_https
cluster: 'kind'
helm-version: 'v3.12.3'
- k8s-version: 'v1.28.7'
test-strategy: job_hostname
cluster: 'minikube'
helm-version: 'v3.13.3'
- k8s-version: 'v1.29.2'
test-strategy: deployment_https
cluster: 'minikube'
helm-version: 'v3.14.2'
env:
CLUSTER: ${{ matrix.cluster }}
KUBERNETES_VERSION: ${{ matrix.k8s-version }}
ARTIFACT_NAME: ${{ matrix.k8s-version }}-${{ matrix.test-strategy }}
HELM_VERSION: ${{ matrix.helm-version }}
steps:
- uses: actions/checkout@main
- name: Output Docker info
Expand Down Expand Up @@ -82,7 +88,7 @@ jobs:
with:
timeout_minutes: 10
max_attempts: 3
command: CLUSTER=${CLUSTER} make chart_setup_env
command: CLUSTER=${CLUSTER} HELM_VERSION=${HELM_VERSION} make chart_setup_env
- name: Build Helm charts
run: |
BUILD_DATE=${BUILD_DATE} make chart_build
Expand Down
2 changes: 2 additions & 0 deletions generate_chart_changelog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ generate_changelog() {
# Get the changes for each section (Added, Removed, Fixed, Changed)
image_tag_changes=$(echo "Chart is using image tag $CHART_APP_VERSION" | sed -e 's/^/- /')
k8s_versions_tested=$(echo "Chart is tested on Kubernetes versions: $(cat .github/workflows/helm-chart-test.yml | grep -oP "k8s-version: '\Kv.*(?=')" | tr '\n' ' ')" | sed -e 's/^/- /')
helm_versions_tested=$(echo "Chart is tested on Helm versions: $(cat .github/workflows/helm-chart-test.yml | grep -oP "helm-version: '\Kv.*(?=')" | tr '\n' ' ')" | sed -e 's/^/- /')
added_changes=$(git log --pretty=format:"%s :: %an" "$commit_range" -- "$CHART_DIR" | grep -iE "^feat|^add" | sed -e 's/^/- /')
removed_changes=$(git log --pretty=format:"%s :: %an" "$commit_range" -- "$CHART_DIR" | grep -iE "^remove|^deprecate|^delete" | sed -e 's/^/- /')
fixed_changes=$(git log --pretty=format:"%s :: %an" "$commit_range" -- "$CHART_DIR" | grep -iE "^fix|^bug" | sed -e 's/^/- /')
Expand All @@ -52,6 +53,7 @@ generate_changelog() {
echo "" >> "$temp_file"
echo "$image_tag_changes" >> "$temp_file"
echo "$k8s_versions_tested" >> "$temp_file"
echo "$helm_versions_tested" >> "$temp_file"
echo "" >> "$temp_file"

if [ -n "$added_changes" ]; then
Expand Down
18 changes: 0 additions & 18 deletions tests/charts/ci/base-resources-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,6 @@ chromeNode:
limits:
cpu: 250m
memory: 2500Mi
startupProbe:
initialDelaySeconds: 0
periodSeconds: 5
timeoutSeconds: 400
failureThreshold: 80
successThreshold: 1

firefoxNode:
resources:
Expand All @@ -72,12 +66,6 @@ firefoxNode:
limits:
cpu: 250m
memory: 2500Mi
startupProbe:
initialDelaySeconds: 0
periodSeconds: 5
timeoutSeconds: 400
failureThreshold: 80
successThreshold: 1

edgeNode:
resources:
Expand All @@ -87,12 +75,6 @@ edgeNode:
limits:
cpu: 250m
memory: 2500Mi
startupProbe:
initialDelaySeconds: 0
periodSeconds: 5
timeoutSeconds: 400
failureThreshold: 80
successThreshold: 1

videoRecorder:
resources:
Expand Down
23 changes: 12 additions & 11 deletions tests/charts/make/chart_setup_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,17 @@ trap 'on_failure' ERR

if [ "$(uname -m)" = "x86_64" ]; then
echo "Installing Docker for AMD64 / x86_64"
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo apt-get update -qq
sudo apt-get install -yq ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo apt-get install -yq docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo docker version
echo "==============================="
if [ "${CLUSTER}" = "kind" ]; then
echo "Installing kind for AMD64 / x86_64"
Expand Down Expand Up @@ -104,10 +102,13 @@ if [ "$(uname -m)" = "x86_64" ]; then
echo "==============================="

echo "Installing Helm for AMD64 / x86_64"
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
rm -rf get_helm.sh
HELM_VERSION=${HELM_VERSION:-"v3.14.2"}
curl -fsSL -o helm.tar.gz https://get.helm.sh/helm-${HELM_VERSION}-linux-amd64.tar.gz
mkdir -p helm
tar -xf helm.tar.gz --strip-components 1 -C helm
sudo cp -frp helm/helm /usr/local/bin/helm
sudo ln -sf /usr/local/bin/helm /usr/bin/helm
rm -rf helm.tar.gz helm
helm version
echo "==============================="

Expand All @@ -123,7 +124,7 @@ if [ "$(uname -m)" = "x86_64" ]; then
ct version
echo "==============================="
echo "Installing envsubst for AMD64 / x86_64"
curl -L https://github.com/a8m/envsubst/releases/download/v1.4.2/envsubst-`uname -s`-`uname -m` -o envsubst
curl -fsSL https://github.com/a8m/envsubst/releases/download/v1.4.2/envsubst-`uname -s`-`uname -m` -o envsubst
chmod +x envsubst
sudo mv envsubst /usr/local/bin
sudo ln -sf /usr/local/bin/envsubst /usr/bin/envsubst
Expand Down

0 comments on commit 2fe2215

Please sign in to comment.