Add faster login mechanism for end-to-end tests and make tests use it
What does this MR do?
Closes #27271.
With this mechanism, it is possible to log into GitLab passing secrets as query strings of the /users/qa_sign_in
relative URL.
This MR also replaces most occurrences of the sign_in
flow by the formless_login
flow, which should make a significant improvement on the tests' performance, besides making them more independent.
Note: before merging this MR, we need to have the following issue closed https://gitlab.com/gitlab-com/gl-infra/infrastructure/-/issues/9897.
Note 2: It's already possible to see some performance improvement if we compare this job where the formless login wasn't in place (https://gitlab.com/gitlab-org/gitlab-qa-mirror/-/jobs/544429922), which took 19 minutes and 41 seconds, compared to this one https://gitlab.com/gitlab-org/gitlab-qa-mirror/-/jobs/544737279, that took 17 minutes and 8 seconds. It doesn't seem much, but if we multiply this difference by the number of times such tests are executed per day, I imagine it will turn into an excellent time-saving.
Note 3: For more details, see the following comment on the original issue #27271 (comment 309547672), and the comments on the original MR !27788 (closed), which was closed without merging.
Related MRs: gitlab-qa!429 (merged) and omnibus-gitlab!4119 (merged).
Running one of the updated end-to-end tests
Use the following command to run a test that uses the formless login mechanism GITLAB_QA_FORMLESS_LOGIN_TOKEN=some-super-secret-token bundle exec bin/qa Test::Instance::All http://localhost:3000 -- qa/specs/features/browser_ui/2_plan/issue/mentions_spec.rb
Does this MR meet the acceptance criteria?
Conformity
- [-] Changelog entry
- [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
-
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
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
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