Skip to content

Commit

Permalink
{chart,scripts}: move datasource test to helm chart
Browse files Browse the repository at this point in the history
Signed-off-by: Paweł Krupa (paulfantom) <[email protected]>
  • Loading branch information
paulfantom committed Aug 3, 2022
1 parent 017feb1 commit 6a21c07
Show file tree
Hide file tree
Showing 8 changed files with 215 additions and 433 deletions.
18 changes: 5 additions & 13 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ jobs:
uses: helm/[email protected]

- name: Run chart-testing (lint)
run: ct lint --config ct.yaml
run: make lint

test:
runs-on: ubuntu-latest
strategy:
matrix:
kube-version:
kube:
- "1.23"
- "1.24"
steps:
Expand All @@ -39,23 +39,15 @@ jobs:

- name: Start kuberenetes cluster with cert-manager
env:
KUBE_VERSION: ${{ matrix.kube-version }}
KUBE_VERSION: ${{ matrix.kube }}
run: |
make cert-manager
- name: Wait for cluster to finish bootstraping
run: kubectl wait --for=condition=Ready pods --all --all-namespaces --timeout=300s

- name: Create namespace for installing the chart
run: kubectl create namespace tobs-test

- name: Run chart-testing (install)
run: ct install --config ct.yaml --namespace tobs-test

# TODO(onprem): Figure out a workaround to test datasources as ct just removes
# the chart release after a successful install.
# - name: Check datasources
# run: make check-datasources
- name: Run e2e chart-testing
run: make e2e

test-result:
name: End-to-End Test Results
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.vscode/
.idea/
chart/Chart.lock
chart/charts/*
chart/charts
tmp/
manifests.yaml
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,14 @@ helm-install: cert-manager load-images ## This is a phony target that is used t
helm dep up chart/
helm upgrade --install --wait --timeout 15m test chart/

.PHONY: check-datasources
./scripts/check-datasources.sh
.PHONY: lint
lint: ## Lint helm chart using ct (chart-testing).
ct lint --config ct.yaml

.PHONY: e2e
e2e: ## Run e2e installation tests using ct (chart-testing).
kubectl create ns tobs-test
ct install --config ct.yaml --namespace tobs-test

manifests.yaml:
helm template --namespace test test chart/ > $@
Expand Down
39 changes: 39 additions & 0 deletions chart/ci/default-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This is the default values for the chart to run in CI system and it can be used as
# a base template for other *-values.yaml files. Only resource requests are nullified
# to allow starting the stack on github action runner and prevent issues related
# to pod scheduling due to insufficient host resources.

timescaledb-single:
resources: null

promscale:
resources: null

kube-prometheus-stack:
alertmanager:
alertmanagerSpec:
resources: null
prometheusOperator:
prometheusConfigReloader:
resources: null
resources: null
prometheus:
prometheusSpec:
resources: null
grafana:
resources: null
prometheus:
datasource:
enabled: true
# By default url of data source is set to ts-prom connector instance
# deployed with this chart. If a connector isn't used this should be
# set to the prometheus-server.
url: "http://{{ .Release.Name }}-promscale-connector.{{ .Release.Namespace }}.svc:9201"
kube-state-metrics:
resources: null
prometheus-node-exporter:
resources: null

opentelemetry-operator:
manager:
resources: null
Loading

0 comments on commit 6a21c07

Please sign in to comment.