E2E test: use commit_email for checking diffs
What does this MR do and why?
With !150855 (merged), in the qa/qa/specs/features/browser_ui/3_create/repository/user_views_commit_diff_patch_spec.rb
test we no longer send in explicit author_email
when creating a commit via the API, this means that these commits will have the commit_email
of the user who created the commit by default. This change was made because it is confusing to use a different email than the user's email (even though you can).
This has caused a failure issue in production https://gitlab.com/gitlab-org/gitlab/-/issues/458615 where the test was previously explicitly setting the email address of the commit to the public_email
of the user (in prod the gitlab qa doesn't have a public email, so it defaults to the default_email
in the tests which is 'admin@example.com'
). So when validating this fails as the commit now uses the commit_email
of the user which is gitlab-qa@gitlab.com
.
Now in the test we will use the commit_email
of the user by default, so when validating the commit we need to use the commit_email
also:
!150855 (diffs)
Resolves https://gitlab.com/gitlab-org/gitlab/-/issues/458615
This test doesn't fail in staging as the gitlab qa
user in staging has the same public_email
as their commit_email
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
How to set up and validate locally
QA_LOG_LEVEL=DEBUG QA_GITLAB_URL=https://gdk.test:3443 bundle exec rspec qa/specs/features/browser_ui/3_create/merge_request/view_merge_request_diff_patch_spec.rb
I've also tested this test against staging.