Skip to content

Commit 6b8f82d

Browse files
authored
Cleanup UI integration tests (#2055)
* Deleted UI integration test directory * Deleted runner Describe from all specs * Delete all testrunner references and updated with standard function calls * Changed test-suite puplic functions to private as they are not referenced outside of package * Updated acceptance test lables because no more UI integration exclusion is needed
1 parent 6eee381 commit 6b8f82d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+5124
-8037
lines changed

.github/workflows/nightly.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
runs-on: ubuntu-latest
2525
os-name: linux
2626
timeout-minutes: 120
27-
label-filter: "--label-filter='!(smoke, upgrade)'"
27+
label-filter: "--label-filter='!(smoke, upgrade&&(cluster))'"
2828
kubectl-version: "v1.23.3"
2929
login_user_type: "oidc"
3030
git-provider: gitlab
@@ -56,7 +56,7 @@ jobs:
5656
runs-on: ubuntu-latest
5757
os-name: linux
5858
timeout-minutes: 90
59-
label-filter: "--label-filter='!(capd, upgrade, kind-gitops-cluster, leaf-application, leaf-policy, leaf-violation)'"
59+
label-filter: "--label-filter='!(smoke, capd, upgrade&&(cluster), leaf-cluster, leaf-application, leaf-policy, leaf-violation)'"
6060
kubectl-version: "v1.23.6"
6161
login_user_type: "oidc"
6262
git-provider: github
@@ -87,7 +87,7 @@ jobs:
8787
runs-on: ubuntu-latest
8888
os-name: linux
8989
timeout-minutes: 90
90-
label-filter: "--label-filter='!(upgrade, capd, kind-gitops-cluster, tenant, leaf-application, leaf-policy, leaf-violation)'"
90+
label-filter: "--label-filter='!(smoke, upgrade&&(cluster), capd, tenant, leaf-cluster, leaf-application, leaf-policy, leaf-violation)'"
9191
kubectl-version: "v1.23.3"
9292
login_user_type: "cluster-user"
9393
git-provider: gitlab

test/acceptance/test/acceptance_suite_test.go

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ import (
1111
var theT *testing.T
1212

1313
func GomegaFail(message string, callerSkip ...int) {
14-
randID := RandString(16)
14+
randID := randString(16)
1515
logger.Error("Spec has failed, capturing failure...")
16-
logger.Tracef("Dumping artifacts to %s with prefix %s", artifacts_base_dir, randID)
16+
logger.Tracef("Dumping artifacts to %s with prefix %s", artifactsBaseDir, randID)
1717

18-
TakeScreenShot(randID) //Save the screenshot of failure
19-
DumpingDOM(randID)
20-
DumpBrowserLogs(randID)
21-
DumpResources(randID)
22-
DumpClusterInfo(randID)
23-
DumpConfigRepo(randID)
18+
takeScreenShot(randID) //Save the screenshot of failure
19+
dumpingDOM(randID)
20+
dumpBrowserLogs(randID)
21+
dumpResources(randID)
22+
dumpClusterInfo(randID)
23+
dumpConfigRepo(randID)
2424

2525
//Pass this down to the default handler for onward processing
2626
ginkgo.Fail(message, callerSkip...)
@@ -35,21 +35,15 @@ func TestAcceptance(t *testing.T) {
3535
//Intercept the assertiona Failure
3636
gomega.RegisterFailHandler(GomegaFail)
3737

38-
// Runs the UI tests
39-
DescribeSpecsUi(RealGitopsTestRunner{})
40-
// Runs the CLI tests
41-
DescribeSpecsCli(RealGitopsTestRunner{})
42-
4338
ginkgo.RunSpecs(t, "Weave GitOps Enterprise Acceptance Tests")
44-
4539
}
4640

4741
var _ = ginkgo.BeforeSuite(func() {
4842
gomega.SetDefaultEventuallyTimeout(ASSERTION_DEFAULT_TIME_OUT) // Things are slow when running on Kind
49-
SetupTestEnvironment() // Read OS environment variables and initialize the test environment
50-
InitializeLogger("acceptance-tests.log") // Initilaize the global logger and tee Ginkgowriter
51-
InstallWeaveGitopsControllers() // Install weave gitops core and enterprise controllers
52-
InitializeWebdriver(test_ui_url) // Initilize web driver for whole test suite run
43+
setupTestEnvironment() // Read OS environment variables and initialize the test environment
44+
initializeLogger("acceptance-tests.log") // Initilaize the global logger and tee Ginkgowriter
45+
installWeaveGitopsControllers() // Install weave gitops core and enterprise controllers
46+
initializeWebdriver(testUiUrl) // Initilize web driver for whole test suite run
5347

5448
ginkgo.By(fmt.Sprintf("Login as a %s user", userCredentials.UserType), func() {
5549
loginUser() // Login to the weaveworks enterprise dashboard
@@ -59,14 +53,14 @@ var _ = ginkgo.BeforeSuite(func() {
5953
}
6054
})
6155

62-
CheckClusterService(wge_endpoint_url) // Cluster service should be running before running any test for enterprise
56+
checkClusterService(wgeEndpointUrl) // Cluster service should be running before running any test for enterprise
6357
})
6458

6559
var _ = ginkgo.AfterSuite(func() {
6660
//Tear down the suite level setup
6761
ginkgo.By(fmt.Sprintf("Logout as a %s user", userCredentials.UserType), func() {
68-
gomega.Expect(webDriver.Navigate(test_ui_url)).To(gomega.Succeed()) // Make sure the UI should not has any popups and modal dialogs
69-
logoutUser() // Logout to the weaveworks enterprise
62+
gomega.Expect(webDriver.Navigate(testUiUrl)).To(gomega.Succeed()) // Make sure the UI should not has any popups and modal dialogs
63+
logoutUser() // Logout to the weaveworks enterprise
7064
})
7165

7266
deleteRepo(gitProviderEnv) // Delete the config repository to keep the org clean

0 commit comments

Comments
 (0)