-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from srl-labs/tests/starting-helm-test-setup
Tests/starting helm test setup
- Loading branch information
Showing
44 changed files
with
1,343 additions
and
80 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
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 |
---|---|---|
|
@@ -19,3 +19,6 @@ | |
.project | ||
.idea/ | ||
*.tmproj | ||
|
||
# ignore | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package default_vaules_test | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
"testing" | ||
|
||
clabernetesconstants "github.com/srl-labs/clabernetes/constants" | ||
|
||
clabernetestesthelper "github.com/srl-labs/clabernetes/testhelper" | ||
) | ||
|
||
func TestMain(m *testing.M) { | ||
clabernetestesthelper.Flags() | ||
|
||
os.Exit(m.Run()) | ||
} | ||
|
||
// TestDefaultValues -- really just here to ensure that we dont accidentally break our charts; this | ||
// will probably be *highly* irritating in times of lots of chart updates, but, once we know the | ||
// template are in a good place we can always just re-generate the "golden" outputs. | ||
func TestClickerEnabled(t *testing.T) { | ||
t.Parallel() | ||
|
||
testName := "clicker-enabled" | ||
|
||
clabernetestesthelper.HelmTest( | ||
t, | ||
testName, | ||
clabernetesconstants.Clabernetes, | ||
fmt.Sprintf("%s-values.yaml", testName), | ||
) | ||
} |
19 changes: 19 additions & 0 deletions
19
charts/clabernetes/tests/clicker/test-fixtures/clicker-enabled-values.yaml
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,19 @@ | ||
--- | ||
# ensure that "global" values (not actually helm globals, but values we pass via yaml anchor) | ||
# are non-default and passed to the clicker cahrt and render properly | ||
appName: &_appName clabernetes-plus-clicker | ||
|
||
# extra labels/annotations that are added to all objects | ||
globalAnnotations: &_globalAnnotations | ||
someannotation: someannotationvalue | ||
annotherannotation: anotherannotationvalue | ||
globalLabels: &_globalLabels | ||
somelabel: somelabelvalue | ||
anotherlabel: anotherlabelvalue | ||
|
||
# ensure that when enabled clicker stuff is rendered | ||
clicker: | ||
enabled: true | ||
appName: *_appName | ||
globalAnnotations: *_globalAnnotations | ||
globalLabels: *_globalLabels |
35 changes: 35 additions & 0 deletions
35
charts/clabernetes/tests/clicker/test-fixtures/golden/_subchart-clicker-clusterrole.yaml
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,35 @@ | ||
--- | ||
# Source: clabernetes/charts/clicker/templates/clusterrole.yaml | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
labels: | ||
chart: "clicker-0.0.16" | ||
release: release-name | ||
heritage: Helm | ||
clabernetes/app: clabernetes-plus-clicker | ||
clabernetes/name: "clabernetes-plus-clicker-clicker-cluster-role" | ||
clabernetes/component: cluster-role | ||
anotherlabel: anotherlabelvalue | ||
somelabel: somelabelvalue | ||
annotations: | ||
annotherannotation: anotherannotationvalue | ||
someannotation: someannotationvalue | ||
name: "clabernetes-plus-clicker-clicker-cluster-role" | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- nodes | ||
verbs: | ||
- "*" | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- pods | ||
verbs: | ||
- get | ||
- list | ||
- create | ||
- watch | ||
- delete |
47 changes: 47 additions & 0 deletions
47
.../clabernetes/tests/clicker/test-fixtures/golden/_subchart-clicker-clusterrolebinding.yaml
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,47 @@ | ||
--- | ||
# Source: clabernetes/charts/clicker/templates/clusterrolebinding.yaml | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: clabernetes-clicker | ||
labels: | ||
chart: "clicker-0.0.16" | ||
release: release-name | ||
heritage: Helm | ||
clabernetes/app: clabernetes-plus-clicker | ||
clabernetes/name: "clabernetes-plus-clicker-clicker-cluster-role-binding" | ||
clabernetes/component: cluster-role-binding | ||
anotherlabel: anotherlabelvalue | ||
somelabel: somelabelvalue | ||
annotations: | ||
annotherannotation: anotherannotationvalue | ||
someannotation: someannotationvalue | ||
subjects: | ||
- kind: ServiceAccount | ||
name: "clabernetes-plus-clicker-clicker-service-account" | ||
namespace: clabernetes | ||
roleRef: | ||
kind: ClusterRole | ||
name: "clabernetes-plus-clicker-cluster-role" | ||
apiGroup: rbac.authorization.k8s.io | ||
--- | ||
# Source: clabernetes/charts/clicker/templates/clusterrolebinding.yaml | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: clabernetes-clicker-nodes | ||
labels: | ||
chart: "clicker-0.0.16" | ||
release: release-name | ||
heritage: Helm | ||
clabernetes/app: clabernetes-plus-clicker | ||
clabernetes/name: "clabernetes-plus-clicker-clicker-cluster-role-binding" | ||
clabernetes/component: cluster-role-binding | ||
subjects: | ||
- kind: ServiceAccount | ||
name: "clabernetes-plus-clicker-clicker-service-account" | ||
namespace: clabernetes | ||
roleRef: | ||
kind: ClusterRole | ||
name: "clabernetes-plus-clicker-clicker-cluster-role" | ||
apiGroup: rbac.authorization.k8s.io |
74 changes: 74 additions & 0 deletions
74
charts/clabernetes/tests/clicker/test-fixtures/golden/_subchart-clicker-job.yaml
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,74 @@ | ||
--- | ||
# Source: clabernetes/charts/clicker/templates/job.yaml | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: clabernetes-plus-clicker-clicker | ||
namespace: clabernetes | ||
labels: | ||
chart: "clicker-0.0.16" | ||
release: release-name | ||
heritage: Helm | ||
clabernetes/app: clabernetes-plus-clicker | ||
clabernetes/name: "clabernetes-plus-clicker-clicker" | ||
clabernetes/component: clicker | ||
anotherlabel: anotherlabelvalue | ||
somelabel: somelabelvalue | ||
annotations: | ||
annotherannotation: anotherannotationvalue | ||
someannotation: someannotationvalue | ||
spec: | ||
template: | ||
metadata: | ||
labels: | ||
chart: "clicker-0.0.16" | ||
release: release-name | ||
heritage: Helm | ||
clabernetes/app: clabernetes-plus-clicker | ||
clabernetes/name: "clabernetes-plus-clicker-clicker" | ||
clabernetes/component: clicker | ||
anotherlabel: anotherlabelvalue | ||
somelabel: somelabelvalue | ||
annotations: | ||
annotherannotation: anotherannotationvalue | ||
someannotation: someannotationvalue | ||
spec: | ||
containers: | ||
- name: clicker | ||
image: "ghcr.io/srl-labs/clabernetes/clabernetes-manager:0.0.16" | ||
imagePullPolicy: IfNotPresent | ||
command: [ | ||
"/clabernetes/manager", | ||
"clicker", | ||
] | ||
env: | ||
- name: APP_NAME | ||
value: clabernetes-plus-clicker | ||
- name: POD_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.name | ||
- name: POD_NAMESPACE | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.namespace | ||
- name: CLICKER_LOGGER_LEVEL | ||
value: info | ||
- name: CLICKER_WORKER_COMMAND | ||
value: /bin/sh | ||
- name: CLICKER_WORKER_SCRIPT | ||
value: echo "hello, there" | ||
- name: CLICKER_WORKER_RESOURCES | ||
value: "requests:\n cpu: 50m\n memory: 128Mi" | ||
- name: CLICKER_GLOBAL_ANNOTATIONS | ||
value: "annotherannotation: anotherannotationvalue\nsomeannotation: someannotationvalue" | ||
- name: CLICKER_GLOBAL_LABELS | ||
value: "anotherlabel: anotherlabelvalue\nsomelabel: somelabelvalue" | ||
resources: | ||
requests: | ||
memory: 128Mi | ||
cpu: 50m | ||
restartPolicy: Never | ||
serviceAccountName: "clabernetes-plus-clicker-clicker-service-account" | ||
backoffLimit: 4 | ||
ttlSecondsAfterFinished: 300 |
19 changes: 19 additions & 0 deletions
19
charts/clabernetes/tests/clicker/test-fixtures/golden/_subchart-clicker-serviceaccount.yaml
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,19 @@ | ||
--- | ||
# Source: clabernetes/charts/clicker/templates/serviceaccount.yaml | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: "clabernetes-plus-clicker-clicker-service-account" | ||
namespace: clabernetes | ||
labels: | ||
chart: "clicker-0.0.16" | ||
release: release-name | ||
heritage: Helm | ||
clabernetes/app: clabernetes-plus-clicker | ||
clabernetes/name: "clabernetes-plus-clicker-clicker-service-account" | ||
clabernetes/component: service-account | ||
anotherlabel: anotherlabelvalue | ||
somelabel: somelabelvalue | ||
annotations: | ||
annotherannotation: anotherannotationvalue | ||
someannotation: someannotationvalue |
20 changes: 20 additions & 0 deletions
20
charts/clabernetes/tests/clicker/test-fixtures/golden/certificate-secret.yaml
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,20 @@ | ||
--- | ||
# Source: clabernetes/templates/certificate-secret.yaml | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
labels: | ||
chart: "clabernetes-0.0.16" | ||
release: release-name | ||
heritage: Helm | ||
clabernetes/app: clabernetes-plus-clicker | ||
clabernetes/name: "clabernetes-plus-clicker-certificate" | ||
clabernetes/component: certificate | ||
clabernetes/part-of: manager | ||
anotherlabel: anotherlabelvalue | ||
somelabel: somelabelvalue | ||
annotations: | ||
annotherannotation: anotherannotationvalue | ||
someannotation: someannotationvalue | ||
name: "clabernetes-plus-clicker-certificate" | ||
data: {} |
70 changes: 70 additions & 0 deletions
70
charts/clabernetes/tests/clicker/test-fixtures/golden/clusterrole.yaml
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,70 @@ | ||
--- | ||
# Source: clabernetes/templates/clusterrole.yaml | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
labels: | ||
chart: "clabernetes-0.0.16" | ||
release: release-name | ||
heritage: Helm | ||
clabernetes/app: clabernetes-plus-clicker | ||
clabernetes/name: "clabernetes-plus-clicker-cluster-role" | ||
clabernetes/component: cluster-role | ||
anotherlabel: anotherlabelvalue | ||
somelabel: somelabelvalue | ||
annotations: | ||
annotherannotation: anotherannotationvalue | ||
someannotation: someannotationvalue | ||
name: "clabernetes-plus-clicker-cluster-role" | ||
rules: | ||
- apiGroups: | ||
- topology.clabernetes | ||
resources: | ||
- "*" | ||
verbs: | ||
- "*" | ||
- apiGroups: | ||
- apiextensions.k8s.io | ||
resources: | ||
- "*" | ||
verbs: | ||
- "*" | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- namespaces | ||
- secrets | ||
- configmaps | ||
- services | ||
verbs: | ||
- get | ||
- list | ||
- create | ||
- update | ||
- delete | ||
- patch | ||
- watch | ||
- apiGroups: | ||
- coordination.k8s.io | ||
resources: | ||
- leases | ||
verbs: | ||
- get | ||
- list | ||
- create | ||
- update | ||
- delete | ||
- patch | ||
- watch | ||
- apiGroups: | ||
- apps | ||
resources: | ||
- deployments | ||
verbs: | ||
- get | ||
- list | ||
- create | ||
- update | ||
- delete | ||
- patch | ||
- watch |
Oops, something went wrong.