Skip to content

Commit

Permalink
test: add chainsaw basic test (#1415)
Browse files Browse the repository at this point in the history
* test: add chainsaw basic test

Signed-off-by: Charles-Edouard Brétéché <[email protected]>

* fix debug logs

Signed-off-by: Charles-Edouard Brétéché <[email protected]>

* fix debug logs

Signed-off-by: Charles-Edouard Brétéché <[email protected]>

* fix debug logs

Signed-off-by: Charles-Edouard Brétéché <[email protected]>

* fix debug logs

Signed-off-by: Charles-Edouard Brétéché <[email protected]>

* fix debug logs

Signed-off-by: Charles-Edouard Brétéché <[email protected]>

---------

Signed-off-by: Charles-Edouard Brétéché <[email protected]>
Co-authored-by: Hubert Stefanski <[email protected]>
  • Loading branch information
eddycharly and hubeadmin authored Feb 21, 2024
1 parent e1aa86d commit bbf504a
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 0 deletions.
37 changes: 37 additions & 0 deletions tests/e2e/examples/basic/assertions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: grafana-deployment
ownerReferences:
- apiVersion: grafana.integreatly.org/v1beta1
kind: Grafana
name: grafana
spec: {}
---
apiVersion: v1
kind: Service
metadata:
name: grafana-service
ownerReferences:
- apiVersion: grafana.integreatly.org/v1beta1
kind: Grafana
name: grafana
spec: {}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: grafana-ini
ownerReferences:
- apiVersion: grafana.integreatly.org/v1beta1
kind: Grafana
name: grafana
---
apiVersion: v1
kind: ConfigMap
metadata:
name: grafana-plugins
ownerReferences:
- apiVersion: grafana.integreatly.org/v1beta1
kind: Grafana
name: grafana
13 changes: 13 additions & 0 deletions tests/e2e/examples/basic/chainsaw-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/kyverno/chainsaw/main/.schemas/json/test-chainsaw-v1alpha1.json
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
name: basic
spec:
steps:
- name: step-00
try:
- apply:
file: resources.yaml
- assert:
file: assertions.yaml
55 changes: 55 additions & 0 deletions tests/e2e/examples/basic/resources.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
apiVersion: grafana.integreatly.org/v1beta1
kind: Grafana
metadata:
name: grafana
labels:
dashboards: "grafana"
spec:
config:
log:
mode: "console"
auth:
disable_login_form: "false"
security:
admin_user: root
admin_password: secret
---
apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaDashboard
metadata:
name: grafanadashboard-sample
spec:
resyncPeriod: 30s
instanceSelector:
matchLabels:
dashboards: "grafana"
json: >
{
"id": null,
"title": "Simple Dashboard",
"tags": [],
"style": "dark",
"timezone": "browser",
"editable": true,
"hideControls": false,
"graphTooltip": 1,
"panels": [],
"time": {
"from": "now-6h",
"to": "now"
},
"timepicker": {
"time_options": [],
"refresh_intervals": []
},
"templating": {
"list": []
},
"annotations": {
"list": []
},
"refresh": "5s",
"schemaVersion": 17,
"version": 0,
"links": []
}

0 comments on commit bbf504a

Please sign in to comment.