Skip to content

Commit

Permalink
Add golden tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zugao committed Oct 13, 2022
1 parent 48a8378 commit 0878352
Show file tree
Hide file tree
Showing 10 changed files with 93 additions and 26 deletions.
6 changes: 3 additions & 3 deletions component/Makefile.vars.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ COMPONENT_SUBDIR ?= $(shell basename ${PWD})
compiled_path ?= compiled/$(COMPONENT_NAME)/$(COMPONENT_NAME)
root_volume ?= -v "$${PWD}/../:/$(COMPONENT_NAME)"
compiled_volume ?= -v "$${PWD}/$(compiled_path):/$(COMPONENT_NAME)"
commodore_args ?= --search-paths . -n $(COMPONENT_NAME)
commodore_args ?= --search-paths . -n $(COMPONENT_NAME) --alias $(instance)

ifneq "$(shell which docker 2>/dev/null)" ""
DOCKER_CMD ?= $(shell which docker)
Expand Down Expand Up @@ -43,5 +43,5 @@ KUBENT_ARGS ?= -c=false --helm2=false --helm3=false -e
KUBENT_IMAGE ?= docker.io/projectsyn/kubent:latest
KUBENT_DOCKER ?= $(DOCKER_CMD) $(DOCKER_ARGS) $(root_volume) --entrypoint=/app/kubent $(KUBENT_IMAGE)

instance ?= defaults
test_instances = tests/defaults.yml
instance ?= exoscale-metrics-collector
test_instances = tests/exoscale-metrics-collector.yml tests/collector-cloudscale-lpg-2.yml
12 changes: 12 additions & 0 deletions component/tests/collector-cloudscale-lpg-2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
applications:
- exoscale-metrics-collector as collector-cloudscale-lpg-2

parameters:
appuio_cloud_reporting:
namespace: 'appuio-cloud-reporting'
database:
name: 'reporting'
host: 'reporting-db.appuio-reporting.svc'
parameters: 'sslmode=disable'
password: 'passw0rd'
port: 5432
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
apiVersion: batch/v1
kind: CronJob
metadata:
labels:
app.kubernetes.io/component: exoscale-metrics-collector
app.kubernetes.io/managed-by: commodore
app.kubernetes.io/name: exoscale-metrics-collector
app.kubernetes.io/part-of: appuio-cloud-reporting
name: collector-cloudscale-lpg-2
namespace: appuio-cloud-reporting
spec:
concurrencyPolicy: Forbid
failedJobsHistoryLimit: 5
jobTemplate:
spec:
template:
spec:
containers:
- args:
- exoscale-metrics-collector
command:
- sh
- -c
env:
- name: password
valueFrom:
secretKeyRef:
key: password
name: reporting-db
- name: username
valueFrom:
secretKeyRef:
key: username
name: reporting-db
- name: ACR_DB_URL
value: postgres://$(username):$(password)@reporting-db.appuio-reporting.svc:5432/reporting?sslmode=disable
envFrom:
- secretRef:
name: credentials-collector-cloudscale-lpg-2
image: ghcr.io/vshn/exoscale-metrics-collector:v0.0.2
name: exoscale-metrics-collector-backfill
resources: {}
restartPolicy: OnFailure
schedule: 10 10,16,20 * * *
successfulJobsHistoryLimit: 3
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
data: {}
kind: Secret
metadata:
annotations: {}
labels:
name: credentials-collector-cloudscale-lpg-2
name: credentials-collector-cloudscale-lpg-2
namespace: appuio-cloud-reporting
stringData:
EXOSCALE_API_KEY: t-silent-test-1234/c-green-test-1234/exoscale-metrics-collector/collector-cloudscale-lpg-2/exoscale-key
EXOSCALE_API_SECRET: t-silent-test-1234/c-green-test-1234/exoscale-metrics-collector/collector-cloudscale-lpg-2/exoscale-secret
K8S_SERVER_URL: t-silent-test-1234/c-green-test-1234/exoscale-metrics-collector/collector-cloudscale-lpg-2/cluster-server
K8S_TOKEN: t-silent-test-1234/c-green-test-1234/exoscale-metrics-collector/collector-cloudscale-lpg-2/cluster-token
type: Opaque

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,9 @@ spec:
name: reporting-db
- name: ACR_DB_URL
value: postgres://$(username):$(password)@reporting-db.appuio-reporting.svc:5432/reporting?sslmode=disable
- name: EXOSCALE_API_KEY
valueFrom:
secretKeyRef:
key: api_key
name: exoscale
- name: EXOSCALE_API_SECRET
valueFrom:
secretKeyRef:
key: api_secret
name: exoscale
envFrom:
- secretRef:
name: credentials-exoscale-metrics-collector
image: ghcr.io/vshn/exoscale-metrics-collector:v0.0.2
name: exoscale-metrics-collector-backfill
resources: {}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
data: {}
kind: Secret
metadata:
annotations: {}
labels:
name: credentials-exoscale-metrics-collector
name: credentials-exoscale-metrics-collector
namespace: appuio-cloud-reporting
stringData:
EXOSCALE_API_KEY: t-silent-test-1234/c-green-test-1234/exoscale-metrics-collector/exoscale-metrics-collector/exoscale-key
EXOSCALE_API_SECRET: t-silent-test-1234/c-green-test-1234/exoscale-metrics-collector/exoscale-metrics-collector/exoscale-secret
K8S_SERVER_URL: t-silent-test-1234/c-green-test-1234/exoscale-metrics-collector/exoscale-metrics-collector/cluster-server
K8S_TOKEN: t-silent-test-1234/c-green-test-1234/exoscale-metrics-collector/exoscale-metrics-collector/cluster-token
type: Opaque

0 comments on commit 0878352

Please sign in to comment.