[bitnami/grafana-image-renderer] Add VIB tests (#30675)

* [bitnami/grafana-image-renderer] Add first version of tests

Signed-off-by: Cori Avila <amisericordi@vmware.com>

* [bitnami/grafana-image-renderer] Add app version check and directories check

Signed-off-by: Cori Avila <amisericordi@vmware.com>

* [bitnami/grafana-image-renderer] Add change in docker-compose to trigger tests

Signed-off-by: Cori Avila <amisericordi@vmware.com>

* [bitnami/grafana-image-renderer] Delete change in docker-compose

Signed-off-by: Cori Avila <amisericordi@vmware.com>

* [bitnami/grafana-image-renderer] Delete mode value and add check-build-app test

Signed-off-by: Cori Avila <amisericordi@vmware.com>

* [bitnami/grafana-image-renderer] Add change in docker-compose to trigger tests

Signed-off-by: Cori Avila <amisericordi@vmware.com>

* [bitnami/grafana-image-renderer] Delete changes in docker-compose

Signed-off-by: corico44 <42420333+corico44@users.noreply.github.com>

---------

Signed-off-by: Cori Avila <amisericordi@vmware.com>
Signed-off-by: corico44 <42420333+corico44@users.noreply.github.com>
This commit is contained in:
corico44
2023-04-19 16:16:37 +02:00
committed by GitHub
parent 5e49f45ac8
commit fd23105d21
5 changed files with 68 additions and 2 deletions

View File

@@ -0,0 +1,12 @@
gossfile:
# Goss tests exclusive to the current container
../../grafana-image-renderer/goss/grafana-image-renderer.yaml: {}
# Load scripts from .vib/common/goss/templates
../../common/goss/templates/check-binaries.yaml: {}
../../common/goss/templates/check-broken-symlinks.yaml: {}
../../common/goss/templates/check-ca-certs.yaml: {}
../../common/goss/templates/check-directories.yaml: {}
../../common/goss/templates/check-files.yaml: {}
../../common/goss/templates/check-linked-libraries.yaml: {}
../../common/goss/templates/check-sed-in-place.yaml: {}
../../common/goss/templates/check-spdx.yaml: {}

View File

@@ -0,0 +1,9 @@
command:
check-app-version:
exec: grep -A2 '"version"' /opt/bitnami/grafana-image-renderer/plugin.json | grep -o "[0-9]*\.[0-9]*\.[0-9]"
exit-status: 0
stdout:
- {{ .Env.APP_VERSION }}
check-build-app:
exec: timeout --preserve-status 3 node /opt/bitnami/grafana-image-renderer/build/app.js server --config=/opt/bitnami/grafana-image-renderer/conf/config.json
exit-status: 143

View File

@@ -0,0 +1,13 @@
binaries:
- node
- python
directories:
- paths:
- /opt/bitnami/grafana-image-renderer/build
- /opt/bitnami/grafana-image-renderer/node_modules
- /opt/bitnami/grafana-image-renderer/proto
files:
- paths:
- /opt/bitnami/grafana-image-renderer/conf/config.json
- /opt/bitnami/grafana-image-renderer/plugin.json
root_dir: /opt/bitnami

View File

@@ -3,7 +3,8 @@
"resources": {
"url": "{VIB_ENV_CONTAINER_URL}",
"path": "{VIB_ENV_PATH}"
}
},
"runtime_parameters": "Y29tbWFuZDogWyJ0YWlsIiwgIi1mIiwgIi9kZXYvbnVsbCJd"
},
"phases": {
"package": {
@@ -32,6 +33,21 @@
},
"verify": {
"actions": [
{
"action_id": "goss",
"params": {
"resources": {
"path": "/.vib"
},
"tests_file": "grafana-image-renderer/goss/goss.yaml",
"vars_file": "grafana-image-renderer/goss/vars.yaml",
"remote": {
"pod": {
"workload": "deploy-grafana-image-renderer"
}
}
}
},
{
"action_id": "trivy",
"params": {

View File

@@ -3,7 +3,8 @@
"resources": {
"url": "{SHA_ARCHIVE}",
"path": "{VIB_ENV_PATH}"
}
},
"runtime_parameters": "Y29tbWFuZDogWyJ0YWlsIiwgIi1mIiwgIi9kZXYvbnVsbCJd"
},
"phases": {
"package": {
@@ -29,6 +30,21 @@
},
"verify": {
"actions": [
{
"action_id": "goss",
"params": {
"resources": {
"path": "/.vib"
},
"tests_file": "grafana-image-renderer/goss/goss.yaml",
"vars_file": "grafana-image-renderer/goss/vars.yaml",
"remote": {
"pod": {
"workload": "deploy-grafana-image-renderer"
}
}
}
},
{
"action_id": "trivy",
"params": {