diff --git a/README.md b/README.md
index 3940ab8..cebbd2b 100644
--- a/README.md
+++ b/README.md
@@ -88,6 +88,16 @@ The official helm chart is [available here](https://github.com/komodorio/helm-ch
Download the appropriate [release package](https://github.com/komodorio/helm-dashboard/releases) for your platform, unpack it and just run `dashboard` binary from it.
+## Execute Helm tests
+
+For all the release(s) (istalled helm charts), you can execute helm tests for that release. For the tests to execute successfully, you need to have existing tests for that helm chart
+
+You can execute `helm test` for the specific release as below:
+
+
+The result of executed `helm test` for the release will be disapled as below:
+
+
## Scanner Integrations
Upon startup, Helm Dashboard detects the presence of [Trivy](https://github.com/aquasecurity/trivy)
diff --git a/pkg/dashboard/api.go b/pkg/dashboard/api.go
index e8246f0..5f2917c 100644
--- a/pkg/dashboard/api.go
+++ b/pkg/dashboard/api.go
@@ -112,6 +112,7 @@ func configureHelms(api *gin.RouterGroup, data *subproc.DataLayer) {
api.GET("/charts/:section", h.GetInfoSection)
api.GET("/charts/show", h.Show)
api.POST("/charts/install", h.Install)
+ api.POST("/charts/tests", h.Tests)
api.POST("/charts/rollback", h.Rollback)
api.GET("/repo", h.RepoList)
diff --git a/pkg/dashboard/handlers/helmHandlers.go b/pkg/dashboard/handlers/helmHandlers.go
index 34f25c5..4a2c209 100644
--- a/pkg/dashboard/handlers/helmHandlers.go
+++ b/pkg/dashboard/handlers/helmHandlers.go
@@ -176,6 +176,22 @@ func (h *HelmHandler) Install(c *gin.Context) {
c.String(http.StatusAccepted, out)
}
+func (h *HelmHandler) Tests(c *gin.Context) {
+ qp, err := utils.GetQueryProps(c, false)
+ if err != nil {
+ _ = c.AbortWithError(http.StatusBadRequest, err)
+ return
+ }
+
+ out, err := h.Data.RunTests(qp.Namespace, qp.Name)
+ if err != nil {
+ _ = c.AbortWithError(http.StatusInternalServerError, err)
+ return
+ }
+
+ c.String(http.StatusOK, out)
+}
+
func (h *HelmHandler) GetInfoSection(c *gin.Context) {
qp, err := utils.GetQueryProps(c, true)
if err != nil {
diff --git a/pkg/dashboard/static/actions.js b/pkg/dashboard/static/actions.js
index a116475..f0492b9 100644
--- a/pkg/dashboard/static/actions.js
+++ b/pkg/dashboard/static/actions.js
@@ -343,3 +343,18 @@ $("#btnAddRepository").click(function () {
setHashParam("section", "repository")
window.location.reload()
})
+
+$("#btnTest").click(function() {
+ $("#testModal .test-result").empty().prepend('')
+ $.ajax({
+ type: 'POST',
+ url: "/api/helm/charts/tests" + "?namespace=" + getHashParam("namespace") + "&name=" + getHashParam("chart")
+ }).fail(function (xhr) {
+ reportError("Failed to execute test for chart", xhr)
+ }).done(function (data) {
+ $("#testModal .test-result").empty().html(data.replaceAll("\n", "
"))
+ })
+
+ const myModal = new bootstrap.Modal(document.getElementById('testModal'), {});
+ myModal.show()
+})
\ No newline at end of file
diff --git a/pkg/dashboard/static/index.html b/pkg/dashboard/static/index.html
index 47df5ca..8448582 100644
--- a/pkg/dashboard/static/index.html
+++ b/pkg/dashboard/static/index.html
@@ -194,6 +194,9 @@
+
@@ -417,6 +420,26 @@
+