Skip to content

Cleanup UI integration tests #2055

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Dec 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
runs-on: ubuntu-latest
os-name: linux
timeout-minutes: 120
label-filter: "--label-filter='!(smoke, upgrade)'"
label-filter: "--label-filter='!(smoke, upgrade&&(cluster))'"
kubectl-version: "v1.23.3"
login_user_type: "oidc"
git-provider: gitlab
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
runs-on: ubuntu-latest
os-name: linux
timeout-minutes: 90
label-filter: "--label-filter='!(capd, upgrade, kind-gitops-cluster, leaf-application, leaf-policy, leaf-violation)'"
label-filter: "--label-filter='!(smoke, capd, upgrade&&(cluster), leaf-cluster, leaf-application, leaf-policy, leaf-violation)'"
kubectl-version: "v1.23.6"
login_user_type: "oidc"
git-provider: github
Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:
runs-on: ubuntu-latest
os-name: linux
timeout-minutes: 90
label-filter: "--label-filter='!(upgrade, capd, kind-gitops-cluster, tenant, leaf-application, leaf-policy, leaf-violation)'"
label-filter: "--label-filter='!(smoke, upgrade&&(cluster), capd, tenant, leaf-cluster, leaf-application, leaf-policy, leaf-violation)'"
kubectl-version: "v1.23.3"
login_user_type: "cluster-user"
git-provider: gitlab
Expand Down
36 changes: 15 additions & 21 deletions test/acceptance/test/acceptance_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ import (
var theT *testing.T

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

TakeScreenShot(randID) //Save the screenshot of failure
DumpingDOM(randID)
DumpBrowserLogs(randID)
DumpResources(randID)
DumpClusterInfo(randID)
DumpConfigRepo(randID)
takeScreenShot(randID) //Save the screenshot of failure
dumpingDOM(randID)
dumpBrowserLogs(randID)
dumpResources(randID)
dumpClusterInfo(randID)
dumpConfigRepo(randID)

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

// Runs the UI tests
DescribeSpecsUi(RealGitopsTestRunner{})
// Runs the CLI tests
DescribeSpecsCli(RealGitopsTestRunner{})

ginkgo.RunSpecs(t, "Weave GitOps Enterprise Acceptance Tests")

}

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

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

CheckClusterService(wge_endpoint_url) // Cluster service should be running before running any test for enterprise
checkClusterService(wgeEndpointUrl) // Cluster service should be running before running any test for enterprise
})

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

deleteRepo(gitProviderEnv) // Delete the config repository to keep the org clean
Expand Down
Loading