Skip to content

Alerting E2E test

Sarah Yasonik requested to merge qa-alerting-test into master

What does this MR do?

Adds a QA which covers the alerting portion of the Monitor domain. This has a tendency to break decently often, and having tests available for the entire flow would be valuable.

Related Issue: #31412 (closed)

This test:

  1. sets up a cluster
  2. creates a project
  3. connects the cluster to the project
  4. sets up a stripped down Auto Devops pipeline
  5. deploys the application
  6. performs basic CRUD operations on alerts from the metrics dashboard

Future work outside of the scope of this MR

  1. Testing that the alert can be triggered
  2. Refactoring to have this test and qa/qa/specs/features/ee/browser_ui/8_monitor/health/cluster_health_spec.rb use the same cluster & application

Local Testing with Minikube:

I made the following tweaks/configuration to run the tests locally.

  1. Setup local environment per https://gitlab.com/gitlab-org/gitlab-development-kit/blob/master/doc/howto/auto_devops.md#auto-devops.
  2. Update https://gitlab.com/gitlab-org/gitlab/blob/master/qa%2Fqa%2Fservice%2Fkubernetes_cluster.rb#L14 to def initialize(rbac: true, provider_class: QA::Service::ClusterProvider::Minikube)
  3. Update https://gitlab.com/gitlab-org/gitlab/blob/master/qa%2Fqa%2Fservice%2Fcluster_provider%2Fminikube.rb#L17 to shell 'minikube start --kubernetes-version v1.15.4' to pin the kubernetes version for compatibility. Will open a separate MR to do this.
  4. If getting excessive timeouts, insert a new http client at https://gitlab.com/gitlab-org/gitlab/blob/master/qa%2Fqa%2Fruntime%2Fbrowser.rb#L101 like so:
new_client = Selenium::WebDriver::Remote::Http::Default.new
new_client.read_timeout = 120 # seconds

selenium_options = {
  browser: QA::Runtime::Env.browser,
  clear_local_storage: true,
  desired_capabilities: capabilities,
  http_client: new_client,
  options: options
}

From the qa directory in the gitlab project, run:

QA_DEBUG=true CHROME_HEADLESS=no bundle exec bin/qa Test::Instance::All https://20150.qa-tunnel.gitlab.info -- -f d --tag kubernetes qa/specs/features/ee/browser_ui/8_monitor/health/alerting_spec.rb

to see the test & follow along in the UI.

Testing with GKE

A region needs to be set via the GCLOUD_REGION var:

QA_DEBUG=true GCLOUD_REGION=us-central1-a bundle exec bin/qa Test::Instance::All https://20150.qa-tunnel.gitlab.info -- -f d --tag kubernetes qa/specs/features/ee/browser_ui/8_monitor/health/alerting_spec.rb

More info on running tests with GDK: https://gitlab.com/gitlab-org/gitlab-qa/blob/master/docs/run_qa_against_gdk.md

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Sarah Yasonik

Merge request reports

Loading