Commit 5564ae35 authored by Ramya Authappan's avatar Ramya Authappan

Merge branch 'ml-note-requires-admin' into 'master'

Note that `:requires_admin` should be added

See merge request gitlab-org/gitlab!29460
parents bbb217d4 c872f3c3
# Testing with feature flags # Testing with feature flags
To run a specific test with a feature flag enabled you can use the `QA::Runtime::Feature` class to enabled and disable feature flags ([via the API](../../../api/features.md)). To run a specific test with a feature flag enabled you can use the `QA::Runtime::Feature` class to enable and disable feature flags ([via the API](../../../api/features.md)).
Note that administrator authorization is required to change feature flags. `QA::Runtime::Feature` will automatically authenticate as an administrator as long as you provide an appropriate access token via `GITLAB_QA_ADMIN_ACCESS_TOKEN` (recommended), or provide `GITLAB_ADMIN_USERNAME` and `GITLAB_ADMIN_PASSWORD`. Note that administrator authorization is required to change feature flags. `QA::Runtime::Feature` will automatically authenticate as an administrator as long as you provide an appropriate access token via `GITLAB_QA_ADMIN_ACCESS_TOKEN` (recommended), or provide `GITLAB_ADMIN_USERNAME` and `GITLAB_ADMIN_PASSWORD`.
Please be sure to include the tag `:requires_admin` so that the test can be skipped in environments where admin access is not available.
```ruby ```ruby
context "with feature flag enabled" do context "with feature flag enabled", :requires_admin do
before do before do
Runtime::Feature.enable('feature_flag_name') Runtime::Feature.enable('feature_flag_name')
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment