From e9ebc1f6938633f8b6f7759b4bbd1b4cf88fb5f4 Mon Sep 17 00:00:00 2001 From: rcmadhankumar Date: Thu, 5 Oct 2023 13:05:40 +0530 Subject: [PATCH] Additonal checks added to the test cases --- cli/test/e2e/package_repository_test.go | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/cli/test/e2e/package_repository_test.go b/cli/test/e2e/package_repository_test.go index 9283f701b4..0bc7356926 100644 --- a/cli/test/e2e/package_repository_test.go +++ b/cli/test/e2e/package_repository_test.go @@ -6,6 +6,7 @@ package e2e import ( "fmt" "testing" + "time" uitest "github.com/cppforlife/go-cli-ui/ui/test" "github.com/stretchr/testify/require" @@ -65,7 +66,14 @@ func TestPackageRepository(t *testing.T) { }) logger.Section("adding of existing repository", func() { - kappCtrl.Run([]string{"package", "repository", "add", "-r", pkgrName, "--url", pkgrURL}) + start := time.Now() + out := kappCtrl.Run([]string{"package", "repository", "add", "-r", pkgrName, "--url", pkgrURL}) + elapsed := time.Since(start).Seconds() + require.Equal(t, elapsed < 5, true, "Adding of existing package repository takes more than 5 seconds") + require.Contains(t, out, "Fetch succeeded") + require.Contains(t, out, "Template succeeded") + require.Contains(t, out, "Deploy succeeded") + require.Contains(t, out, "Succeeded") }) logger.Section("adding of existing repository with new url", func() { @@ -161,7 +169,15 @@ func TestPackageRepository(t *testing.T) { }) logger.Section("updating a repository with no change in url", func() { - kappCtrl.Run([]string{"package", "repository", "update", "-r", pkgrName, "--url", pkgrURL}) + start := time.Now() + out := kappCtrl.Run([]string{"package", "repository", "update", "-r", pkgrName, "--url", pkgrURL}) + elapsed := time.Since(start).Seconds() + require.Equal(t, elapsed < 5, true, "Adding of existing package repository takes more than 5 seconds") + require.Contains(t, out, "Fetch succeeded") + require.Contains(t, out, "Template succeeded") + require.Contains(t, out, "Deploy succeeded") + require.Contains(t, out, "Succeeded") + }) logger.Section("creating a repository in a new namespace that doesn't exist", func() {