mirror of
https://github.com/bitnami/charts.git
synced 2026-02-20 03:58:02 +08:00
[bitnami/rabbitmq-cluster-operator] Add tests and publishing using VIB (#12772)
* [bitnami/rabbitmq-cluster-operator] Add tests and publishing using VIB Signed-off-by: FraPazGal <fdepaz@vmware.com> * Chart bump and added entry to cd pipeline Signed-off-by: FraPazGal <fdepaz@vmware.com> * Fix goss typo Signed-off-by: FraPazGal <fdepaz@vmware.com> Signed-off-by: FraPazGal <fdepaz@vmware.com>
This commit is contained in:
committed by
GitHub
parent
e114fedb35
commit
927ffada38
1
.github/workflows/cd-pipeline.yml
vendored
1
.github/workflows/cd-pipeline.yml
vendored
@@ -64,6 +64,7 @@ on: # rebuild any PRs and main branch changes
|
||||
- 'bitnami/postgresql-ha/**'
|
||||
- 'bitnami/prestashop/**'
|
||||
- 'bitnami/pytorch/**'
|
||||
- 'bitnami/rabbitmq-cluster-operator/**'
|
||||
- 'bitnami/rabbitmq/**'
|
||||
- 'bitnami/redis-cluster/**'
|
||||
- 'bitnami/redis/**'
|
||||
|
||||
7
.vib/rabbitmq-cluster-operator/cypress/cypress.json
Normal file
7
.vib/rabbitmq-cluster-operator/cypress/cypress.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"baseUrl": "http://localhost",
|
||||
"env": {
|
||||
"username": "test_user",
|
||||
"password": "ComplicatedPassword123!4"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"newExchange": {
|
||||
"name": "testExchange",
|
||||
"argument1": "A",
|
||||
"argument2": "B"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"newMessage": {
|
||||
"payload": "This is my first message"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
/// <reference types="cypress" />
|
||||
import { random } from '../support/utils';
|
||||
|
||||
it('allows uploading broker definitions', () => {
|
||||
cy.login();
|
||||
cy.contains('Import definitions').click();
|
||||
cy.get('[type="file"]').selectFile(
|
||||
'cypress/fixtures/broker-definitions.json'
|
||||
);
|
||||
cy.contains('input', 'Upload').click();
|
||||
cy.get('.form-popup-warn').should('not.exist');
|
||||
cy.contains('imported successfully');
|
||||
});
|
||||
|
||||
it('allows publishing a message to a created exchange', () => {
|
||||
cy.login();
|
||||
cy.visit('/#/exchanges');
|
||||
cy.contains('Add a new exchange').click();
|
||||
cy.fixture('exchanges').then((exchange) => {
|
||||
cy.get('[name="name"]').type(`${exchange.newExchange.name}${random}`);
|
||||
cy.get('#arguments_1_mfkey').type(exchange.newExchange.argument1);
|
||||
cy.get('#arguments_1_mfvalue').type(exchange.newExchange.argument2);
|
||||
cy.contains('Add exchange').click({ force: true });
|
||||
cy.reload();
|
||||
cy.contains('a', `${exchange.newExchange.name}${random}`).click();
|
||||
});
|
||||
cy.contains('h2', 'Publish').click();
|
||||
cy.fixture('messages').then((message) => {
|
||||
cy.get('textarea').type(message.newMessage.payload);
|
||||
});
|
||||
cy.contains('input', 'Publish').click();
|
||||
cy.contains('Message published');
|
||||
});
|
||||
@@ -0,0 +1,23 @@
|
||||
const COMMAND_DELAY = 2000;
|
||||
|
||||
for (const command of ['click']) {
|
||||
Cypress.Commands.overwrite(command, (originalFn, ...args) => {
|
||||
const origVal = originalFn(...args);
|
||||
|
||||
return new Promise((resolve) => {
|
||||
setTimeout(() => {
|
||||
resolve(origVal);
|
||||
}, COMMAND_DELAY);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Cypress.Commands.add(
|
||||
'login',
|
||||
(username = Cypress.env('username'), password = Cypress.env('password')) => {
|
||||
cy.visit('/');
|
||||
cy.get('[name="username"]').type(username);
|
||||
cy.get('[name="password"]').type(password);
|
||||
cy.contains('Login').click();
|
||||
}
|
||||
);
|
||||
@@ -0,0 +1,20 @@
|
||||
// ***********************************************************
|
||||
// This example support/index.js is processed and
|
||||
// loaded automatically before your test files.
|
||||
//
|
||||
// This is a great place to put global configuration and
|
||||
// behavior that modifies Cypress.
|
||||
//
|
||||
// You can change the location of this file or turn off
|
||||
// automatically serving support files with the
|
||||
// 'supportFile' configuration option.
|
||||
//
|
||||
// You can read more here:
|
||||
// https://on.cypress.io/configuration
|
||||
// ***********************************************************
|
||||
|
||||
// Import commands.js using ES2015 syntax:
|
||||
import './commands';
|
||||
|
||||
// Alternatively you can use CommonJS syntax:
|
||||
// require('./commands')
|
||||
@@ -0,0 +1,3 @@
|
||||
/// <reference types="cypress" />
|
||||
|
||||
export let random = (Math.random() + 1).toString(36).substring(7);
|
||||
21
.vib/rabbitmq-cluster-operator/goss/goss.yaml
Normal file
21
.vib/rabbitmq-cluster-operator/goss/goss.yaml
Normal file
@@ -0,0 +1,21 @@
|
||||
addr:
|
||||
tcp://ve-testing:{{ .Vars.rabbitmq.service.ports.amqp }}:
|
||||
reachable: true
|
||||
http:
|
||||
http://rmq-op-webhook:{{ .Vars.msgTopologyOperator.service.ports.webhook }}:
|
||||
status: 400
|
||||
http://ve-testing:{{ .Vars.rabbitmq.service.ports.manager }}:
|
||||
status: 200
|
||||
file:
|
||||
/var/run/secrets/kubernetes.io/serviceaccount:
|
||||
exists: true
|
||||
filetype: directory
|
||||
mode: "3777"
|
||||
command:
|
||||
rabbitmqctl-cluster-status:
|
||||
exec: rabbitmqctl cluster_status
|
||||
exit-status: 0
|
||||
stdout:
|
||||
{{ range $e, $i := until .Vars.rabbitmq.replicaCount }}
|
||||
- /ve-testing-server-{{ $i }}.ve-testing-nodes/
|
||||
{{ end }}
|
||||
10
.vib/rabbitmq-cluster-operator/goss/vars.yaml
Normal file
10
.vib/rabbitmq-cluster-operator/goss/vars.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
rabbitmq:
|
||||
replicaCount: 2
|
||||
service:
|
||||
ports:
|
||||
amqp: 5672
|
||||
manager: 15672
|
||||
msgTopologyOperator:
|
||||
service:
|
||||
ports:
|
||||
webhook: 443
|
||||
@@ -22,11 +22,11 @@
|
||||
"url": "{SHA_ARCHIVE}",
|
||||
"path": "/bitnami/rabbitmq-cluster-operator"
|
||||
},
|
||||
"runtime_parameters": "Im1zZ1RvcG9sb2d5T3BlcmF0b3IiOgogICJzZXJ2aWNlIjoKICAgICJwb3J0cyI6CiAgICAgICJ3ZWJob29rIjogNDQzCiAgICAidHlwZSI6ICJMb2FkQmFsYW5jZXIi",
|
||||
"runtime_parameters": "ZXh0cmFEZXBsb3k6Ci0gYXBpVmVyc2lvbjogdjEKICBraW5kOiBTZWNyZXQKICBtZXRhZGF0YToKICAgIG5hbWU6IHZlLXRlc3RpbmctZGVmYXVsdC11c2VyCiAgc3RyaW5nRGF0YToKICAgIGRlZmF1bHRfdXNlci5jb25mOiB8CiAgICAgIGRlZmF1bHRfdXNlciA9IHRlc3RfdXNlcgogICAgICBkZWZhdWx0X3Bhc3MgPSBDb21wbGljYXRlZFBhc3N3b3JkMTIzITQKICAgIHBhc3N3b3JkOiBDb21wbGljYXRlZFBhc3N3b3JkMTIzITQKICAgIHVzZXJuYW1lOiB0ZXN0X3VzZXIKLSBhcGlWZXJzaW9uOiByYWJiaXRtcS5jb20vdjFiZXRhMQogIGtpbmQ6IFJhYmJpdG1xQ2x1c3RlcgogIG1ldGFkYXRhOgogICAgbmFtZTogdmUtdGVzdGluZwogIHNwZWM6CiAgICByZXBsaWNhczogMgogICAgcmVzb3VyY2VzOgogICAgICByZXF1ZXN0czoKICAgICAgICBjcHU6IDEwMG0KICAgICAgICBtZW1vcnk6IDEwME1pCi0gYXBpVmVyc2lvbjogdjEKICBraW5kOiBTZXJ2aWNlCiAgbWV0YWRhdGE6CiAgICBuYW1lOiBleHRyYS1zdmMKICBzcGVjOgogICAgdHlwZTogTG9hZEJhbGFuY2VyCiAgICBwb3J0czoKICAgICAgLSBhcHBQcm90b2NvbDogaHR0cAogICAgICAgIG5hbWU6IG1hbmFnZW1lbnQKICAgICAgICBwb3J0OiA4MAogICAgICAgIHByb3RvY29sOiBUQ1AKICAgICAgICB0YXJnZXRQb3J0OiAxNTY3MgogICAgc2VsZWN0b3I6CiAgICAgIGFwcC5rdWJlcm5ldGVzLmlvL25hbWU6IHZlLXRlc3RpbmcKbXNnVG9wb2xvZ3lPcGVyYXRvcjoKICBmdWxsbmFtZU92ZXJyaWRlOiBybXEtb3AKICBjb250YWluZXJQb3J0czoKICAgIG1ldHJpY3M6IDgwODAKICBzZXJ2aWNlOgogICAgcG9ydHM6CiAgICAgIHdlYmhvb2s6IDQ0MwogICAgdHlwZTogTG9hZEJhbGFuY2Vy",
|
||||
"target_platform": {
|
||||
"target_platform_id": "{VIB_ENV_ALTERNATIVE_TARGET_PLATFORM}",
|
||||
"size": {
|
||||
"name": "S4"
|
||||
"name": "M4"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -34,9 +34,35 @@
|
||||
{
|
||||
"action_id": "health-check",
|
||||
"params": {
|
||||
"endpoint": "lb-rabbitmq-cluster-operator-rabbitmq-messaging-topology-operator-http",
|
||||
"endpoint": "lb-rmq-op-webhook-http",
|
||||
"app_protocol": "HTTP"
|
||||
}
|
||||
},
|
||||
{
|
||||
"action_id": "goss",
|
||||
"params": {
|
||||
"resources": {
|
||||
"path": "/.vib/rabbitmq-cluster-operator/goss"
|
||||
},
|
||||
"remote": {
|
||||
"workload": "sts-ve-testing-server"
|
||||
},
|
||||
"vars_file": "vars.yaml"
|
||||
}
|
||||
},
|
||||
{
|
||||
"action_id": "cypress",
|
||||
"params": {
|
||||
"resources": {
|
||||
"path": "/.vib/rabbitmq-cluster-operator/cypress"
|
||||
},
|
||||
"endpoint": "lb-extra-svc-management",
|
||||
"app_protocol": "HTTP",
|
||||
"env": {
|
||||
"username": "test_user",
|
||||
"password": "ComplicatedPassword123!4"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -22,11 +22,11 @@
|
||||
"url": "{SHA_ARCHIVE}",
|
||||
"path": "/bitnami/rabbitmq-cluster-operator"
|
||||
},
|
||||
"runtime_parameters": "Im1zZ1RvcG9sb2d5T3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XNnVG9wb2xvZ3lPcGVyYXRvcjoKICBmdWxsbmFtZU92ZXJyaWRlOiBybXEtb3AKICBjb250YWluZXJQb3J0czoKICAgIG1ldHJpY3M6IDgwODAKICBzZXJ2aWNlOgogICAgcG9ydHM6CiAgICAgIHdlYmhvb2s6IDQ0MwogICAgdHlwZTogTG9hZEJhbGFuY2Vy",
|
||||
"target_platform": {
|
||||
"target_platform_id": "{VIB_ENV_ALTERNATIVE_TARGET_PLATFORM}",
|
||||
"size": {
|
||||
"name": "S4"
|
||||
"name": "M4"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -34,9 +34,35 @@
|
||||
{
|
||||
"action_id": "health-check",
|
||||
"params": {
|
||||
"endpoint": "lb-rabbitmq-cluster-operator-rabbitmq-messaging-topology-operator-http",
|
||||
"endpoint": "lb-rmq-op-webhook-http",
|
||||
"app_protocol": "HTTP"
|
||||
}
|
||||
},
|
||||
{
|
||||
"action_id": "goss",
|
||||
"params": {
|
||||
"resources": {
|
||||
"path": "/.vib/rabbitmq-cluster-operator/goss"
|
||||
},
|
||||
"remote": {
|
||||
"workload": "sts-ve-testing-server"
|
||||
},
|
||||
"vars_file": "vars.yaml"
|
||||
}
|
||||
},
|
||||
{
|
||||
"action_id": "cypress",
|
||||
"params": {
|
||||
"resources": {
|
||||
"path": "/.vib/rabbitmq-cluster-operator/cypress"
|
||||
},
|
||||
"endpoint": "lb-extra-svc-management",
|
||||
"app_protocol": "HTTP",
|
||||
"env": {
|
||||
"username": "test_user",
|
||||
"password": "ComplicatedPassword123!4"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -26,4 +26,4 @@ name: rabbitmq-cluster-operator
|
||||
sources:
|
||||
- https://github.com/bitnami/containers/tree/main/bitnami/rabbitmq-cluster-operator
|
||||
- https://github.com/rabbitmq/cluster-operator
|
||||
version: 3.0.0
|
||||
version: 3.1.0
|
||||
|
||||
@@ -13,7 +13,7 @@ NOTE: Not using the common function to avoid generating too long names
|
||||
*/}}
|
||||
{{- define "rmqco.msgTopologyOperator.fullname" -}}
|
||||
{{- if .Values.msgTopologyOperator.fullnameOverride -}}
|
||||
{{- .Values.msgTopologyOperator.fullnameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- printf "%s" .Values.msgTopologyOperator.fullnameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else if .Values.fullnameOverride -}}
|
||||
{{- printf "%s-%s" .Values.fullnameOverride "messaging-topology-operator" | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
@@ -21,6 +21,13 @@ NOTE: Not using the common function to avoid generating too long names
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper RabbitMQ Messaging Topology Operator fullname adding the installation's namespace.
|
||||
*/}}
|
||||
{{- define "rmqco.msgTopologyOperator.fullname.namespace" -}}
|
||||
{{- printf "%s-%s" (include "rmqco.msgTopologyOperator.fullname" .) (include "common.names.namespace" .) | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper RabbitMQ Messaging Topology Operator fullname
|
||||
NOTE: Not using the common function to avoid generating too long names
|
||||
@@ -35,6 +42,13 @@ NOTE: Not using the common function to avoid generating too long names
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper RabbitMQ Messaging Topology Operator fullname adding the installation's namespace.
|
||||
*/}}
|
||||
{{- define "rmqco.msgTopologyOperator.webhook.fullname.namespace" -}}
|
||||
{{- printf "%s-%s" (include "rmqco.msgTopologyOperator.webhook.fullname" .) (include "common.names.namespace" .) | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper RabbitMQ Messaging Topology Operator fullname
|
||||
*/}}
|
||||
|
||||
@@ -8,7 +8,7 @@ metadata:
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
name: {{ template "rmqco.clusterOperator.fullname" . }}
|
||||
name: {{ template "common.names.fullname.namespace" . }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
|
||||
@@ -8,14 +8,14 @@ metadata:
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
name: {{ template "rmqco.clusterOperator.fullname" . }}
|
||||
name: {{ template "common.names.fullname.namespace" . }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: {{ template "rmqco.clusterOperator.fullname" . }}
|
||||
name: {{ template "common.names.fullname.namespace" . }}
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: {{ template "rmqco.clusterOperator.serviceAccountName" . }}
|
||||
|
||||
@@ -8,7 +8,7 @@ metadata:
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
name: {{ template "rmqco.msgTopologyOperator.fullname" . }}
|
||||
name: {{ template "rmqco.msgTopologyOperator.fullname.namespace" . }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
|
||||
@@ -8,14 +8,14 @@ metadata:
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
name: {{ template "rmqco.msgTopologyOperator.fullname" . }}
|
||||
name: {{ template "rmqco.msgTopologyOperator.fullname.namespace" . }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: {{ template "rmqco.msgTopologyOperator.fullname" . }}
|
||||
name: {{ template "rmqco.msgTopologyOperator.fullname.namespace" . }}
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: {{ template "rmqco.msgTopologyOperator.serviceAccountName" . }}
|
||||
|
||||
@@ -40,7 +40,7 @@ metadata:
|
||||
{{- if .Values.commonAnnotations }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
name: {{ template "rmqco.msgTopologyOperator.webhook.fullname" . }}
|
||||
name: {{ template "rmqco.msgTopologyOperator.webhook.fullname.namespace" . }}
|
||||
webhooks:
|
||||
- admissionReviewVersions:
|
||||
- v1
|
||||
|
||||
Reference in New Issue
Block a user