Skip to content
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

Formatting updates, prep for improved testing #9

Merged
merged 1 commit into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: 3.7

- name: Install helm-unittest plugin
run: helm plugin install https://github.com/helm-unittest/helm-unittest

- name: Install chart-testing
uses: helm/[email protected]
Expand All @@ -32,6 +35,19 @@ jobs:
- name: Run chart-testing (lint)
run: ct lint

- name: Get changed charts
id: changed-charts
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
base_ref=${{ github.base_ref }}
else
base_ref=$(git rev-parse HEAD^)
fi

changed_charts=$(git diff --find-renames --name-only $base_ref -- charts | grep Chart.yaml | xargs -L1 dirname | sort -u)
echo "Changed charts: $changed_charts"
echo "changed_charts=$changed_charts" >> $GITHUB_OUTPUT

- name: Create kind cluster
uses: helm/[email protected]
if: steps.list-changed.outputs.changed == 'true'
Expand Down
5 changes: 4 additions & 1 deletion charts/goalert/.helmignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,7 @@ img/
# Changelog
CHANGELOG.md
package-lock.json
package.json
package.json
# Testing
docker-compose.yaml
tests
8 changes: 8 additions & 0 deletions charts/goalert/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: '3'
services:
unit-test:
image: helmunittest/helm-unittest
volumes:
- ./:/app
working_dir: /app
entrypoint: helm unittest . -q -f tests/**/*.yml
30 changes: 30 additions & 0 deletions charts/supabase/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
# img folder
img/
# Changelog
CHANGELOG.md
package-lock.json
package.json
# Testing
docker-compose.yaml
tests
12 changes: 6 additions & 6 deletions charts/supabase/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ maintainers:
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.0.6
version: 0.0.7

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand All @@ -29,9 +29,9 @@ version: 0.0.6
# A URL to an SVG or PNG image to be used as an icon
icon: https://avatars.githubusercontent.com/u/54469796?s=280&v=4
annotations:
artifacthub.io/valuesSchema: "false"
licenses: Apache-2.0
artifacthub.io/category: integration-delivery
artifacthub.io/signKey: |
artifacthub.io/valuesSchema: "false"
licenses: Apache-2.0
artifacthub.io/category: integration-delivery
artifacthub.io/signKey: |
fingerprint: 2F0E91FEE1AC982E/2F0E91FEE1AC982E
url: https://keybase.io/tokensstudio/pgp_keys.asc
url: https://keybase.io/tokensstudio/pgp_keys.asc
8 changes: 8 additions & 0 deletions charts/supabase/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: '3'
services:
unit-test:
image: helmunittest/helm-unittest
volumes:
- ./:/app
working_dir: /app
entrypoint: helm unittest . -q -f tests/**/*.yml
17 changes: 17 additions & 0 deletions charts/supabase/tests/auth/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
suite: test auth deployment
templates:
- auth/deployment.yaml
tests:
- it: should set numeric values correctly
set:
# Note. Do not use raw numbers as it will likely convert it to scientific notation if the numbber gets too large
auth:
environment:
GOTRUE_JWT_EXP: '18748800'

asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: GOTRUE_JWT_EXP
value: '18748800'
2 changes: 2 additions & 0 deletions ct.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# See https://github.com/helm/chart-testing#configuration
remote: origin
target-branch: master
chart-dirs:
- charts
use-helmignore: true
12 changes: 10 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
version: '3'
services:
chart-testing:
lint:
image: quay.io/helmpack/chart-testing
volumes:
- ./:/charts
working_dir: /charts
entrypoint: ct lint --config ct.yaml
entrypoint: ct lint --config ct.yaml
test:
image: quay.io/helmpack/chart-testing
volumes:
- ./:/charts
working_dir: /charts
entrypoint: ct install --config ct.yaml
# Note you will need to expose your kubernetes service to the container
network_mode: host
Loading