From 102084320760853b1a3e79bcfcfa52add5dc7f83 Mon Sep 17 00:00:00 2001 From: Animesh Pathak Date: Mon, 2 Sep 2024 15:54:30 +0530 Subject: [PATCH] feat: add keploy to arkade Signed-off-by: Animesh Pathak --- README.md | 3 ++- pkg/get/get_test.go | 65 +++++++++++++++++++++++++++++++++++++++++++++ pkg/get/tools.go | 31 +++++++++++++++++++++ 3 files changed, 98 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5fbca9569..5d0c6f19e 100644 --- a/README.md +++ b/README.md @@ -824,7 +824,8 @@ There are 52 apps that you can install on your cluster. | [k3s](https://github.com/k3s-io/k3s) | Lightweight Kubernetes | | [k3sup](https://github.com/alexellis/k3sup) | Bootstrap Kubernetes with k3s over SSH < 1 min. | | [k9s](https://github.com/derailed/k9s) | Provides a terminal UI to interact with your Kubernetes clusters. | -| [kail](https://github.com/boz/kail) | Kubernetes log viewer. | +| [kail](https://github.com/boz/kail) | Kubernetes log viewer. +| [keploy](https://github.com/keploy/keploy) | Generate tests and stubs for your application that actually work! | | [kgctl](https://github.com/squat/kilo) | A CLI to manage Kilo, a multi-cloud network overlay built on WireGuard and designed for Kubernetes. | | [kim](https://github.com/rancher/kim) | Build container images inside of Kubernetes. (Experimental) | | [kind](https://github.com/kubernetes-sigs/kind) | Run local Kubernetes clusters using Docker container nodes. | diff --git a/pkg/get/get_test.go b/pkg/get/get_test.go index 153383ae9..55b708b00 100644 --- a/pkg/get/get_test.go +++ b/pkg/get/get_test.go @@ -7650,3 +7650,68 @@ func Test_DownloadLazyDocker(t *testing.T) { } } + +func Test_DownloadKeploy(t *testing.T) { + tools := MakeTools() + name := "keploy" + + tool := getTool(name, tools) + + const toolVersion = "v2.3.0" + + tests := []test{ + { + os: "linux", + arch: arch64bit, + version: toolVersion, + url: "https://github.com/keploy/keploy/releases/download/v2.3.0-beta15/keploy_linux_amd64.tar.gz", + }, + { + os: "linux", + arch: archARM64, + version: toolVersion, + url: "https://github.com/keploy/keploy/releases/download/v2.3.0-beta15/keploy_linux_arm64.tar.gz", + }, + { + os: "darwin", + arch: archDarwinARM64, + version: toolVersion, + url: "https://github.com/keploy/keploy/releases/download/v2.3.0-beta15/keploy_darwin_all.tar.gz", + }, + { + os: "ming", + arch: archARM64, + version: toolVersion, + url: "https://github.com/keploy/keploy/releases/download/v2.3.0-beta15/keploy_windows_amd64.tar.gz", + }, + { + os: "ming", + arch: arch64bit, + version: toolVersion, + url: "https://github.com/keploy/keploy/releases/download/v2.3.0-beta15/keploy_Windows_x86_64.tar.gz", + }, + { + os: "ming", + arch: "armv6l", + version: toolVersion, + url: "https://github.com/keploy/keploy/releases/download/v2.3.0-beta15/keploy_Windows_armv6.tar.gz", + }, + { + os: "ming", + arch: archARM7, + version: toolVersion, + url: "https://github.com/keploy/keploy/releases/download/v2.3.0-beta15/keploy_Windows_armv7.tar.gz", + }, + } + + for _, tc := range tests { + got, err := tool.GetURL(tc.os, tc.arch, tc.version, false) + if err != nil { + t.Fatal(err) + } + if got != tc.url { + t.Errorf("\nwant: %s, \n got: %s", tc.url, got) + } + } + +} diff --git a/pkg/get/tools.go b/pkg/get/tools.go index 53d2578a3..54af4ad26 100644 --- a/pkg/get/tools.go +++ b/pkg/get/tools.go @@ -4202,5 +4202,36 @@ https://github.com/{{.Owner}}/{{.Repo}}/releases/download/{{.Version}}/{{.Name}} {{.Name}}_{{.VersionNumber}}_{{$osStr}}_{{$arch}}.{{$ext}}`, }) + + tools = append(tools, + Tool{ + Owner: "keploy", + Repo: "keploy", + Name: "keploy", + Description: "Test generation for Developers. Generate tests and stubs for your application that actually work!", + BinaryTemplate: ` + {{ $os := .OS }} + {{ $arch := .Arch }} + {{ $ext := "tar.gz" }} + {{- if eq .Arch "aarch64" -}} + {{$arch = "arm64"}} + {{- else if eq .Arch "arm64" -}} + {{ $arch = "arm64" }} + {{- else if eq .Arch "x86_64" -}} + {{ $arch = "amd64" }} + {{- end -}} + {{ if HasPrefix .OS "ming" -}} + {{$os = "windows"}} + {{$ext = "zip"}} + {{- end -}} + {{- if eq .OS "darwin" -}} + {{$os = "darwin_all"}} + {{- else if eq .OS "linux" -}} + {{ $os = "linux" }} + {{- end -}} + keploy_{{$os}}.{{$ext}} + `, + }) + return tools }