Envtest based integration tests for Fission (#2858)

* skeleton for envtest fission
* Refactor code and add CLI test
* hack
* Update server test
* remove skip-ci for lint tests
* Pass client go storagesvc
* Add clientGen interface across code
* Fix storagesvc test
* Fix cmd client
* add retry in server test
* Fix concurrenct access to pool deployment
* Remove old executor test
* get rid of ginkgo/gomega
* disable flaky test
* flaky test
* revert ci change
* handle err from ParseBool

---------

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
Co-authored-by: Pranoy Kundu <pranoy1998k@gmail.com>
This commit is contained in:
Sanket Sudake
2023-10-26 12:09:11 +05:30
committed by GitHub
co-authored by Pranoy Kundu
parent 15e16fcc82
commit 8a17d391c5
44 changed files with 534 additions and 524 deletions
+2 -17
View File
@@ -48,10 +48,11 @@ func SetupPortForward(ctx context.Context, client cmd.Client, namespace, labelSe
console.Verbose(2, "Setting up port forward to %s in namespace %s",
labelSelector, namespace)
localPort, err := findFreePort()
lcPort, err := utils.FindFreePort()
if err != nil {
return "", errors.Wrap(err, "error finding unused port")
}
localPort := strconv.Itoa(lcPort)
var waitDuration time.Duration = 50
@@ -103,22 +104,6 @@ func SetupPortForward(ctx context.Context, client cmd.Client, namespace, labelSe
return localPort, nil
}
func findFreePort() (string, error) {
listener, err := net.Listen("tcp", ":0")
if err != nil {
return "", err
}
port := strconv.Itoa(listener.Addr().(*net.TCPAddr).Port)
err = listener.Close()
if err != nil {
return "", err
}
return port, nil
}
// runPortForward creates a local port forward to the specified pod
func runPortForward(ctx context.Context, client cmd.Client, labelSelector string, localPort string, ns string) (chan struct{}, chan struct{}, error) {