Alerting E2E test
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:
- sets up a cluster
- creates a project
- connects the cluster to the project
- sets up a stripped down Auto Devops pipeline
- deploys the application
- performs basic CRUD operations on alerts from the metrics dashboard
Future work outside of the scope of this MR
- Testing that the alert can be triggered
- 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.
- Setup local environment per https://gitlab.com/gitlab-org/gitlab-development-kit/blob/master/doc/howto/auto_devops.md#auto-devops.
- 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)
- 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. - 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
- [n/a] Changelog entry
- [n/a] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [n/a] Database guides
- [n/a] Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers
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