mirror of
https://github.com/bitnami/charts.git
synced 2026-03-06 06:58:50 +08:00
[bitnami/argo-workflows] Add tests and publishing using VIB (#13329)
* [bitnami/argo-workflows] Add tests and publishing using VIB Signed-off-by: FraPazGal <fdepaz@vmware.com> * Use standard command delay Signed-off-by: FraPazGal <fdepaz@vmware.com> * Remove unused runtime_param Signed-off-by: FraPazGal <fdepaz@vmware.com> * Apply suggestions Signed-off-by: FraPazGal <fdepaz@vmware.com> Signed-off-by: FraPazGal <fdepaz@vmware.com>
This commit is contained in:
committed by
GitHub
parent
1fbb541238
commit
8c1c5a35ed
1
.github/workflows/cd-pipeline.yml
vendored
1
.github/workflows/cd-pipeline.yml
vendored
@@ -7,6 +7,7 @@ on: # rebuild any PRs and main branch changes
|
||||
- 'bitnami/airflow/**'
|
||||
- 'bitnami/apache/**'
|
||||
- 'bitnami/argo-cd/**'
|
||||
- 'bitnami/argo-workflows/**'
|
||||
- 'bitnami/aspnet-core/**'
|
||||
- 'bitnami/cassandra/**'
|
||||
- 'bitnami/cert-manager/**'
|
||||
|
||||
4
.vib/argo-workflows/cypress/cypress.json
Normal file
4
.vib/argo-workflows/cypress/cypress.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"baseUrl": "http://localhost",
|
||||
"defaultCommandTimeout": 60000
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"metadata": {
|
||||
"name": "vib-testing-template-7t1b6",
|
||||
"namespace": "default",
|
||||
"labels": {
|
||||
"vib": "testing"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"workflowMetadata": {
|
||||
"labels": {
|
||||
"vib": "testing"
|
||||
}
|
||||
},
|
||||
"entrypoint": "argosay",
|
||||
"arguments": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "message",
|
||||
"value": "hello argo"
|
||||
}
|
||||
]
|
||||
},
|
||||
"templates": [
|
||||
{
|
||||
"name": "argosay",
|
||||
"inputs": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "message",
|
||||
"value": "{{workflow.parameters.message}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"container": {
|
||||
"name": "main",
|
||||
"image": "argoproj/argosay:v2",
|
||||
"command": [
|
||||
"/argosay"
|
||||
],
|
||||
"args": [
|
||||
"echo",
|
||||
"{{inputs.parameters.message}}"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"ttlStrategy": {
|
||||
"secondsAfterCompletion": 300
|
||||
},
|
||||
"podGC": {
|
||||
"strategy": "OnPodCompletion"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
/// <reference types="cypress" />
|
||||
import { random } from '../support/utils';
|
||||
|
||||
it('allows submitting a workflow using a template created from a file', () => {
|
||||
cy.visit('/workflow-templates');
|
||||
// Closes walkthrough pop-ups
|
||||
cy.get('[class="modal-close"]').click();
|
||||
cy.get('[class="modal-close"]').click();
|
||||
|
||||
cy.contains('New Workflow Template').click();
|
||||
const newWorkflow = 'cypress/fixtures/workflow-template.json';
|
||||
const workflowName = `vib-testing-template-${random}`
|
||||
cy.readFile(newWorkflow).then((obj) => {
|
||||
obj.metadata.name = workflowName;
|
||||
cy.writeFile(newWorkflow, obj);
|
||||
});
|
||||
cy.get('.sliding-panel__body').should('be.visible').within(() => {
|
||||
cy.get('[type="file"]').selectFile(newWorkflow, { force: true });
|
||||
cy.contains('Create').click();
|
||||
});
|
||||
cy.get('.top-bar').should('be.visible').within(() => {
|
||||
cy.contains(workflowName);
|
||||
});
|
||||
|
||||
cy.visit('/workflows');
|
||||
// Closes explanation text
|
||||
cy.contains('a', 'Continue').click();
|
||||
|
||||
cy.contains('Submit New').click({ force: true });
|
||||
cy.get('.sliding-panel__body').should('be.visible').within(() => {
|
||||
cy.get('.select').click();
|
||||
cy.contains(workflowName).click();
|
||||
cy.contains('button', 'Submit').click();
|
||||
});
|
||||
cy.get('[class*="node Succeeded"]').click();
|
||||
});
|
||||
13
.vib/argo-workflows/cypress/cypress/support/commands.js
Normal file
13
.vib/argo-workflows/cypress/cypress/support/commands.js
Normal file
@@ -0,0 +1,13 @@
|
||||
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);
|
||||
});
|
||||
});
|
||||
}
|
||||
20
.vib/argo-workflows/cypress/cypress/support/index.js
Normal file
20
.vib/argo-workflows/cypress/cypress/support/index.js
Normal file
@@ -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')
|
||||
3
.vib/argo-workflows/cypress/cypress/support/utils.js
Normal file
3
.vib/argo-workflows/cypress/cypress/support/utils.js
Normal file
@@ -0,0 +1,3 @@
|
||||
/// <reference types="cypress" />
|
||||
|
||||
export let random = (Math.random() + 1).toString(36).substring(7).toLowerCase();
|
||||
@@ -22,7 +22,7 @@
|
||||
"url": "{SHA_ARCHIVE}",
|
||||
"path": "/bitnami/argo-workflows"
|
||||
},
|
||||
"runtime_parameters": "InBvc3RncmVzcWwiOgogICJwb3N0Z3Jlc3FsUGFzc3dvcmQiOiAiMmI3ZFJncUsiCiJzZXJ2ZXIiOgogICJzZXJ2aWNlIjoKICAgICJwb3J0cyI6CiAgICAgICJodHRwIjogODAKICAgICJ0eXBlIjogIkxvYWRCYWxhbmNlciI=",
|
||||
"runtime_parameters": "cmJhYzoKICBzaW5nbGVOYW1lc3BhY2U6IGZhbHNlCmNyZWF0ZUFnZ3JlZ2F0ZVJvbGVzOiB0cnVlCnNlcnZlcjoKICBlbmFibGVkOiB0cnVlCiAgcmJhYzoKICAgIGNyZWF0ZTogdHJ1ZQogIGF1dGg6CiAgICBlbmFibGVkOiB0cnVlCiAgICBtb2RlOiBzZXJ2ZXIKICBjbHVzdGVyV29ya2Zsb3dUZW1wbGF0ZXM6CiAgICBlbmFibGVkOiB0cnVlCiAgICBlbmFibGVFZGl0aW5nOiB0cnVlCiAgc2VjdXJlOiBmYWxzZQogIHNlcnZpY2U6CiAgICBwb3J0czoKICAgICAgaHR0cDogODAKICAgIHR5cGU6IExvYWRCYWxhbmNlcgp3b3JrZmxvd3M6CiAgcmJhYzoKICAgIGNyZWF0ZTogdHJ1ZQpwb3N0Z3Jlc3FsOgogIGVuYWJsZWQ6IHRydWUKICBzZXJ2aWNlOgogICAgcG9ydHM6CiAgICAgIHBvc3RncmVzcWw6IDU0MzIKbXlzcWw6CiAgZW5hYmxlZDogZmFsc2U=",
|
||||
"target_platform": {
|
||||
"target_platform_id": "{VIB_ENV_TARGET_PLATFORM}",
|
||||
"size": {
|
||||
@@ -37,6 +37,16 @@
|
||||
"endpoint": "lb-argo-workflows-server-http",
|
||||
"app_protocol": "HTTP"
|
||||
}
|
||||
},
|
||||
{
|
||||
"action_id": "cypress",
|
||||
"params": {
|
||||
"resources": {
|
||||
"path": "/.vib/argo-workflows/cypress"
|
||||
},
|
||||
"endpoint": "lb-argo-workflows-server-http",
|
||||
"app_protocol": "HTTP"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
"url": "{SHA_ARCHIVE}",
|
||||
"path": "/bitnami/argo-workflows"
|
||||
},
|
||||
"runtime_parameters": "InBvc3RncmVzcWwiOgogICJwb3N0Z3Jlc3FsUGFzc3dvcmQiOiAiMmI3ZFJncUsiCiJzZXJ2ZXIiOgogICJzZXJ2aWNlIjoKICAgICJwb3J0cyI6CiAgICAgICJodHRwIjogODAKICAgICJ0eXBlIjogIkxvYWRCYWxhbmNlciI=",
|
||||
"runtime_parameters": "cmJhYzoKICBzaW5nbGVOYW1lc3BhY2U6IGZhbHNlCmNyZWF0ZUFnZ3JlZ2F0ZVJvbGVzOiB0cnVlCnNlcnZlcjoKICBlbmFibGVkOiB0cnVlCiAgcmJhYzoKICAgIGNyZWF0ZTogdHJ1ZQogIGF1dGg6CiAgICBlbmFibGVkOiB0cnVlCiAgICBtb2RlOiBzZXJ2ZXIKICBjbHVzdGVyV29ya2Zsb3dUZW1wbGF0ZXM6CiAgICBlbmFibGVkOiB0cnVlCiAgICBlbmFibGVFZGl0aW5nOiB0cnVlCiAgc2VjdXJlOiBmYWxzZQogIHNlcnZpY2U6CiAgICBwb3J0czoKICAgICAgaHR0cDogODAKICAgIHR5cGU6IExvYWRCYWxhbmNlcgp3b3JrZmxvd3M6CiAgcmJhYzoKICAgIGNyZWF0ZTogdHJ1ZQpwb3N0Z3Jlc3FsOgogIGVuYWJsZWQ6IHRydWUKICBzZXJ2aWNlOgogICAgcG9ydHM6CiAgICAgIHBvc3RncmVzcWw6IDU0MzIKbXlzcWw6CiAgZW5hYmxlZDogZmFsc2U=",
|
||||
"target_platform": {
|
||||
"target_platform_id": "{VIB_ENV_TARGET_PLATFORM}",
|
||||
"size": {
|
||||
@@ -37,6 +37,16 @@
|
||||
"endpoint": "lb-argo-workflows-server-http",
|
||||
"app_protocol": "HTTP"
|
||||
}
|
||||
},
|
||||
{
|
||||
"action_id": "cypress",
|
||||
"params": {
|
||||
"resources": {
|
||||
"path": "/.vib/argo-workflows/cypress"
|
||||
},
|
||||
"endpoint": "lb-argo-workflows-server-http",
|
||||
"app_protocol": "HTTP"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -35,4 +35,4 @@ sources:
|
||||
- https://github.com/bitnami/containers/tree/main/bitnami/argo-workflow-controller
|
||||
- https://github.com/bitnami/containers/tree/main/bitnami/argo-workflow-exec
|
||||
- https://argoproj.github.io/workflows/
|
||||
version: 4.0.1
|
||||
version: 4.1.0
|
||||
|
||||
@@ -20,19 +20,33 @@ Return the proper executor image name
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper service name for Argo Workflows server
|
||||
Return the proper resource name for Argo Workflows server
|
||||
*/}}
|
||||
{{- define "argo-workflows.server.fullname" -}}
|
||||
{{- printf "%s-server" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper service name for Argo Workflows controller
|
||||
Return the proper resource name for Argo Workflows server including the chart's release namespace
|
||||
*/}}
|
||||
{{- define "argo-workflows.server.fullname.namespace" -}}
|
||||
{{- printf "%s-server" (include "common.names.fullname.namespace" .) | trunc 63 | trimSuffix "-" }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper resource name for Argo Workflows controller
|
||||
*/}}
|
||||
{{- define "argo-workflows.controller.fullname" -}}
|
||||
{{- printf "%s-controller" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper resource name for Argo Workflows controller including the chart's release namespace
|
||||
*/}}
|
||||
{{- define "argo-workflows.controller.fullname.namespace" -}}
|
||||
{{- printf "%s-controller" (include "common.names.fullname.namespace" .) | trunc 63 | trimSuffix "-" }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create a default fully qualified postgresql name.
|
||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: {{ include "common.names.fullname" . }}-view
|
||||
name: {{ include "common.names.fullname.namespace" . }}-view
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
rbac.authorization.k8s.io/aggregate-to-view: "true"
|
||||
@@ -36,7 +36,7 @@ rules:
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: {{ include "common.names.fullname" . }}-edit
|
||||
name: {{ include "common.names.fullname.namespace" . }}-edit
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
rbac.authorization.k8s.io/aggregate-to-edit: "true"
|
||||
@@ -75,7 +75,7 @@ rules:
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: {{ include "common.names.fullname" . }}-admin
|
||||
name: {{ include "common.names.fullname.namespace" . }}-admin
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
rbac.authorization.k8s.io/aggregate-to-admin: "true"
|
||||
|
||||
@@ -6,7 +6,7 @@ kind: RoleBinding
|
||||
kind: ClusterRoleBinding
|
||||
{{- end }}
|
||||
metadata:
|
||||
name: {{ include "argo-workflows.controller.fullname" . }}
|
||||
name: {{ include "argo-workflows.controller.fullname.namespace" . }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
app.kubernetes.io/part-of: argo-workflows
|
||||
@@ -24,7 +24,7 @@ roleRef:
|
||||
{{ else }}
|
||||
kind: ClusterRole
|
||||
{{- end }}
|
||||
name: {{ include "argo-workflows.controller.fullname" . }}
|
||||
name: {{ include "argo-workflows.controller.fullname.namespace" . }}
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: {{ include "argo-workflows.controller.serviceAccountName" . }}
|
||||
@@ -46,7 +46,7 @@ subjects:
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: {{ include "argo-workflows.controller.fullname" . }}-cluster-template
|
||||
name: {{ include "argo-workflows.controller.fullname.namespace" . }}-cluster-template
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
app.kubernetes.io/component: controller
|
||||
@@ -59,7 +59,7 @@ metadata:
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: {{ include "argo-workflows.controller.fullname" . }}-cluster-template
|
||||
name: {{ include "argo-workflows.controller.fullname.namespace" . }}-cluster-template
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: {{ include "argo-workflows.controller.serviceAccountName" . }}
|
||||
|
||||
@@ -6,7 +6,7 @@ kind: Role
|
||||
kind: ClusterRole
|
||||
{{- end }}
|
||||
metadata:
|
||||
name: {{ include "argo-workflows.controller.fullname" . }}
|
||||
name: {{ include "argo-workflows.controller.fullname.namespace" . }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
app.kubernetes.io/part-of: argo-workflows
|
||||
@@ -162,7 +162,7 @@ rules:
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: {{ include "argo-workflows.controller.fullname" . }}-cluster-template
|
||||
name: {{ include "argo-workflows.controller.fullname.namespace" . }}-cluster-template
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
app.kubernetes.io/part-of: argo-workflows
|
||||
|
||||
@@ -6,7 +6,7 @@ kind: Role
|
||||
kind: ClusterRole
|
||||
{{- end }}
|
||||
metadata:
|
||||
name: {{ include "argo-workflows.server.fullname" . }}
|
||||
name: {{ include "argo-workflows.server.fullname.namespace" . }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
app.kubernetes.io/part-of: argo-workflows
|
||||
@@ -134,7 +134,7 @@ rules:
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: {{ include "argo-workflows.server.fullname" . }}-cluster-template
|
||||
name: {{ include "argo-workflows.server.fullname.namespace" . }}-cluster-template
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
app.kubernetes.io/part-of: argo-workflows
|
||||
|
||||
@@ -6,7 +6,7 @@ kind: RoleBinding
|
||||
kind: ClusterRoleBinding
|
||||
{{- end }}
|
||||
metadata:
|
||||
name: {{ include "argo-workflows.server.fullname" . }}
|
||||
name: {{ include "argo-workflows.server.fullname.namespace" . }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
app.kubernetes.io/part-of: argo-workflows
|
||||
@@ -24,7 +24,7 @@ roleRef:
|
||||
{{ else }}
|
||||
kind: ClusterRole
|
||||
{{- end }}
|
||||
name: {{ include "argo-workflows.server.fullname" . }}
|
||||
name: {{ include "argo-workflows.server.fullname.namespace" . }}
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: {{ include "argo-workflows.server.serviceAccountName" . }}
|
||||
@@ -35,7 +35,7 @@ subjects:
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: {{ include "argo-workflows.server.fullname" . }}-cluster-template
|
||||
name: {{ include "argo-workflows.server.fullname.namespace" . }}-cluster-template
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
app.kubernetes.io/part-of: argo-workflows
|
||||
@@ -49,7 +49,7 @@ metadata:
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: {{ include "argo-workflows.server.fullname" . }}-cluster-template
|
||||
name: {{ include "argo-workflows.server.fullname.namespace" . }}-cluster-template
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: {{ include "argo-workflows.server.serviceAccountName" . }}
|
||||
|
||||
Reference in New Issue
Block a user